commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hamm...@apache.org
Subject cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/adapters InovcationHandlerAdapter.java
Date Mon, 28 Jan 2002 14:19:08 GMT
hammant     02/01/28 06:19:08

  Modified:    altrmi/src/java/org/apache/commons/altrmi/server/impl
                        AbstractServer.java
               altrmi/src/java/org/apache/commons/altrmi/server/impl/adapters
                        InovcationHandlerAdapter.java
  Log:
  More work on adaption layers
  
  Revision  Changes    Path
  1.16      +7 -5      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.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- AbstractServer.java	28 Jan 2002 14:04:54 -0000	1.15
  +++ AbstractServer.java	28 Jan 2002 14:19:08 -0000	1.16
  @@ -59,7 +59,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.15 $
  + * @version $Revision: 1.16 $
    */
   public abstract class AbstractServer extends AbstractMethodHandler implements AltrmiServer
{
   
  @@ -68,8 +68,6 @@
       private HashMap mPublishedObjects = new HashMap();
   
       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;
  @@ -78,7 +76,11 @@
       protected int mState = UNSTARTED;
   
       public AbstractServer() {
  -        mInovcationHandlerAdapter = new InovcationHandlerAdapter(mAltrmiAuthenticator,
mPublishedObjects, mClassRetriever);
  +        mInovcationHandlerAdapter = new InovcationHandlerAdapter(mPublishedObjects);
  +    }
  +
  +    public HashMap getPublishedObjects() {
  +        return mPublishedObjects;
       }
   
       /**
  @@ -270,7 +272,7 @@
        *
        */
       public final void setAuthenticator(AltrmiAuthenticator altrmiAuthenticator) {
  -        mAltrmiAuthenticator = altrmiAuthenticator;
  +        mInovcationHandlerAdapter.setAuthenticator(altrmiAuthenticator);
       }
   
       /**
  
  
  
  1.2       +15 -6     jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/adapters/InovcationHandlerAdapter.java
  
  Index: InovcationHandlerAdapter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/adapters/InovcationHandlerAdapter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- InovcationHandlerAdapter.java	28 Jan 2002 14:04:54 -0000	1.1
  +++ InovcationHandlerAdapter.java	28 Jan 2002 14:19:08 -0000	1.2
  @@ -34,6 +34,9 @@
   import org.apache.commons.altrmi.server.ClassRetrievalException;
   import org.apache.commons.altrmi.server.ClassRetriever;
   import org.apache.commons.altrmi.server.AltrmiAuthenticator;
  +import org.apache.commons.altrmi.server.impl.classretrievers.NoClassRetriever;
  +import org.apache.commons.altrmi.server.impl.DefaultAuthenticator;
  +import org.apache.commons.altrmi.server.impl.AbstractServer;
   
   import java.util.Vector;
   import java.util.HashMap;
  @@ -44,7 +47,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
   public class InovcationHandlerAdapter implements AltrmiInvocationHandler {
   
  @@ -53,25 +56,31 @@
       private Vector mSessions = new Vector();
       private boolean mSuspend = false;
   
  -    private ClassRetriever mClassRetriever;
  -    private AltrmiAuthenticator mAltrmiAuthenticator;
  +    private ClassRetriever mClassRetriever = new NoClassRetriever();
  +    private AltrmiAuthenticator mAltrmiAuthenticator = new DefaultAuthenticator();
       private HashMap mPublishedObjects;
   
       /**
        * Constructor InovcationHandlerAdapter
        *
        *
  -     * @param altrmiInvocationHandler
  +     * @param publishedObjects
        *
        */
  -    public InovcationHandlerAdapter(AltrmiAuthenticator altrmiAuthenticator, HashMap publishedObjects,
ClassRetriever classRetriever) {
  -        mAltrmiAuthenticator = altrmiAuthenticator;
  +    public InovcationHandlerAdapter(HashMap publishedObjects) {
           mPublishedObjects = publishedObjects;
  -        mClassRetriever = classRetriever;
  +    }
  +
  +    public InovcationHandlerAdapter(AbstractServer abstractServer) {
  +        this(abstractServer.getPublishedObjects());
       }
   
       public final void setClassRetriever(ClassRetriever classRetriever) {
           mClassRetriever = classRetriever;
  +    }
  +
  +    public final void setAuthenticator(AltrmiAuthenticator altrmiAuthenticator) {
  +        mAltrmiAuthenticator = altrmiAuthenticator;
       }
   
       /**
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message