incubator-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hamm...@apache.org
Subject cvs commit: incubator-altrmi/server/impl/src/java/org/apache/altrmi/server/impl/callback CallbackHelperImpl.java
Date Fri, 05 Sep 2003 08:14:30 GMT
hammant     2003/09/05 01:14:30

  Modified:    client/impl/src/java/org/apache/altrmi/client/impl/callback/socket
                        CallbackEnabledSocketCustomStreamHostContext.java
               client/impl/src/java/org/apache/altrmi/client/impl/callback/stream
                        CallbackEnabledClientCustomStreamReadWriter.java
               common/src/java/org/apache/altrmi/common ClassFoo.java
  Added:       server/api/src/java/org/apache/altrmi/server
                        CallbackHelper.java
               server/impl/src/java/org/apache/altrmi/server/impl/callback
                        CallbackHelperImpl.java
  Log:
  Better factory for former ClassFoo stuff.
  
  Revision  Changes    Path
  1.2       +2 -2      incubator-altrmi/client/impl/src/java/org/apache/altrmi/client/impl/callback/socket/CallbackEnabledSocketCustomStreamHostContext.java
  
  Index: CallbackEnabledSocketCustomStreamHostContext.java
  ===================================================================
  RCS file: /home/cvs/incubator-altrmi/client/impl/src/java/org/apache/altrmi/client/impl/callback/socket/CallbackEnabledSocketCustomStreamHostContext.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CallbackEnabledSocketCustomStreamHostContext.java	4 Sep 2003 21:24:24 -0000	1.1
  +++ CallbackEnabledSocketCustomStreamHostContext.java	5 Sep 2003 08:14:30 -0000	1.2
  @@ -94,7 +94,7 @@
               super(new DefaultThreadPool(),
                       new DumbClientMonitor(),
                       new NeverConnectionPinger(),
  -                    SocketObjectStreamHostContext.class.getClassLoader(),
  +                    CallbackEnabledSocketCustomStreamHostContext.class.getClassLoader(),
                       host, port);
           }
       }
  
  
  
  1.2       +11 -2     incubator-altrmi/client/impl/src/java/org/apache/altrmi/client/impl/callback/stream/CallbackEnabledClientCustomStreamReadWriter.java
  
  Index: CallbackEnabledClientCustomStreamReadWriter.java
  ===================================================================
  RCS file: /home/cvs/incubator-altrmi/client/impl/src/java/org/apache/altrmi/client/impl/callback/stream/CallbackEnabledClientCustomStreamReadWriter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CallbackEnabledClientCustomStreamReadWriter.java	4 Sep 2003 21:24:24 -0000	1.1
  +++ CallbackEnabledClientCustomStreamReadWriter.java	5 Sep 2003 08:14:30 -0000	1.2
  @@ -75,6 +75,8 @@
   import org.apache.altrmi.server.ServerSideClientContextFactory;
   import org.apache.altrmi.server.Authenticator;
   import org.apache.altrmi.server.ClassRetriever;
  +import org.apache.altrmi.server.CallbackHelper;
  +//import org.apache.altrmi.server.impl.classretrievers.PlainClassRetriever;
   
   import java.io.BufferedOutputStream;
   import java.io.DataInputStream;
  @@ -129,12 +131,19 @@
           m_dataOutputStream = new DataOutputStream(new BufferedOutputStream(outputStream));
           m_dataInputStream = new DataInputStream(inputStream);
   
  +        CallbackHelper callbackHelper = (CallbackHelper) ClassFoo.instantiate("org.apache.altrmi.server.impl.callback.CallbackHelperImpl");
  +
           m_interfacesClassLoader = interfacesClassLoader;
           //start the internal Server which holds the exposed Objects
           // for the server to make callbacks upon.
  -        ServerMonitor serverMonitor = (ServerMonitor) ClassFoo.instantiate("org.apache.altrmi.server.impl.NullServerMonitor");
  +        ServerMonitor serverMonitor = callbackHelper.createServerMonitor();
  +
  +        // replace remaining ClassFoo method invocations.
           ServerSideClientContextFactory serverSideClientContextFactory = (ServerSideClientContextFactory)
ClassFoo.instantiate("org.apache.altrmi.server.impl.DefaultServerSideClientContextFactory");
           Authenticator authenticator = (Authenticator) ClassFoo.instantiate("org.apache.altrmi.server.impl.DefaultAuthenticator");
  +
  +        //System.out.println("1 " + PlainClassRetriever.class.getClassLoader());
  +        //System.out.println("2 " + ClassFoo.class.getClassLoader());
           ClassRetriever classRetriever = (ClassRetriever) ClassFoo.instantiate("org.apache.altrmi.server.impl.classretrievers.PlainClassRetriever",
ClassLoader.class.getName(), this.getClass().getClassLoader());
           m_clientServerHostingExposedObjects = (Server) ClassFoo.instantiate("org.apache.altrmi.server.impl.direct.DirectServer",
               new String[]{ClassRetriever.class.getName(), Authenticator.class.getName(),
ServerMonitor.class.getName(), ThreadPool.class.getName(), ServerSideClientContextFactory.class.getName()},
  
  
  
  1.2       +2 -2      incubator-altrmi/common/src/java/org/apache/altrmi/common/ClassFoo.java
  
  Index: ClassFoo.java
  ===================================================================
  RCS file: /home/cvs/incubator-altrmi/common/src/java/org/apache/altrmi/common/ClassFoo.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ClassFoo.java	4 Sep 2003 21:24:25 -0000	1.1
  +++ ClassFoo.java	5 Sep 2003 08:14:30 -0000	1.2
  @@ -60,7 +60,7 @@
   public class ClassFoo {
       public static Object instantiate(String className) {
           try {
  -            Class clazz = Class.forName(className);
  +            Class clazz = Class.forName(className, true, ClassFoo.class.getClassLoader());
               return clazz.newInstance();
           } catch (ClassNotFoundException e) {
               throw new AltrmiRuntimeException("Class Not Found",e);
  @@ -79,7 +79,7 @@
               for (int i = 0; i < params.length; i++) {
                   paramz[i] = Class.forName(params[i]);
               }
  -            Class clazz = Class.forName(className);
  +            Class clazz = Class.forName(className, true, ClassFoo.class.getClassLoader());
               Constructor ctor = clazz.getConstructor(paramz);
               return ctor.newInstance(args);
           } catch (ClassNotFoundException e) {
  
  
  
  1.1                  incubator-altrmi/server/api/src/java/org/apache/altrmi/server/CallbackHelper.java
  
  Index: CallbackHelper.java
  ===================================================================
  package org.apache.altrmi.server;
  
  public interface CallbackHelper {
  
      ServerMonitor createServerMonitor();
  }
  
  
  
  1.1                  incubator-altrmi/server/impl/src/java/org/apache/altrmi/server/impl/callback/CallbackHelperImpl.java
  
  Index: CallbackHelperImpl.java
  ===================================================================
  package org.apache.altrmi.server.impl.callback;
  
  import org.apache.altrmi.server.ServerMonitor;
  import org.apache.altrmi.server.CallbackHelper;
  import org.apache.altrmi.server.impl.NullServerMonitor;
  
  public class CallbackHelperImpl implements CallbackHelper {
  
      ServerMonitor createServerMonitor() {
          return new NullServerMonitor();
      }
  
  }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@incubator.apache.org
For additional commands, e-mail: cvs-help@incubator.apache.org


Mime
View raw message