User: chirino
Date: 01/09/25 22:02:28
Modified: src/main/org/jboss/mq/il/jvm JVMClientIL.java
JVMServerIL.java
Log:
Several modification to support the client connection sending ping messages
to the server and the server sending back pong messages. These messages
are used to determine if the connection has gone down.
This fixes the bug with the ExceptionListner not being notified of
the server failing when the client is only receiving messages.
Revision Changes Path
1.3 +64 -23 jbossmq/src/main/org/jboss/mq/il/jvm/JVMClientIL.java
Index: JVMClientIL.java
===================================================================
RCS file: /cvsroot/jboss/jbossmq/src/main/org/jboss/mq/il/jvm/JVMClientIL.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- JVMClientIL.java 2001/08/17 03:04:03 1.2
+++ JVMClientIL.java 2001/09/26 05:02:28 1.3
@@ -1,5 +1,5 @@
/*
- * JBossMQ, the OpenSource JMS implementation
+ * JBoss, the OpenSource J2EE webOS
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
@@ -15,46 +15,87 @@
import org.jboss.mq.il.ClientIL;
/**
- * The RMI implementation of the ConnectionReceiver object
+ * The RMI implementation of the ConnectionReceiver object
*
- * @author Norbert Lataille ([EMAIL PROTECTED])
- * @author Hiram Chirino ([EMAIL PROTECTED])
- * @created August 16, 2001
- * @version $Revision: 1.2 $
+ * @author Norbert Lataille ([EMAIL PROTECTED])
+ * @author Hiram Chirino ([EMAIL PROTECTED])
+ * @version $Revision: 1.3 $
+ * @created August 16, 2001
*/
-public class JVMClientIL implements ClientIL {
+public class JVMClientIL implements ClientIL
+{
// A reference to the connection
- Connection connection;
+ Connection connection;
// Are we running
- boolean stopped = true;
+ boolean stopped = true;
- JVMClientIL( Connection c ) {
+ JVMClientIL(Connection c)
+ {
connection = c;
}
+ /**
+ * #Description of the Method
+ *
+ * @exception Exception Description of Exception
+ */
public void close()
- throws Exception {
- if ( stopped ) {
- throw new IllegalStateException( "The client IL is stopped" );
+ throws Exception
+ {
+ if (stopped)
+ {
+ throw new IllegalStateException("The client IL is stopped");
}
connection.asynchClose();
}
//One TemporaryDestination has been deleted
- public void deleteTemporaryDestination( SpyDestination dest )
- throws JMSException {
- if ( stopped ) {
- throw new IllegalStateException( "The client IL is stopped" );
+ /**
+ * #Description of the Method
+ *
+ * @param dest Description of Parameter
+ * @exception JMSException Description of Exception
+ */
+ public void deleteTemporaryDestination(SpyDestination dest)
+ throws JMSException
+ {
+ if (stopped)
+ {
+ throw new IllegalStateException("The client IL is stopped");
}
- connection.asynchDeleteTemporaryDestination( dest );
+ connection.asynchDeleteTemporaryDestination(dest);
}
- public void receive( ReceiveRequest messages[] )
- throws Exception {
- if ( stopped ) {
- throw new IllegalStateException( "The client IL is stopped" );
+ /**
+ * #Description of the Method
+ *
+ * @param messages Description of Parameter
+ * @exception Exception Description of Exception
+ */
+ public void receive(ReceiveRequest messages[])
+ throws Exception
+ {
+ if (stopped)
+ {
+ throw new IllegalStateException("The client IL is stopped");
}
- connection.asynchDeliver( messages );
+ connection.asynchDeliver(messages);
+ }
+
+ /**
+ * pong method comment.
+ *
+ * @param serverTime Description of Parameter
+ * @exception IllegalStateException Description of Exception
+ */
+ public void pong(long serverTime)
+ throws IllegalStateException
+ {
+ if (stopped)
+ {
+ throw new IllegalStateException("The client IL is stopped");
+ }
+ connection.asynchPong(serverTime);
}
}
1.3 +239 -65 jbossmq/src/main/org/jboss/mq/il/jvm/JVMServerIL.java
Index: JVMServerIL.java
===================================================================
RCS file: /cvsroot/jboss/jbossmq/src/main/org/jboss/mq/il/jvm/JVMServerIL.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- JVMServerIL.java 2001/08/17 03:04:03 1.2
+++ JVMServerIL.java 2001/09/26 05:02:28 1.3
@@ -1,5 +1,5 @@
/*
- * JBossMQ, the OpenSource JMS implementation
+ * JBoss, the OpenSource J2EE webOS
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
@@ -23,123 +23,297 @@
import org.jboss.mq.server.JMSServer;
/**
- * The JVM implementation of the ServerIL object
+ * The JVM implementation of the ServerIL object
*
- * @author Hiram Chirino ([EMAIL PROTECTED])
- * @author Norbert Lataille ([EMAIL PROTECTED])
- * @created August 16, 2001
- * @version $Revision: 1.2 $
+ * @author Hiram Chirino ([EMAIL PROTECTED])
+ * @author Norbert Lataille ([EMAIL PROTECTED])
+ * @version $Revision: 1.3 $
+ * @created August 16, 2001
*/
-public class JVMServerIL implements org.jboss.mq.il.ServerIL {
+public class JVMServerIL implements org.jboss.mq.il.ServerIL
+{
//The server implementation
private JMSServer server;
- public JVMServerIL( JMSServer s ) {
+ /**
+ * Constructor for the JVMServerIL object
+ *
+ * @param s Description of Parameter
+ */
+ public JVMServerIL(JMSServer s)
+ {
server = s;
}
- public void setConnectionToken( ConnectionToken newConnectionToken ) {
+ /**
+ * Sets the ConnectionToken attribute of the JVMServerIL object
+ *
+ * @param newConnectionToken The new ConnectionToken value
+ */
+ public void setConnectionToken(ConnectionToken newConnectionToken)
+ {
// We cannot try to cache the token since this IL is stateless
}
- public void setEnabled( ConnectionToken dc, boolean enabled )
- throws Exception {
- server.setEnabled( dc, enabled );
+ /**
+ * Sets the Enabled attribute of the JVMServerIL object
+ *
+ * @param dc The new Enabled value
+ * @param enabled The new Enabled value
+ * @exception Exception Description of Exception
+ */
+ public void setEnabled(ConnectionToken dc, boolean enabled)
+ throws Exception
+ {
+ server.setEnabled(dc, enabled);
}
+ /**
+ * Gets the ID attribute of the JVMServerIL object
+ *
+ * @return The ID value
+ * @exception JMSException Description of Exception
+ */
public String getID()
- throws JMSException {
+ throws JMSException
+ {
return server.getID();
}
- public TemporaryQueue getTemporaryQueue( ConnectionToken dc )
- throws JMSException {
- return server.getTemporaryQueue( dc );
+ /**
+ * Gets the TemporaryQueue attribute of the JVMServerIL object
+ *
+ * @param dc Description of Parameter
+ * @return The TemporaryQueue value
+ * @exception JMSException Description of Exception
+ */
+ public TemporaryQueue getTemporaryQueue(ConnectionToken dc)
+ throws JMSException
+ {
+ return server.getTemporaryQueue(dc);
}
- public TemporaryTopic getTemporaryTopic( ConnectionToken dc )
- throws JMSException {
- return server.getTemporaryTopic( dc );
+ /**
+ * Gets the TemporaryTopic attribute of the JVMServerIL object
+ *
+ * @param dc Description of Parameter
+ * @return The TemporaryTopic value
+ * @exception JMSException Description of Exception
+ */
+ public TemporaryTopic getTemporaryTopic(ConnectionToken dc)
+ throws JMSException
+ {
+ return server.getTemporaryTopic(dc);
}
/**
- * No need to clone because there are no instance variables tha can get
- * clobbered. All Multiple connections can share the same JVMServerIL object
+ * No need to clone because there are no instance variables tha can get
+ * clobbered. All Multiple connections can share the same JVMServerIL object
*
- * @return Description of the Returned Value
+ * @return Description of the Returned Value
*/
- public ServerIL cloneServerIL() {
+ public ServerIL cloneServerIL()
+ {
return this;
}
- public void addMessage( ConnectionToken dc, SpyMessage val )
- throws JMSException {
- server.addMessage( dc, val.myClone() );
+ /**
+ * Adds a feature to the Message attribute of the JVMServerIL object
+ *
+ * @param dc The feature to be added to the Message attribute
+ * @param val The feature to be added to the Message attribute
+ * @exception JMSException Description of Exception
+ */
+ public void addMessage(ConnectionToken dc, SpyMessage val)
+ throws JMSException
+ {
+ server.addMessage(dc, val.myClone());
}
- public Topic createTopic( ConnectionToken dc, String dest )
- throws JMSException {
- return server.createTopic( dc, dest );
+ /**
+ * #Description of the Method
+ *
+ * @param dc Description of Parameter
+ * @param dest Description of Parameter
+ * @return Description of the Returned Value
+ * @exception JMSException Description of Exception
+ */
+ public Topic createTopic(ConnectionToken dc, String dest)
+ throws JMSException
+ {
+ return server.createTopic(dc, dest);
}
- public Queue createQueue( ConnectionToken dc, String dest )
- throws JMSException {
- return server.createQueue( dc, dest );
+ /**
+ * #Description of the Method
+ *
+ * @param dc Description of Parameter
+ * @param dest Description of Parameter
+ * @return Description of the Returned Value
+ * @exception JMSException Description of Exception
+ */
+ public Queue createQueue(ConnectionToken dc, String dest)
+ throws JMSException
+ {
+ return server.createQueue(dc, dest);
}
- public void deleteTemporaryDestination( ConnectionToken dc, SpyDestination dest )
- throws JMSException {
- server.deleteTemporaryDestination( dc, dest );
+ /**
+ * #Description of the Method
+ *
+ * @param dc Description of Parameter
+ * @param dest Description of Parameter
+ * @exception JMSException Description of Exception
+ */
+ public void deleteTemporaryDestination(ConnectionToken dc, SpyDestination dest)
+ throws JMSException
+ {
+ server.deleteTemporaryDestination(dc, dest);
}
- public void checkID( String ID )
- throws JMSException {
- server.checkID( ID );
+ /**
+ * #Description of the Method
+ *
+ * @param ID Description of Parameter
+ * @exception JMSException Description of Exception
+ */
+ public void checkID(String ID)
+ throws JMSException
+ {
+ server.checkID(ID);
}
- public void connectionClosing( ConnectionToken dc )
- throws JMSException {
- server.connectionClosing( dc );
+ /**
+ * #Description of the Method
+ *
+ * @param dc Description of Parameter
+ * @exception JMSException Description of Exception
+ */
+ public void connectionClosing(ConnectionToken dc)
+ throws JMSException
+ {
+ server.connectionClosing(dc);
}
- public void acknowledge( ConnectionToken dc, AcknowledgementRequest item )
- throws Exception {
- server.acknowledge( dc, item );
+ /**
+ * #Description of the Method
+ *
+ * @param dc Description of Parameter
+ * @param item Description of Parameter
+ * @exception Exception Description of Exception
+ */
+ public void acknowledge(ConnectionToken dc, AcknowledgementRequest item)
+ throws Exception
+ {
+ server.acknowledge(dc, item);
}
- public SpyMessage[] browse( ConnectionToken dc, Destination dest, String
selector )
- throws Exception {
- return server.browse( dc, dest, selector );
+ /**
+ * #Description of the Method
+ *
+ * @param dc Description of Parameter
+ * @param dest Description of Parameter
+ * @param selector Description of Parameter
+ * @return Description of the Returned Value
+ * @exception Exception Description of Exception
+ */
+ public SpyMessage[] browse(ConnectionToken dc, Destination dest, String selector)
+ throws Exception
+ {
+ return server.browse(dc, dest, selector);
}
- public SpyMessage receive( ConnectionToken dc, int subscriberId, long wait )
- throws Exception {
- return server.receive( dc, subscriberId, wait );
+ /**
+ * #Description of the Method
+ *
+ * @param dc Description of Parameter
+ * @param subscriberId Description of Parameter
+ * @param wait Description of Parameter
+ * @return Description of the Returned Value
+ * @exception Exception Description of Exception
+ */
+ public SpyMessage receive(ConnectionToken dc, int subscriberId, long wait)
+ throws Exception
+ {
+ return server.receive(dc, subscriberId, wait);
}
- public void unsubscribe( ConnectionToken dc, int subscriptionId )
- throws Exception {
- server.unsubscribe( dc, subscriptionId );
+ /**
+ * #Description of the Method
+ *
+ * @param dc Description of Parameter
+ * @param subscriptionId Description of Parameter
+ * @exception Exception Description of Exception
+ */
+ public void unsubscribe(ConnectionToken dc, int subscriptionId)
+ throws Exception
+ {
+ server.unsubscribe(dc, subscriptionId);
}
- public void destroySubscription( DurableSubcriptionID id )
- throws Exception {
- server.destroySubscription( id );
+ /**
+ * #Description of the Method
+ *
+ * @param id Description of Parameter
+ * @exception Exception Description of Exception
+ */
+ public void destroySubscription(DurableSubcriptionID id)
+ throws Exception
+ {
+ server.destroySubscription(id);
}
- public String checkUser( String userName, String password )
- throws JMSException {
- return server.checkUser( userName, password );
+ /**
+ * #Description of the Method
+ *
+ * @param userName Description of Parameter
+ * @param password Description of Parameter
+ * @return Description of the Returned Value
+ * @exception JMSException Description of Exception
+ */
+ public String checkUser(String userName, String password)
+ throws JMSException
+ {
+ return server.checkUser(userName, password);
}
+
+ /**
+ * #Description of the Method
+ *
+ * @param dc Description of Parameter
+ * @param s Description of Parameter
+ * @exception Exception Description of Exception
+ */
+ public void subscribe(ConnectionToken dc, org.jboss.mq.Subscription s)
+ throws Exception
+ {
+ server.subscribe(dc, s.myClone());
+ }
- public void subscribe( ConnectionToken dc, org.jboss.mq.Subscription s )
- throws Exception {
- server.subscribe( dc, s.myClone() );
+ /**
+ * #Description of the Method
+ *
+ * @param dc Description of Parameter
+ * @param t Description of Parameter
+ * @exception JMSException Description of Exception
+ */
+ public void transact(org.jboss.mq.ConnectionToken dc, TransactionRequest t)
+ throws JMSException
+ {
+ server.transact(dc, t);
}
- public void transact( org.jboss.mq.ConnectionToken dc, TransactionRequest t )
- throws JMSException {
- server.transact( dc, t );
+ /**
+ * ping method comment.
+ *
+ * @param dc Description of Parameter
+ * @param clientTime Description of Parameter
+ * @exception JMSException Description of Exception
+ */
+ public void ping(org.jboss.mq.ConnectionToken dc, long clientTime)
+ throws JMSException
+ {
+ server.ping(dc, clientTime);
}
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development