User: chirino 
  Date: 01/09/25 22:02:28

  Modified:    src/main/org/jboss/mq/il/rmi RMIClientIL.java
                        RMIClientILRemote.java RMIServerIL.java
                        RMIServerILRemote.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       +65 -24    jbossmq/src/main/org/jboss/mq/il/rmi/RMIClientIL.java
  
  Index: RMIClientIL.java
  ===================================================================
  RCS file: /cvsroot/jboss/jbossmq/src/main/org/jboss/mq/il/rmi/RMIClientIL.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- RMIClientIL.java  2001/08/17 03:04:04     1.2
  +++ RMIClientIL.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,47 +15,88 @@
   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 RMIClientIL extends java.rmi.server.UnicastRemoteObject implements 
RMIClientILRemote {
  +public class RMIClientIL extends java.rmi.server.UnicastRemoteObject implements 
RMIClientILRemote
  +{
   
      // A reference to the connection
  -   Connection       connection;
  +   Connection connection;
      // Are we running
  -   boolean          stopped = true;
  +   boolean stopped = true;
   
  -   RMIClientIL( Connection c )
  -      throws java.rmi.RemoteException {
  +   RMIClientIL(Connection c)
  +          throws java.rmi.RemoteException
  +   {
         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 JMSException  Description of Exception
  +    */
  +   public void pong(long serverTime)
  +          throws JMSException
  +   {
  +      if (stopped)
  +      {
  +         throw new IllegalStateException("The client IL is stopped");
  +      }
  +      connection.asynchPong(serverTime);
      }
   }
  
  
  
  1.3       +40 -13    jbossmq/src/main/org/jboss/mq/il/rmi/RMIClientILRemote.java
  
  Index: RMIClientILRemote.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jbossmq/src/main/org/jboss/mq/il/rmi/RMIClientILRemote.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- RMIClientILRemote.java    2001/08/17 03:04:04     1.2
  +++ RMIClientILRemote.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,22 +15,49 @@
   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 interface RMIClientILRemote extends ClientIL, java.rmi.Remote {
  +public interface RMIClientILRemote extends ClientIL, java.rmi.Remote
  +{
   
  +   /**
  +    * #Description of the Method
  +    *
  +    * @exception Exception  Description of Exception
  +    */
      public void close()
  -      throws Exception;
  +          throws Exception;
   
      //One TemporaryDestination has been deleted
  -   public void deleteTemporaryDestination( SpyDestination dest )
  -      throws Exception;
  -
  -   public void receive( ReceiveRequest messages[] )
  -      throws Exception;
  +   /**
  +    * #Description of the Method
  +    *
  +    * @param dest           Description of Parameter
  +    * @exception Exception  Description of Exception
  +    */
  +   public void deleteTemporaryDestination(SpyDestination dest)
  +          throws Exception;
  +
  +   /**
  +    * #Description of the Method
  +    *
  +    * @param messages       Description of Parameter
  +    * @exception Exception  Description of Exception
  +    */
  +   public void receive(ReceiveRequest messages[])
  +          throws Exception;
  +
  +   /**
  +    * #Description of the Method
  +    *
  +    * @param serverTime     Description of Parameter
  +    * @exception Exception  Description of Exception
  +    */
  +   public void pong(long serverTime)
  +          throws Exception;
   }
  
  
  
  1.3       +242 -66   jbossmq/src/main/org/jboss/mq/il/rmi/RMIServerIL.java
  
  Index: RMIServerIL.java
  ===================================================================
  RCS file: /cvsroot/jboss/jbossmq/src/main/org/jboss/mq/il/rmi/RMIServerIL.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- RMIServerIL.java  2001/08/17 03:04:04     1.2
  +++ RMIServerIL.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,125 +23,301 @@
   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 RMIServerIL extends java.rmi.server.UnicastRemoteObject implements 
RMIServerILRemote {
  +public class RMIServerIL extends java.rmi.server.UnicastRemoteObject implements 
RMIServerILRemote
  +{
   
      //The server implementation
      private transient JMSServer server;
   
  -   public RMIServerIL( JMSServer s )
  -      throws java.rmi.RemoteException {
  +   /**
  +    * Constructor for the RMIServerIL object
  +    *
  +    * @param s                             Description of Parameter
  +    * @exception java.rmi.RemoteException  Description of Exception
  +    */
  +   public RMIServerIL(JMSServer s)
  +          throws java.rmi.RemoteException
  +   {
         server = s;
      }
   
  -   public void setConnectionToken( ConnectionToken newConnectionToken ) {
  +   /**
  +    * Sets the ConnectionToken attribute of the RMIServerIL 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 RMIServerIL 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 RMIServerIL 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 RMIServerIL 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 RMIServerIL 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 );
  +   /**
  +    * Adds a feature to the Message attribute of the RMIServerIL 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);
      }
   
  -   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, java.rmi.RemoteException {
  -      server.acknowledge( dc, item );
  +   /**
  +    * #Description of the Method
  +    *
  +    * @param dc                            Description of Parameter
  +    * @param item                          Description of Parameter
  +    * @exception Exception                 Description of Exception
  +    * @exception java.rmi.RemoteException  Description of Exception
  +    */
  +   public void acknowledge(ConnectionToken dc, AcknowledgementRequest item)
  +          throws Exception, java.rmi.RemoteException
  +   {
  +      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);
  +   }
   
  -   public void subscribe( ConnectionToken dc, org.jboss.mq.Subscription s )
  -      throws Exception {
  -      server.subscribe( dc, s );
  +   /**
  +    * #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 );
  +   /**
  +    * #Description of the Method
  +    *
  +    * @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);
      }
   }
  
  
  
  1.3       +10 -8     jbossmq/src/main/org/jboss/mq/il/rmi/RMIServerILRemote.java
  
  Index: RMIServerILRemote.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jbossmq/src/main/org/jboss/mq/il/rmi/RMIServerILRemote.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- RMIServerILRemote.java    2001/08/17 03:04:04     1.2
  +++ RMIServerILRemote.java    2001/09/26 05:02:28     1.3
  @@ -1,10 +1,11 @@
   /*
  - * JBossMQ, the OpenSource JMS implementation
  + * JBoss, the OpenSource J2EE webOS
    *
    * Distributable under LGPL license.
    * See terms of license at gnu.org.
    */
   package org.jboss.mq.il.rmi;
  +
   import javax.jms.Destination;
   
   import javax.jms.JMSException;
  @@ -22,14 +23,15 @@
   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 interface RMIServerILRemote extends ServerIL, java.rmi.Remote {
  +public interface RMIServerILRemote extends ServerIL, java.rmi.Remote
  +{
   
   //   public ServerIL cloneServerIL()  throws Exception;
   //   public void setConnectionToken(ConnectionToken newConnectionToken) throws 
Exception;
  @@ -52,5 +54,5 @@
   //   public String checkUser(String userName, String password)  throws Exception;
   //   public void subscribe(ConnectionToken dc, org.jboss.mq.Subscription s)  throws 
Exception;
   //   public void transact(org.jboss.mq.ConnectionToken dc, TransactionRequest t)  
throws Exception;
  -
  +//  public void ping(org.jboss.mq.ConnectionToken dc, long clientTime) throws 
Exception;
   }
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to