hammant     02/01/19 05:30:19

  Modified:    altrmi   PROPOSAL
               altrmi/src/java/org/apache/commons/altrmi/client
                        AltrmiHostContext.java AltrmiInterfaceLookup.java
               altrmi/src/java/org/apache/commons/altrmi/client/impl
                        AbstractAltrmiFactory.java
                        AbstractAltrmiHostContext.java
                        ClientClassAltrmiFactory.java
                        ServerClassAltrmiFactory.java
                        StreamInvocationHandler.java
               altrmi/src/java/org/apache/commons/altrmi/client/impl/direct
                        DirectInvocationHandler.java
               altrmi/src/java/org/apache/commons/altrmi/client/impl/piped
                        AbstractPipedStreamInvocationHandler.java
               altrmi/src/java/org/apache/commons/altrmi/client/impl/rmi
                        RmiInvocationHandler.java
               altrmi/src/java/org/apache/commons/altrmi/client/impl/socket
                        AbstractSocketStreamInvocationHandler.java
               altrmi/src/java/org/apache/commons/altrmi/common
                        AltrmiReply.java AltrmiRequest.java
               altrmi/src/java/org/apache/commons/altrmi/server/impl
                        AbstractServer.java
               altrmi/src/java/org/apache/commons/altrmi/test
                        DirectTest.java PipeTest.java RmiClientTest.java
                        SocketClientTest.java
  Added:       altrmi/src/java/org/apache/commons/altrmi/client
                        AltrmiClientInvocationHandler.java
                        AltrmiConnectionPinger.java
               altrmi/src/java/org/apache/commons/altrmi/client/impl
                        AbstractAltrmiClientInvocationHandler.java
                        DefaultAltrmiConnectionPinger.java
               altrmi/src/java/org/apache/commons/altrmi/common
                        PingReply.java PingRequest.java
  Removed:     altrmi/src/java/org/apache/commons/altrmi/client/impl
                        AltrmiClientInvocationHandler.java
  Log:
  ping implemented
  
  Revision  Changes    Path
  1.8       +10 -4     jakarta-commons-sandbox/altrmi/PROPOSAL
  
  Index: PROPOSAL
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/PROPOSAL,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- PROPOSAL  18 Jan 2002 20:11:29 -0000      1.7
  +++ PROPOSAL  19 Jan 2002 13:30:18 -0000      1.8
  @@ -119,22 +119,28 @@
       terminated connections will by default try to be reconnected, the 
       listener can decide if, how many, and how often the retries occur.
   
  -10) Unpublishable and republishable API
  +10) Pluggable Transport indenpendant keep-alive concept.
  +
  +  - On the client side, there is an API for a pluggable pinger.  While the server
  +    may support timeouts for client connections, the client could choose to
  +    overcome that default policy with a ping concept.
  +  
  +11) Unpublishable and republishable API
     
     - The server is able to unpublish a service.  In conjuction with 
       suspend()/resume() a service can be republished, upgraded etc
       whilst in use, or just offlined.
   
  -11) Startable API for Server
  +12) Startable API for Server
   
     - The server implements and acts upon start() and stop() methods.
   
  -12) Not just pass by value.
  +13) Not just pass by value.
   
     - AltRMI started life as 'pass by value' only.  In now supports return 
       types and parameters wrapped in another AltRMI Facade.
       
  -13) No duplicate instances.
  +14) No duplicate instances.
   
     - For Facades, if you call Person p = getPerson("Fred") twice you will get 
       the same instance on the client side is it is the same instance on the 
  
  
  
  1.2       +1 -1      
jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/AltrmiHostContext.java
  
  Index: AltrmiHostContext.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/AltrmiHostContext.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AltrmiHostContext.java    9 Jan 2002 19:25:53 -0000       1.1
  +++ AltrmiHostContext.java    19 Jan 2002 13:30:18 -0000      1.2
  @@ -17,7 +17,7 @@
    *
    *
    * @author Paul Hammant <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
  - * @version * $Revision: 1.1 $
  + * @version * $Revision: 1.2 $
    */
   public interface AltrmiHostContext {
   
  @@ -28,5 +28,5 @@
        * @return
        *
        */
  -    AltrmiInvocationHandler getInvocationHandler();
  +    AltrmiClientInvocationHandler getInvocationHandler();
   }
  
  
  
  1.6       +8 -1      
jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/AltrmiInterfaceLookup.java
  
  Index: AltrmiInterfaceLookup.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/AltrmiInterfaceLookup.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- AltrmiInterfaceLookup.java        15 Jan 2002 01:15:23 -0000      1.5
  +++ AltrmiInterfaceLookup.java        19 Jan 2002 13:30:18 -0000      1.6
  @@ -20,7 +20,7 @@
    *
    *
    * @author Paul Hammant <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
  - * @version $Revision: 1.5 $
  + * @version $Revision: 1.6 $
    */
   public interface AltrmiInterfaceLookup {
   
  @@ -60,4 +60,11 @@
        *
        */
       String getTextToSignForAuthentication();
  +
  +    /**
  +     * Method close
  +     *
  +     *
  +     */
  +    void close();
   }
  
  
  
  1.1                  
jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/AltrmiClientInvocationHandler.java
  
  Index: AltrmiClientInvocationHandler.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.commons.altrmi.client;
  
  import org.apache.commons.altrmi.common.AltrmiInvocationHandler;
  
  import java.io.IOException;
  
  public interface AltrmiClientInvocationHandler extends AltrmiInvocationHandler {
      /**
       * Method setAltrmiConnectionListener
       *
       *
       * @param altrmiConnectionListener
       *
       */
      void setAltrmiConnectionListener(AltrmiConnectionListener 
altrmiConnectionListener);
  
      /**
       * Method setConnectionPinger
       *
       *
       * @param connectionPinger
       *
       */
      void setConnectionPinger(AltrmiConnectionPinger connectionPinger);
  
      void initialize() throws IOException;
  
      void close();
  
  }
  
  
  
  
  
  1.1                  
jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/AltrmiConnectionPinger.java
  
  Index: AltrmiConnectionPinger.java
  ===================================================================
  
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.commons.altrmi.client;
  
  
  
  import org.apache.commons.altrmi.common.AltrmiInvocationHandler;
  
  
  /**
   * Interface AltrmiConnectionPinger
   *
   *
   * @author Paul Hammant <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
   * @version * $Revision: 1.1 $
   */
  public interface AltrmiConnectionPinger {
  
      /**
       * Method setAltrmiInvocationHandler
       *
       *
       *
       */
      void setAltrmiInvocationHandler(AltrmiInvocationHandler altrmiInvocationHandler);
  
      /**
       * Method start
       *
       *
       */
      void start();
  
      /**
       * Method stop
       *
       *
       */
      void stop();
  }
  
  
  
  1.7       +4 -4      
jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/AbstractAltrmiFactory.java
  
  Index: AbstractAltrmiFactory.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/AbstractAltrmiFactory.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- AbstractAltrmiFactory.java        17 Jan 2002 12:14:28 -0000      1.6
  +++ AbstractAltrmiFactory.java        19 Jan 2002 13:30:19 -0000      1.7
  @@ -29,11 +29,11 @@
    *
    *
    * @author Paul Hammant <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
  - * @version $Revision: 1.6 $
  + * @version $Revision: 1.7 $
    */
   public abstract class AbstractAltrmiFactory implements AltrmiFactory {
   
  -    protected AltrmiHostContext mHostContext;
  +    protected AbstractAltrmiHostContext mHostContext;
       protected final HashMap mObjRefs = new HashMap();
       protected final HashMap mRefObjs = new HashMap();
       private final boolean mBeanOnly;
  @@ -73,10 +73,10 @@
       public final void setHostContext(AltrmiHostContext hostContext) throws 
IOException {
   
           if (mHostContext == null) {
  -            mHostContext = hostContext;
  +            mHostContext = (AbstractAltrmiHostContext) hostContext;
           }
   
  -        ((AltrmiClientInvocationHandler) 
mHostContext.getInvocationHandler()).initialize();
  +        ((AbstractAltrmiClientInvocationHandler) 
mHostContext.getInvocationHandler()).initialize();
   
           AltrmiReply ar =
               mHostContext.getInvocationHandler().handleInvocation(new 
OpenConnectionRequest());
  
  
  
  1.3       +3 -2      
jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/AbstractAltrmiHostContext.java
  
  Index: AbstractAltrmiHostContext.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/AbstractAltrmiHostContext.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AbstractAltrmiHostContext.java    17 Jan 2002 12:14:28 -0000      1.2
  +++ AbstractAltrmiHostContext.java    19 Jan 2002 13:30:19 -0000      1.3
  @@ -13,6 +13,7 @@
   import org.apache.commons.altrmi.common.AltrmiInvocationHandler;
   import org.apache.commons.altrmi.client.AltrmiHostContext;
   import org.apache.commons.altrmi.client.AltrmiConnectionListener;
  +import org.apache.commons.altrmi.client.AltrmiClientInvocationHandler;
   
   
   /**
  @@ -20,7 +21,7 @@
    *
    *
    * @author Paul Hammant <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
    */
   public class AbstractAltrmiHostContext implements AltrmiHostContext {
   
  @@ -46,7 +47,7 @@
        * @return
        *
        */
  -    public AltrmiInvocationHandler getInvocationHandler() {
  +    public AltrmiClientInvocationHandler getInvocationHandler() {
           return mAltrmiClientInvocationHandler;
       }
   
  
  
  
  1.6       +10 -1     
jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/ClientClassAltrmiFactory.java
  
  Index: ClientClassAltrmiFactory.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/ClientClassAltrmiFactory.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ClientClassAltrmiFactory.java     17 Jan 2002 12:14:28 -0000      1.5
  +++ ClientClassAltrmiFactory.java     19 Jan 2002 13:30:19 -0000      1.6
  @@ -29,7 +29,7 @@
    *
    *
    * @author Paul Hammant <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
  - * @version $Revision: 1.5 $
  + * @version $Revision: 1.6 $
    */
   public class ClientClassAltrmiFactory extends AbstractAltrmiFactory {
   
  @@ -130,5 +130,14 @@
               throw new AltrmiConnectionException(
                   "Illegal access to generated class during lookup : " + 
iae.getMessage());
           }
  +    }
  +
  +    /**
  +     * Method close
  +     *
  +     *
  +     */
  +    public void close() {
  +        mHostContext.getInvocationHandler().close();
       }
   }
  
  
  
  1.6       +9 -1      
jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/ServerClassAltrmiFactory.java
  
  Index: ServerClassAltrmiFactory.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/ServerClassAltrmiFactory.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ServerClassAltrmiFactory.java     17 Jan 2002 12:14:28 -0000      1.5
  +++ ServerClassAltrmiFactory.java     19 Jan 2002 13:30:19 -0000      1.6
  @@ -35,7 +35,7 @@
    *
    *
    * @author Paul Hammant <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
  - * @version $Revision: 1.5 $
  + * @version $Revision: 1.6 $
    */
   public class ServerClassAltrmiFactory extends AbstractAltrmiFactory {
   
  @@ -182,5 +182,13 @@
               throw new AltrmiConnectionException(
                   "Illegal access to generated class during lookup : " + 
iae.getMessage());
           }
  +    }
  +    /**
  +     * Method close
  +     *
  +     *
  +     */
  +    public void close() {
  +        mHostContext.getInvocationHandler().close();
       }
   }
  
  
  
  1.4       +2 -2      
jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/StreamInvocationHandler.java
  
  Index: StreamInvocationHandler.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/StreamInvocationHandler.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- StreamInvocationHandler.java      17 Jan 2002 17:48:45 -0000      1.3
  +++ StreamInvocationHandler.java      19 Jan 2002 13:30:19 -0000      1.4
  @@ -36,9 +36,9 @@
    *
    *
    * @author Paul Hammant <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
  - * @version $Revision: 1.3 $
  + * @version $Revision: 1.4 $
    */
  -public abstract class StreamInvocationHandler extends AltrmiClientInvocationHandler 
{
  +public abstract class StreamInvocationHandler extends 
AbstractAltrmiClientInvocationHandler {
   
       private ClientStreamReadWriter mObjectReadWriter;
       private boolean mMethodLogging = false;
  
  
  
  1.1                  
jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/AbstractAltrmiClientInvocationHandler.java
  
  Index: AbstractAltrmiClientInvocationHandler.java
  ===================================================================
  
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.commons.altrmi.client.impl;
  
  
  
  import org.apache.commons.altrmi.common.AltrmiInvocationHandler;
  import org.apache.commons.altrmi.client.AltrmiConnectionListener;
  import org.apache.commons.altrmi.client.AltrmiConnectionPinger;
  import org.apache.commons.altrmi.client.AltrmiClientInvocationHandler;
  
  import java.io.IOException;
  
  
  /**
   * Class AbstractAltrmiClientInvocationHandler
   *
   *
   * @author Paul Hammant <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
   * @version $Revision: 1.1 $
   */
  public abstract class AbstractAltrmiClientInvocationHandler implements 
AltrmiInvocationHandler, AltrmiClientInvocationHandler {
  
      protected AltrmiConnectionPinger mConnectionPinger;
      protected AltrmiConnectionListener mAltrmiConnectionListener =
          new DefaultAltrmiConnectionListener();
  
      /**
       * Method setAltrmiConnectionListener
       *
       *
       * @param altrmiConnectionListener
       *
       */
      public void setAltrmiConnectionListener(AltrmiConnectionListener 
altrmiConnectionListener) {
          mAltrmiConnectionListener = altrmiConnectionListener;
      }
  
      public void initialize() throws IOException {
          System.out.println(" initializing ");
  
          if (mConnectionPinger == null) {
              mConnectionPinger = new DefaultAltrmiConnectionPinger();
          }
          mConnectionPinger.setAltrmiInvocationHandler(this);
          mConnectionPinger.start();
      }
  
      public void close() {
          mConnectionPinger.stop();
      }
  
      protected abstract boolean tryReconnect();
  
      /**
       * Method setConnectionPinger
       *
       *
       * @param connectionPinger
       *
       */
      public void setConnectionPinger(AltrmiConnectionPinger connectionPinger) {
          mConnectionPinger = connectionPinger;
      }
  }
  
  
  
  1.1                  
jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/DefaultAltrmiConnectionPinger.java
  
  Index: DefaultAltrmiConnectionPinger.java
  ===================================================================
  
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.commons.altrmi.client.impl;
  
  
  
  import org.apache.commons.altrmi.client.AltrmiConnectionPinger;
  import org.apache.commons.altrmi.common.AltrmiInvocationHandler;
  import org.apache.commons.altrmi.common.AltrmiReply;
  import org.apache.commons.altrmi.common.PingRequest;
  
  
  /**
   * Interface DefaultAltrmiConnectionPinger
   *
   *
   * @author Paul Hammant <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
   * @version * $Revision: 1.1 $
   */
  public class DefaultAltrmiConnectionPinger implements AltrmiConnectionPinger, 
Runnable {
  
      private AltrmiInvocationHandler mAltrmiInvocationHandler;
      private boolean mContinue = true;
      private Thread mThread;
  
  
      /**
       * Method setAltrmiInvocationHandler
       *
       *
       *
       */
      public void setAltrmiInvocationHandler(AltrmiInvocationHandler 
altrmiInvocationHandler) {
          mAltrmiInvocationHandler = altrmiInvocationHandler;
      }
  
      /**
       * Method start
       *
       *
       */
      public void start() {
          mThread = new Thread(this);
          mThread.start();
      }
  
      public void stop() {
          mContinue = false;
      }
  
      /**
       * Method run
       *
       *
       */
      public void run() {
          try {
              while (mContinue) {
                  Thread.sleep(10 * 1000);
                  AltrmiReply ar = mAltrmiInvocationHandler.handleInvocation(new 
PingRequest());
              }
          } catch (InterruptedException e) {
  
              // do nothing.
          }
      }
  }
  
  
  
  1.3       +3 -4      
jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/direct/DirectInvocationHandler.java
  
  Index: DirectInvocationHandler.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/direct/DirectInvocationHandler.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DirectInvocationHandler.java      17 Jan 2002 12:14:29 -0000      1.2
  +++ DirectInvocationHandler.java      19 Jan 2002 13:30:19 -0000      1.3
  @@ -22,7 +22,7 @@
   import org.apache.commons.altrmi.common.MethodRequest;
   import org.apache.commons.altrmi.common.NoSuchReferenceReply;
   import org.apache.commons.altrmi.common.NotSuchReferenceException;
  -import org.apache.commons.altrmi.client.impl.AltrmiClientInvocationHandler;
  +import org.apache.commons.altrmi.client.impl.AbstractAltrmiClientInvocationHandler;
   import org.apache.commons.altrmi.client.AltrmiConnectionListener;
   
   import java.io.IOException;
  @@ -33,9 +33,9 @@
    *
    *
    * @author Paul Hammant <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
    */
  -public final class DirectInvocationHandler extends AltrmiClientInvocationHandler {
  +public final class DirectInvocationHandler extends 
AbstractAltrmiClientInvocationHandler {
   
       private AltrmiInvocationHandler mAltrmiInvocationHandler;
       private boolean mMethodLogging = false;
  @@ -68,7 +68,6 @@
           mMethodLogging = altrmiConnectionListener.methodLogging();
       }
   
  -    protected void initialize() throws IOException {}
   
       /**
        * Method handleInvocation
  
  
  
  1.3       +3 -2      
jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/piped/AbstractPipedStreamInvocationHandler.java
  
  Index: AbstractPipedStreamInvocationHandler.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/piped/AbstractPipedStreamInvocationHandler.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AbstractPipedStreamInvocationHandler.java 17 Jan 2002 12:14:29 -0000      1.2
  +++ AbstractPipedStreamInvocationHandler.java 19 Jan 2002 13:30:19 -0000      1.3
  @@ -31,7 +31,7 @@
    *
    *
    * @author Paul Hammant <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
    */
   public abstract class AbstractPipedStreamInvocationHandler extends 
StreamInvocationHandler {
   
  @@ -55,8 +55,9 @@
           mOS = os;
       }
   
  -    protected void initialize() throws IOException {
  +    public void initialize() throws IOException {
           setObjectReadWriter(createClientStreamReadWriter(mIS, mOS));
  +        super.initialize();
       }
   
       protected boolean tryReconnect() {
  
  
  
  1.3       +3 -4      
jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/rmi/RmiInvocationHandler.java
  
  Index: RmiInvocationHandler.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/rmi/RmiInvocationHandler.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- RmiInvocationHandler.java 17 Jan 2002 12:14:29 -0000      1.2
  +++ RmiInvocationHandler.java 19 Jan 2002 13:30:19 -0000      1.3
  @@ -10,7 +10,7 @@
   
   
   
  -import org.apache.commons.altrmi.client.impl.AltrmiClientInvocationHandler;
  +import org.apache.commons.altrmi.client.impl.AbstractAltrmiClientInvocationHandler;
   import org.apache.commons.altrmi.client.AltrmiConnectionListener;
   import org.apache.commons.altrmi.common.RmiAltrmiInvocationHandler;
   import org.apache.commons.altrmi.common.AltrmiConnectionException;
  @@ -41,9 +41,9 @@
    *
    *
    * @author Paul Hammant <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
    */
  -public final class RmiInvocationHandler extends AltrmiClientInvocationHandler {
  +public final class RmiInvocationHandler extends 
AbstractAltrmiClientInvocationHandler {
   
       private RmiAltrmiInvocationHandler mRmiAltrmiInvocationHandler;
       private String mURL;
  @@ -76,7 +76,6 @@
           }
       }
   
  -    protected void initialize() throws IOException {}
   
       /**
        * Method setAltrmiConnectionListener
  
  
  
  1.5       +1 -3      
jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/socket/AbstractSocketStreamInvocationHandler.java
  
  Index: AbstractSocketStreamInvocationHandler.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/socket/AbstractSocketStreamInvocationHandler.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AbstractSocketStreamInvocationHandler.java        18 Jan 2002 12:22:31 -0000     
 1.4
  +++ AbstractSocketStreamInvocationHandler.java        19 Jan 2002 13:30:19 -0000     
 1.5
  @@ -30,7 +30,7 @@
    *
    *
    * @author Paul Hammant <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
  - * @version $Revision: 1.4 $
  + * @version $Revision: 1.5 $
    */
   public abstract class AbstractSocketStreamInvocationHandler extends 
StreamInvocationHandler {
   
  @@ -62,8 +62,6 @@
               throw new AltrmiConnectionException("Cannot open Stream(s) for socket");
           }
       }
  -
  -    protected void initialize() throws IOException {}
   
       /**
        * Method tryReconnect
  
  
  
  1.4       +2 -1      
jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/common/AltrmiReply.java
  
  Index: AltrmiReply.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/common/AltrmiReply.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AltrmiReply.java  18 Jan 2002 11:03:20 -0000      1.3
  +++ AltrmiReply.java  19 Jan 2002 13:30:19 -0000      1.4
  @@ -21,7 +21,7 @@
    *
    *
    * @author Paul Hammant <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
  - * @version $Revision: 1.3 $
  + * @version $Revision: 1.4 $
    */
   public abstract class AltrmiReply implements Externalizable {
   
  @@ -32,6 +32,7 @@
       public static final int LOOKUPREPLY = 4;
       public static final int METHODFACADEREPLY = 5;
       public static final int OPENCONNECTIONREPLY = 6;
  +    public static final int PINGREPLY = 7;
   
       // 'bad' replies after 100
       public static final int PROBLEMREPLY = 100;
  
  
  
  1.4       +2 -1      
jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/common/AltrmiRequest.java
  
  Index: AltrmiRequest.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/common/AltrmiRequest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AltrmiRequest.java        18 Jan 2002 11:03:20 -0000      1.3
  +++ AltrmiRequest.java        19 Jan 2002 13:30:19 -0000      1.4
  @@ -21,7 +21,7 @@
    *
    *
    * @author Paul Hammant <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
  - * @version $Revision: 1.3 $
  + * @version $Revision: 1.4 $
    */
   public abstract class AltrmiRequest implements Externalizable {
   
  @@ -30,6 +30,7 @@
       public static final int METHODFACADEREQUEST = 303;
       public static final int LOOKUPREQUEST = 304;
       public static final int OPENCONNECTIONREQUEST = 305;
  +    public static final int PINGREQUEST = 306;
   
       /**
        * Method getRequestCode.  This is quicker than instanceof for type checking.
  
  
  
  1.1                  
jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/common/PingReply.java
  
  Index: PingReply.java
  ===================================================================
  
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.commons.altrmi.common;
  
  
  
  /**
   * Class PingReply
   *
   *
   * @author Paul Hammant <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
   * @version $Revision: 1.1 $
   */
  public final class PingReply extends NotPublishedReply {
  
      /**
       * Method getReplyCode.  This is quicker than instanceof for type checking.
       *
       *
       * @return
       *
       */
      public int getReplyCode() {
          return PINGREPLY;
      }
  }
  
  
  
  1.1                  
jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/common/PingRequest.java
  
  Index: PingRequest.java
  ===================================================================
  
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.commons.altrmi.common;
  
  
  
  /**
   * Class PingRequest
   *
   *
   * @author Paul Hammant <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
   * @version $Revision: 1.1 $
   */
  public final class PingRequest extends AltrmiRequest {
  
      /**
       * Method getRequestCode.  This is quicker than instanceof for type checking.
       *
       *
       * @return
       *
       */
      public int getRequestCode() {
          return PINGREQUEST;
      }
  }
  
  
  
  1.8       +7 -1      
jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/AbstractServer.java
  
  Index: AbstractServer.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/AbstractServer.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- AbstractServer.java       17 Jan 2002 17:48:46 -0000      1.7
  +++ AbstractServer.java       19 Jan 2002 13:30:19 -0000      1.8
  @@ -34,6 +34,7 @@
   import org.apache.commons.altrmi.common.AltrmiAuthenticationException;
   import org.apache.commons.altrmi.common.AltrmiInvocationException;
   import org.apache.commons.altrmi.common.OpenConnectionReply;
  +import org.apache.commons.altrmi.common.PingReply;
   import org.apache.commons.altrmi.server.AltrmiClassRetrievalException;
   import org.apache.commons.altrmi.server.ClassRetriever;
   import org.apache.commons.altrmi.server.AltrmiServerInvocationHandler;
  @@ -53,7 +54,7 @@
    *
    *
    * @author Paul Hammant <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
  - * @version $Revision: 1.7 $
  + * @version $Revision: 1.8 $
    */
   public abstract class AbstractServer extends AbstractMethodHandler implements 
AltrmiServer {
   
  @@ -277,6 +278,8 @@
               return new SuspendedReply();
           }
   
  +        // Method request is positionid first as
  +        // it is the one we want to be most speedy.
           if (request.getRequestCode() == AltrmiRequest.METHODREQUEST) {
               MethodRequest mr = (MethodRequest) request;
               String publishedThing = mr.getPublishedServiceName() + "_" + 
mr.getObjectName();
  @@ -361,6 +364,9 @@
               }
           } else if (request.getRequestCode() == AltrmiRequest.OPENCONNECTIONREQUEST) 
{
               return new OpenConnectionReply(mAltrmiAuthenticator.getTextToSign());
  +        } else if (request.getRequestCode() == AltrmiRequest.PINGREQUEST) {
  +            // we could communicate back useful state info in this transaction.
  +            return new PingReply();
           } else {
               return new RequestFailedReply("Unknown request :" + 
request.getClass().getName());
           }
  
  
  
  1.5       +3 -2      
jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/test/DirectTest.java
  
  Index: DirectTest.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/test/DirectTest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DirectTest.java   17 Jan 2002 12:14:30 -0000      1.4
  +++ DirectTest.java   19 Jan 2002 13:30:19 -0000      1.5
  @@ -28,7 +28,7 @@
    *
    *
    * @author Paul Hammant <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
  - * @version $Revision: 1.4 $
  + * @version $Revision: 1.5 $
    */
   public class DirectTest {
   
  @@ -69,7 +69,7 @@
        *
        *
        * @author Paul Hammant <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
  -     * @version $Revision: 1.4 $
  +     * @version $Revision: 1.5 $
        */
       static class DirectTestClient implements Runnable {
   
  @@ -107,6 +107,7 @@
   
                   TestInterface ti = (TestInterface) af.lookup("Hello");
                   TestClient tc = new TestClient(ti);
  +                af.close();
               } catch (IOException ioe) {
                   System.err.println("Some problem during connection to server : "
                                      + ioe.getMessage());
  
  
  
  1.6       +3 -2      
jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/test/PipeTest.java
  
  Index: PipeTest.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/test/PipeTest.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- PipeTest.java     17 Jan 2002 12:14:30 -0000      1.5
  +++ PipeTest.java     19 Jan 2002 13:30:19 -0000      1.6
  @@ -30,7 +30,7 @@
    *
    *
    * @author Paul Hammant <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
  - * @version $Revision: 1.5 $
  + * @version $Revision: 1.6 $
    */
   public class PipeTest {
   
  @@ -71,7 +71,7 @@
        *
        *
        * @author Paul Hammant <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
  -     * @version $Revision: 1.5 $
  +     * @version $Revision: 1.6 $
        */
       static class PipedTestClient implements Runnable {
   
  @@ -111,6 +111,7 @@
   
                   TestInterface ti = (TestInterface) af.lookup("Hello");
                   TestClient tc = new TestClient(ti);
  +                af.close();
               } catch (IOException ioe) {
                   System.err.println("Some problem during connection to server : "
                                      + ioe.getMessage());
  
  
  
  1.3       +3 -1      
jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/test/RmiClientTest.java
  
  Index: RmiClientTest.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/test/RmiClientTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- RmiClientTest.java        14 Jan 2002 12:11:07 -0000      1.2
  +++ RmiClientTest.java        19 Jan 2002 13:30:19 -0000      1.3
  @@ -21,7 +21,7 @@
    *
    *
    * @author Paul Hammant <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
    */
   public class RmiClientTest {
   
  @@ -52,5 +52,7 @@
           TestInterface ti = (TestInterface) af.lookup("Hello");
   
           new TestClient(ti);
  +
  +        af.close();
       }
   }
  
  
  
  1.7       +4 -1      
jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/test/SocketClientTest.java
  
  Index: SocketClientTest.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/test/SocketClientTest.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- SocketClientTest.java     18 Jan 2002 17:33:07 -0000      1.6
  +++ SocketClientTest.java     19 Jan 2002 13:30:19 -0000      1.7
  @@ -26,7 +26,7 @@
    *
    *
    * @author Paul Hammant <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
  - * @version $Revision: 1.6 $
  + * @version $Revision: 1.7 $
    */
   public class SocketClientTest {
   
  @@ -69,5 +69,8 @@
           TestInterface ti = (TestInterface) af.lookup("Hello");
   
           new TestClient(ti);
  +
  +        af.close();
  +
       }
   }
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to