hammant     02/01/28 06:04:55

  Modified:    altrmi/src/java/org/apache/commons/altrmi/server
                        AltrmiServer.java
               altrmi/src/java/org/apache/commons/altrmi/server/impl
                        AbstractServer.java StreamServerConnection.java
               altrmi/src/java/org/apache/commons/altrmi/server/impl/direct
                        DirectMarshalledServer.java DirectServer.java
               altrmi/src/java/org/apache/commons/altrmi/server/impl/rmi
                        RmiInovcationAdapter.java
               altrmi/src/java/org/apache/commons/altrmi/test
                        DirectMarshalledTest.java DirectTest.java
  Added:       altrmi/src/java/org/apache/commons/altrmi/server/impl/adapters
                        InovcationHandlerAdapter.java
                        MarshalledInovcationHandlerAdapter.java
  Removed:     altrmi/src/java/org/apache/commons/altrmi/server/impl/direct
                        DirectInovcationAdapter.java
                        DirectMarshalledInovcationAdapter.java
  Log:
  Start of refactor into layers
  
  Revision  Changes    Path
  1.5       +3 -13     
jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/AltrmiServer.java
  
  Index: AltrmiServer.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/AltrmiServer.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AltrmiServer.java 27 Jan 2002 15:47:40 -0000      1.4
  +++ AltrmiServer.java 28 Jan 2002 14:04:54 -0000      1.5
  @@ -12,6 +12,7 @@
   
   import org.apache.commons.altrmi.common.AltrmiReply;
   import org.apache.commons.altrmi.common.AltrmiRequest;
  +import org.apache.commons.altrmi.common.AltrmiInvocationHandler;
   
   
   /**
  @@ -19,9 +20,9 @@
    *
    *
    * @author Paul Hammant <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
  - * @version * $Revision: 1.4 $
  + * @version * $Revision: 1.5 $
    */
  -public interface AltrmiServer extends AltrmiPublisher {
  +public interface AltrmiServer extends AltrmiPublisher, AltrmiInvocationHandler {
   
       /**
        * Method setClassRetriever
  @@ -41,17 +42,6 @@
        *
        */
       void setAuthenticator(AltrmiAuthenticator altrmiAuthenticator);
  -
  -    /**
  -     * Method processRequest
  -     *
  -     *
  -     * @param request
  -     *
  -     * @return
  -     *
  -     */
  -    AltrmiReply processRequest(AltrmiRequest request);
   
       /**
        * Method suspend
  
  
  
  1.15      +15 -126   
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.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- AbstractServer.java       28 Jan 2002 10:27:06 -0000      1.14
  +++ AbstractServer.java       28 Jan 2002 14:04:54 -0000      1.15
  @@ -41,6 +41,7 @@
   import org.apache.commons.altrmi.server.ServerInvocationHandler;
   import org.apache.commons.altrmi.server.AltrmiAuthenticator;
   import org.apache.commons.altrmi.server.impl.classretrievers.NoClassRetriever;
  +import org.apache.commons.altrmi.server.impl.adapters.InovcationHandlerAdapter;
   import org.apache.commons.altrmi.generator.PrimarySourceGenerator;
   import org.apache.commons.altrmi.generator.SourceGenerationException;
   import org.apache.tools.ant.AntClassLoader;
  @@ -58,25 +59,27 @@
    *
    *
    * @author Paul Hammant <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
  - * @version $Revision: 1.14 $
  + * @version $Revision: 1.15 $
    */
   public abstract class AbstractServer extends AbstractMethodHandler implements 
AltrmiServer {
   
  -    private static int SESSION = 0;
  +
   
       private HashMap mPublishedObjects = new HashMap();
  -    private Vector mSessions = new Vector();
  -    private Long mLastSession = new Long(0);
  -    private boolean mSuspend = false;
  +
       private Vector mConnections = new Vector();
       private ClassRetriever mClassRetriever = new NoClassRetriever();
       private AltrmiAuthenticator mAltrmiAuthenticator = new DefaultAuthenticator();
  +    private InovcationHandlerAdapter mInovcationHandlerAdapter;
       protected static final int SHUTTINGDOWN = 11;
       protected static final int STARTED = 22;
       protected static final int STOPPED = 33;
       protected static final int UNSTARTED = 44;
       protected int mState = UNSTARTED;
   
  +    public AbstractServer() {
  +        mInovcationHandlerAdapter = new 
InovcationHandlerAdapter(mAltrmiAuthenticator, mPublishedObjects, mClassRetriever);
  +    }
   
       /**
        * Method publish
  @@ -255,7 +258,7 @@
        *
        */
       public final void setClassRetriever(ClassRetriever classRetriever) {
  -        mClassRetriever = classRetriever;
  +        mInovcationHandlerAdapter.setClassRetriever(classRetriever);
       }
   
       /**
  @@ -271,7 +274,7 @@
       }
   
       /**
  -     * Method processRequest
  +     * Method handleInvocation
        *
        *
        * @param request
  @@ -279,131 +282,20 @@
        * @return
        *
        */
  -    public AltrmiReply processRequest(AltrmiRequest request) {
  -
  -        if (mSuspend == true) {
  -            return new SuspendedReply();
  -        }
  +    public AltrmiReply handleInvocation(AltrmiRequest request) {
   
  -        // 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();
  +        return mInovcationHandlerAdapter.handleInvocation(request);
   
  -            if (!mPublishedObjects.containsKey(publishedThing)) {
  -                return new NotPublishedReply();
  -            }
  -
  -            AltrmiInvocationHandler ih =
  -                (AltrmiInvocationHandler) mPublishedObjects.get(publishedThing);
  -
  -            return ih.handleInvocation(mr);
  -        } else if (request.getRequestCode() == AltrmiRequest.METHODFACADEREQUEST) {
  -            MethodFacadeRequest mr = (MethodFacadeRequest) request;
  -            String publishedThing = mr.getPublishedServiceName() + "_" + 
mr.getObjectName();
  -
  -            if (!mPublishedObjects.containsKey(publishedThing)) {
  -                return new NotPublishedReply();
  -            }
  -
  -            if (!sessionExists(mr.getSession())) {
  -                return new ExceptionReply(
  -                    new AltrmiInvocationException("TODO - you dirty rat/hacker"));
  -            }
  -
  -            ServerInvocationHandler asih =
  -                (ServerInvocationHandler) mPublishedObjects.get(publishedThing);
  -            AltrmiReply ar = asih.handleInvocation(mr);
  -
  -            if (ar.getReplyCode() == AltrmiReply.EXCEPTIONREPLY) {
  -                return ar;
  -            } else if (ar.getReplyCode() >= AltrmiReply.PROBLEMREPLY) {
  -                return ar;
  -            } else if (ar.getReplyCode() != AltrmiReply.METHODREPLY) {
  -                return new RequestFailedReply("TODO");
  -            }
  -
  -            Object beanImpl = ((MethodReply) ar).getReplyObject();
  -            ServerInvocationHandler asih2 =
  -                (ServerInvocationHandler) mPublishedObjects
  -                    .get(mr.getPublishedServiceName() + "_" + 
mr.getReturnClassNameEncoded());
  -
  -            if (asih2 == null) {
  -                return new NotPublishedReply();
  -            }
  -
  -            if (!sessionExists(mr.getSession())) {
  -                return new ExceptionReply(
  -                    new AltrmiInvocationException("TODO - you dirty rat/hacker"));
  -            }
  -
  -            //TODO a decent ref number for main?
  -            Long newRef = asih2.getOrMakeReferenceIDForBean(beanImpl);
  -
  -            //long newRef2 = asih2.getOrMakeReferenceIDForBean(beanImpl);
  -            return new MethodFacadeReply(newRef);
  -        } else if (request.getRequestCode() == AltrmiRequest.LOOKUPREQUEST) {
  -            LookupRequest lr = (LookupRequest) request;
  -
  -
  -            try {
  -                mAltrmiAuthenticator.checkAuthority(lr.getAltrmiAuthentication(),
  -                                                              
lr.getPublishedServiceName());
  -
  -
  -            } catch (AltrmiAuthenticationException aae) {
  -                return new ExceptionReply(aae);
  -            }
  -
  -            //TODO a decent ref number for main?
  -            return new LookupReply(new Long(0));
  -        } else if (request.getRequestCode() == AltrmiRequest.CLASSREQUEST) {
  -            ClassRequest cr = (ClassRequest) request;
  -            String publishedThing = cr.getPublishedServiceName() + "_" + 
cr.getObjectName();
  -            try {
  -
  -                return new ClassReply(mClassRetriever.getBeanBytes(publishedThing),
  -                                      mClassRetriever
  -                                          
.getInterfaceImplementationBytes(publishedThing));
  -            } catch (ClassRetrievalException e) {
  -                return new ClassRetrievalFailedReply();
  -            }
  -        } else if (request.getRequestCode() == AltrmiRequest.OPENCONNECTIONREQUEST) 
{
  -            Long session = getNewSession();
  -            mSessions.add(session);
  -            return new OpenConnectionReply(mAltrmiAuthenticator.getTextToSign(), 
session);
  -        } 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());
  -        }
       }
   
  -    private boolean sessionExists(Long session) {
  -
  -        if (mLastSession.equals(session)) {
  -
  -            // buffer last session for performance.
  -            return true;
  -        } else {
  -            if (mSessions.contains(session)) {
  -                mLastSession = session;
   
  -                return true;
  -            }
  -        }
  -
  -        return false;
  -    }
   
       /**
        * Method suspend
        *
        */
       public void suspend() {
  -        mSuspend = true;
  +        mInovcationHandlerAdapter.suspend();
       }
   
       /**
  @@ -411,7 +303,7 @@
        *
        */
       public void resume() {
  -        mSuspend = false;
  +        mInovcationHandlerAdapter.resume();
       }
   
       /**
  @@ -457,10 +349,7 @@
                                                                        + "_" + 
objectName);
       }
   
  -    protected Long getNewSession() {
  -        // approve everything and set session identifier.
  -        return new Long((long) ((long) SESSION++ << 32) + (long) 
Math.round(Math.random()));
  -    }
  +
   
   
   
  
  
  
  1.7       +2 -2      
jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/StreamServerConnection.java
  
  Index: StreamServerConnection.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/StreamServerConnection.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- StreamServerConnection.java       21 Jan 2002 16:36:42 -0000      1.6
  +++ StreamServerConnection.java       28 Jan 2002 14:04:54 -0000      1.7
  @@ -30,7 +30,7 @@
    *
    *
    * @author Paul Hammant <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
  - * @version $Revision: 1.6 $
  + * @version $Revision: 1.7 $
    */
   public abstract class StreamServerConnection implements Runnable, 
AltrmiServerConnection {
   
  @@ -71,7 +71,7 @@
               while (more) {
                   try {
                       if (request != null) {
  -                        reply = mAbstractServer.processRequest(request);
  +                        reply = mAbstractServer.handleInvocation(request);
                       }
   
                       request = mReadWriter.writeReplyAndGetRequest(reply);
  
  
  
  1.1                  
jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/adapters/InovcationHandlerAdapter.java
  
  Index: InovcationHandlerAdapter.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.server.impl.adapters;
  
  
  
  import org.apache.commons.altrmi.common.AltrmiInvocationHandler;
  import org.apache.commons.altrmi.common.AltrmiReply;
  import org.apache.commons.altrmi.common.AltrmiRequest;
  import org.apache.commons.altrmi.common.SuspendedReply;
  import org.apache.commons.altrmi.common.MethodRequest;
  import org.apache.commons.altrmi.common.NotPublishedReply;
  import org.apache.commons.altrmi.common.MethodFacadeRequest;
  import org.apache.commons.altrmi.common.ExceptionReply;
  import org.apache.commons.altrmi.common.AltrmiInvocationException;
  import org.apache.commons.altrmi.common.RequestFailedReply;
  import org.apache.commons.altrmi.common.MethodReply;
  import org.apache.commons.altrmi.common.MethodFacadeReply;
  import org.apache.commons.altrmi.common.LookupRequest;
  import org.apache.commons.altrmi.common.AltrmiAuthenticationException;
  import org.apache.commons.altrmi.common.LookupReply;
  import org.apache.commons.altrmi.common.ClassRequest;
  import org.apache.commons.altrmi.common.ClassReply;
  import org.apache.commons.altrmi.common.ClassRetrievalFailedReply;
  import org.apache.commons.altrmi.common.OpenConnectionReply;
  import org.apache.commons.altrmi.common.PingReply;
  import org.apache.commons.altrmi.server.AltrmiServer;
  import org.apache.commons.altrmi.server.ServerInvocationHandler;
  import org.apache.commons.altrmi.server.ClassRetrievalException;
  import org.apache.commons.altrmi.server.ClassRetriever;
  import org.apache.commons.altrmi.server.AltrmiAuthenticator;
  
  import java.util.Vector;
  import java.util.HashMap;
  
  
  /**
   * Class InovcationHandlerAdapter
   *
   *
   * @author Paul Hammant <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
   * @version $Revision: 1.1 $
   */
  public class InovcationHandlerAdapter implements AltrmiInvocationHandler {
  
      private static int SESSION = 0;
      private Long mLastSession = new Long(0);
      private Vector mSessions = new Vector();
      private boolean mSuspend = false;
  
      private ClassRetriever mClassRetriever;
      private AltrmiAuthenticator mAltrmiAuthenticator;
      private HashMap mPublishedObjects;
  
      /**
       * Constructor InovcationHandlerAdapter
       *
       *
       * @param altrmiInvocationHandler
       *
       */
      public InovcationHandlerAdapter(AltrmiAuthenticator altrmiAuthenticator, HashMap 
publishedObjects, ClassRetriever classRetriever) {
          mAltrmiAuthenticator = altrmiAuthenticator;
          mPublishedObjects = publishedObjects;
          mClassRetriever = classRetriever;
      }
  
      public final void setClassRetriever(ClassRetriever classRetriever) {
          mClassRetriever = classRetriever;
      }
  
      /**
       * Method handleInvocation
       *
       *
       * @param request
       *
       * @return
       *
       */
      public AltrmiReply handleInvocation(AltrmiRequest request) {
  
          if (mSuspend == true) {
              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();
  
              if (!mPublishedObjects.containsKey(publishedThing)) {
                  return new NotPublishedReply();
              }
  
              AltrmiInvocationHandler ih =
                  (AltrmiInvocationHandler) mPublishedObjects.get(publishedThing);
  
              return ih.handleInvocation(mr);
          } else if (request.getRequestCode() == AltrmiRequest.METHODFACADEREQUEST) {
              MethodFacadeRequest mr = (MethodFacadeRequest) request;
              String publishedThing = mr.getPublishedServiceName() + "_" + 
mr.getObjectName();
  
              if (!mPublishedObjects.containsKey(publishedThing)) {
                  return new NotPublishedReply();
              }
  
              if (!sessionExists(mr.getSession())) {
                  return new ExceptionReply(
                      new AltrmiInvocationException("TODO - you dirty rat/hacker"));
              }
  
              ServerInvocationHandler asih =
                  (ServerInvocationHandler) mPublishedObjects.get(publishedThing);
              AltrmiReply ar = asih.handleInvocation(mr);
  
              if (ar.getReplyCode() == AltrmiReply.EXCEPTIONREPLY) {
                  return ar;
              } else if (ar.getReplyCode() >= AltrmiReply.PROBLEMREPLY) {
                  return ar;
              } else if (ar.getReplyCode() != AltrmiReply.METHODREPLY) {
                  return new RequestFailedReply("TODO");
              }
  
              Object beanImpl = ((MethodReply) ar).getReplyObject();
              ServerInvocationHandler asih2 =
                  (ServerInvocationHandler) mPublishedObjects
                      .get(mr.getPublishedServiceName() + "_" + 
mr.getReturnClassNameEncoded());
  
              if (asih2 == null) {
                  return new NotPublishedReply();
              }
  
              if (!sessionExists(mr.getSession())) {
                  return new ExceptionReply(
                      new AltrmiInvocationException("TODO - you dirty rat/hacker"));
              }
  
              //TODO a decent ref number for main?
              Long newRef = asih2.getOrMakeReferenceIDForBean(beanImpl);
  
              //long newRef2 = asih2.getOrMakeReferenceIDForBean(beanImpl);
              return new MethodFacadeReply(newRef);
          } else if (request.getRequestCode() == AltrmiRequest.LOOKUPREQUEST) {
              LookupRequest lr = (LookupRequest) request;
  
  
              try {
                  mAltrmiAuthenticator.checkAuthority(lr.getAltrmiAuthentication(),
                                                                
lr.getPublishedServiceName());
  
  
              } catch (AltrmiAuthenticationException aae) {
                  return new ExceptionReply(aae);
              }
  
              //TODO a decent ref number for main?
              return new LookupReply(new Long(0));
          } else if (request.getRequestCode() == AltrmiRequest.CLASSREQUEST) {
              ClassRequest cr = (ClassRequest) request;
              String publishedThing = cr.getPublishedServiceName() + "_" + 
cr.getObjectName();
              try {
  
                  return new ClassReply(mClassRetriever.getBeanBytes(publishedThing),
                                        mClassRetriever
                                            
.getInterfaceImplementationBytes(publishedThing));
              } catch (ClassRetrievalException e) {
                  return new ClassRetrievalFailedReply();
              }
          } else if (request.getRequestCode() == AltrmiRequest.OPENCONNECTIONREQUEST) {
              Long session = getNewSession();
              mSessions.add(session);
              return new OpenConnectionReply(mAltrmiAuthenticator.getTextToSign(), 
session);
          } 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());
          }
      }
  
      private boolean sessionExists(Long session) {
  
          if (mLastSession.equals(session)) {
  
              // buffer last session for performance.
              return true;
          } else {
              if (mSessions.contains(session)) {
                  mLastSession = session;
  
                  return true;
              }
          }
  
          return false;
      }
  
      private Long getNewSession() {
          // approve everything and set session identifier.
          return new Long((long) ((long) SESSION++ << 32) + (long) 
Math.round(Math.random()));
      }
  
      /**
       * Method suspend
       *
       */
      public void suspend() {
          mSuspend = true;
      }
  
      /**
       * Method resume
       *
       */
      public void resume() {
          mSuspend = false;
      }
  
  }
  
  
  
  1.1                  
jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/adapters/MarshalledInovcationHandlerAdapter.java
  
  Index: MarshalledInovcationHandlerAdapter.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.server.impl.adapters;
  
  
  
  import org.apache.commons.altrmi.common.AltrmiInvocationHandler;
  import org.apache.commons.altrmi.common.AltrmiReply;
  import org.apache.commons.altrmi.common.AltrmiRequest;
  import org.apache.commons.altrmi.common.AltrmiMarshalledInvocationHandler;
  import org.apache.commons.altrmi.common.SerializationHelper;
  import org.apache.commons.altrmi.server.AltrmiServer;
  
  import java.io.IOException;
  
  
  /**
   * Class MarshalledInovcationHandlerAdapter
   *
   *
   * @author Paul Hammant <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
   * @version $Revision: 1.1 $
   */
  public class MarshalledInovcationHandlerAdapter implements 
AltrmiMarshalledInvocationHandler {
  
      private AltrmiInvocationHandler mAltrmiInvocationHandler;
  
      /**
       * Constructor MarshalledInovcationHandlerAdapter
       *
       *
       * @param altrmiInvocationHandler
       *
       */
      public MarshalledInovcationHandlerAdapter(AltrmiInvocationHandler 
altrmiInvocationHandler) {
          mAltrmiInvocationHandler = altrmiInvocationHandler;
      }
  
      /**
       * Method handleInvocation
       *
       *
       * @param request
       *
       * @return
       *
       */
      public byte[] handleInvocation(byte[] request) {
          try {
              AltrmiRequest ar = (AltrmiRequest) 
SerializationHelper.getInstanceFromBytes(request);
              AltrmiReply reply = mAltrmiInvocationHandler.handleInvocation(ar);
              return SerializationHelper.getBytesFromInstance(reply);
          } catch (IOException e) {
              e.printStackTrace();
              return null;
          } catch (ClassNotFoundException e) {
              e.printStackTrace();
              return null;
          }
  
      }
  }
  
  
  
  1.2       +3 -3      
jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/direct/DirectMarshalledServer.java
  
  Index: DirectMarshalledServer.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/direct/DirectMarshalledServer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DirectMarshalledServer.java       26 Jan 2002 15:22:17 -0000      1.1
  +++ DirectMarshalledServer.java       28 Jan 2002 14:04:54 -0000      1.2
  @@ -21,7 +21,7 @@
    *
    *
    * @author Paul Hammant <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
   public class DirectMarshalledServer extends AbstractServer {
   
  @@ -46,7 +46,7 @@
       }
   
       /**
  -     * Method processRequest
  +     * Method handleInvocation
        *
        *
        * @param request
  @@ -54,9 +54,9 @@
        * @return
        *
        */
  -    public AltrmiReply processRequest(AltrmiRequest request) {
  +    public AltrmiReply handleInvocation(AltrmiRequest request) {
           if (mState == STARTED) {
  -            return super.processRequest(request);
  +            return super.handleInvocation(request);
           } else {
               throw new AltrmiInvocationException("Service is not started");
           }
  
  
  
  1.2       +4 -4      
jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/direct/DirectServer.java
  
  Index: DirectServer.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/direct/DirectServer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DirectServer.java 9 Jan 2002 19:25:56 -0000       1.1
  +++ DirectServer.java 28 Jan 2002 14:04:54 -0000      1.2
  @@ -21,7 +21,7 @@
    *
    *
    * @author Paul Hammant <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
   public class DirectServer extends AbstractServer {
   
  @@ -46,7 +46,7 @@
       }
   
       /**
  -     * Method processRequest
  +     * Method handleInvocation
        *
        *
        * @param request
  @@ -54,9 +54,9 @@
        * @return
        *
        */
  -    public AltrmiReply processRequest(AltrmiRequest request) {
  +    public AltrmiReply handleInvocation(AltrmiRequest request) {
           if (mState == STARTED) {
  -            return super.processRequest(request);
  +            return super.handleInvocation(request);
           } else {
               throw new AltrmiInvocationException("Service is not started");
           }
  
  
  
  1.2       +1 -1      
jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/rmi/RmiInovcationAdapter.java
  
  Index: RmiInovcationAdapter.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/rmi/RmiInovcationAdapter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RmiInovcationAdapter.java 21 Jan 2002 15:38:21 -0000      1.1
  +++ RmiInovcationAdapter.java 28 Jan 2002 14:04:54 -0000      1.2
  @@ -23,7 +23,7 @@
    *
    *
    * @author Paul Hammant <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
   public class RmiInovcationAdapter implements RmiAltrmiInvocationHandler {
   
  @@ -52,6 +52,6 @@
        *
        */
       public AltrmiReply handleInvocation(AltrmiRequest request) throws 
RemoteException {
  -        return mAbstractServer.processRequest(request);
  +        return mAbstractServer.handleInvocation(request);
       }
   }
  
  
  
  1.2       +5 -5      
jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/test/DirectMarshalledTest.java
  
  Index: DirectMarshalledTest.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/test/DirectMarshalledTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DirectMarshalledTest.java 26 Jan 2002 15:22:17 -0000      1.1
  +++ DirectMarshalledTest.java 28 Jan 2002 14:04:55 -0000      1.2
  @@ -10,9 +10,9 @@
   
   
   import org.apache.commons.altrmi.server.impl.direct.DirectServer;
  -import org.apache.commons.altrmi.server.impl.direct.DirectInovcationAdapter;
  +import org.apache.commons.altrmi.server.impl.adapters.InovcationHandlerAdapter;
  +import 
org.apache.commons.altrmi.server.impl.adapters.MarshalledInovcationHandlerAdapter;
   import org.apache.commons.altrmi.server.impl.direct.DirectMarshalledServer;
  -import 
org.apache.commons.altrmi.server.impl.direct.DirectMarshalledInovcationAdapter;
   import org.apache.commons.altrmi.server.impl.classretrievers.JarFileClassRetriever;
   import org.apache.commons.altrmi.common.AltrmiInvocationHandler;
   import org.apache.commons.altrmi.common.AltrmiConnectionException;
  @@ -32,7 +32,7 @@
    *
    *
    * @author Paul Hammant <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
   public class DirectMarshalledTest {
   
  @@ -62,7 +62,7 @@
           ds.publish(ti, "Hello", TestInterface.class, TestInterface2.class);
           ds.start();
   
  -        DirectMarshalledTestClient dtc = new DirectMarshalledTestClient(new 
DirectMarshalledInovcationAdapter(ds));
  +        DirectMarshalledTestClient dtc = new DirectMarshalledTestClient(new 
MarshalledInovcationHandlerAdapter(ds));
           Thread thread = new Thread(dtc);
   
           thread.start();
  @@ -73,7 +73,7 @@
        *
        *
        * @author Paul Hammant <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
  -     * @version $Revision: 1.1 $
  +     * @version $Revision: 1.2 $
        */
       static class DirectMarshalledTestClient implements Runnable {
   
  
  
  
  1.8       +4 -4      
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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- DirectTest.java   25 Jan 2002 16:40:14 -0000      1.7
  +++ DirectTest.java   28 Jan 2002 14:04:55 -0000      1.8
  @@ -10,7 +10,7 @@
   
   
   import org.apache.commons.altrmi.server.impl.direct.DirectServer;
  -import org.apache.commons.altrmi.server.impl.direct.DirectInovcationAdapter;
  +import org.apache.commons.altrmi.server.impl.adapters.InovcationHandlerAdapter;
   import org.apache.commons.altrmi.server.impl.classretrievers.JarFileClassRetriever;
   import org.apache.commons.altrmi.common.AltrmiInvocationHandler;
   import org.apache.commons.altrmi.common.AltrmiConnectionException;
  @@ -28,7 +28,7 @@
    *
    *
    * @author Paul Hammant <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
  - * @version $Revision: 1.7 $
  + * @version $Revision: 1.8 $
    */
   public class DirectTest {
   
  @@ -58,7 +58,7 @@
           ds.publish(ti, "Hello", TestInterface.class, TestInterface2.class);
           ds.start();
   
  -        DirectTestClient dtc = new DirectTestClient(new 
DirectInovcationAdapter(ds));
  +        DirectTestClient dtc = new DirectTestClient(new 
InovcationHandlerAdapter(ds));
           Thread thread = new Thread(dtc);
   
           thread.start();
  @@ -69,7 +69,7 @@
        *
        *
        * @author Paul Hammant <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
  -     * @version $Revision: 1.7 $
  +     * @version $Revision: 1.8 $
        */
       static class DirectTestClient implements Runnable {
   
  
  
  

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

Reply via email to