[jboss-cvs] JBossRemoting/src/main/org/jboss/remoting ...

Ovidiu Feodorov ovidiu.feodorov at jboss.com
Sat Jan 20 20:24:51 EST 2007


  User: ovidiu  
  Date: 07/01/20 20:24:51

  Modified:    src/main/org/jboss/remoting   Tag: remoting_2_x Client.java
                        ConnectionValidator.java
  Log:
  http://jira.jboss.org/jira/browse/JBREM-679
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.53.2.17 +16 -1     JBossRemoting/src/main/org/jboss/remoting/Client.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Client.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/Client.java,v
  retrieving revision 1.53.2.16
  retrieving revision 1.53.2.17
  diff -u -b -r1.53.2.16 -r1.53.2.17
  --- Client.java	21 Jan 2007 01:13:03 -0000	1.53.2.16
  +++ Client.java	21 Jan 2007 01:24:51 -0000	1.53.2.17
  @@ -64,7 +64,7 @@
    * @author <a href="mailto:telrod at e2technologies.net">Tom Elrod</a>
    * @author <a href="mailto:ovidiu at jboss.org">Ovidiu Feodorov</a>
    *
  - * @version $Revision: 1.53.2.16 $
  + * @version $Revision: 1.53.2.17 $
    */
   public class Client implements Externalizable
   {
  @@ -1402,6 +1402,21 @@
                                              new Object[]{locator, invocationRequest}), null);
      }
   
  +   /**
  +    * @return the ping period (in ms) this client's connection validator is configured with. If the
  +    *         client doesn't ping (on account of connection validator not being installed, or
  +    *         stopped), returns -1.
  +    */
  +   public long getPingPeriod()
  +   {
  +      if (connectionValidator == null)
  +      {
  +         return -1;
  +      }
  +
  +      return connectionValidator.getPingPeriod();
  +   }
  +
      // Package protected ----------------------------------------------------------------------------
   
      // Protected ------------------------------------------------------------------------------------
  
  
  
  1.13.2.7  +17 -6     JBossRemoting/src/main/org/jboss/remoting/ConnectionValidator.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ConnectionValidator.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/ConnectionValidator.java,v
  retrieving revision 1.13.2.6
  retrieving revision 1.13.2.7
  diff -u -b -r1.13.2.6 -r1.13.2.7
  --- ConnectionValidator.java	19 Jan 2007 08:41:12 -0000	1.13.2.6
  +++ ConnectionValidator.java	21 Jan 2007 01:24:51 -0000	1.13.2.7
  @@ -40,6 +40,11 @@
    */
   public class ConnectionValidator extends TimerTask implements StoppableTimerTask
   {
  +   /**
  +    * Default ping period. Value is 2 seconds.
  +    */
  +   public static final long DEFAULT_PING_PERIOD = 2000;
  +   
      private List listeners = new ArrayList();
      private Client client = null;
      private InvokerLocator locator;
  @@ -52,12 +57,8 @@
   
      private ClientInvoker clientInvoker;
      private Object lock = new Object();
  -   private boolean stopped = false;
  +   private volatile boolean stopped = false;
   
  -   /**
  -    * Default ping period. Value is 2 seconds.
  -    */
  -   public static final long DEFAULT_PING_PERIOD = 2000;
   
      public ConnectionValidator(Client client)
      {
  @@ -207,6 +208,16 @@
         }
      }
      
  +   public long getPingPeriod()
  +   {
  +      if (stopped)
  +      {
  +         return -1;
  +      }
  +
  +      return pingPeriod;
  +   }
  +   
      
      private void notifyListeners(Throwable thr)
      {
  
  
  



More information about the jboss-cvs-commits mailing list