hammant     2003/01/09 14:55:30

  Modified:    altrmi/src/test/org/apache/excalibur/altrmi/test2
                        ClassRetrievingTestCase.java
               altrmi/src/test/org/apache/excalibur/altrmi/test
                        BasicClientServerTestCase.java
                        MemoryLeakClientTest.java ProConClientTest.java
               altrmi/src/test/org/apache/excalibur/altrmi/test/async
                        SimpleAsync2TestCase.java SimpleAsyncTestCase.java
               altrmi/src/test/org/apache/excalibur/altrmi/test/callback
                        CallBackTestClient.java
               altrmi/src/test/org/apache/excalibur/altrmi/test/direct
                        DirectMarshalledTestCase.java DirectTestCase.java
               altrmi/src/test/org/apache/excalibur/altrmi/test/generator
                        BCELProxyGeneratorTestCase.java
               altrmi/src/test/org/apache/excalibur/altrmi/test/http
                        CustomHttpServletTestCase.java
               altrmi/src/test/org/apache/excalibur/altrmi/test/invalidstate
                        BouncingServerTestCase.java
               altrmi/src/test/org/apache/excalibur/altrmi/test/mismatch
                        SocketMismatchTestCase.java
               altrmi/src/test/org/apache/excalibur/altrmi/test/piped
                        PipedCustomStreamTestCase.java
                        PipedObjectStreamTestCase.java
               altrmi/src/test/org/apache/excalibur/altrmi/test/rmi
                        RmiTestCase.java
               altrmi/src/test/org/apache/excalibur/altrmi/test/socket
                        CallbackEnabledCustomStreamTestCase.java
                        CustomStreamJNDITestCase.java
                        CustomStreamOptmizedTestCase.java
                        CustomStreamTestCase.java
                        JSXObjectStreamTestCase.java
                        ObjectStreamTestCase.java
               altrmi/src/xdocs client-usage.xml
  Added:       altrmi/src/java/org/apache/excalibur/altrmi/client/impl
                        AbstractFactory.java ClientSideClassFactory.java
                        DynamicClassFactory.java
                        ServerSideClassFactory.java
               altrmi/src/java/org/apache/excalibur/altrmi/client/impl/naming
                        DefaultContext.java
                        DefaultInitialContextFactory.java
               altrmi/src/java/org/apache/excalibur/altrmi/client/impl/rmi
                        RmiClientInvocationHandler.java
               altrmi/src/java/org/apache/excalibur/altrmi/client/impl/socket
                        DefaultUserInfo.java
               
altrmi/src/java/org/apache/excalibur/altrmi/client/impl/subscriber
                        AbstractInterfaceLookupFactory.java
                        DefaultLookupPool.java InterfaceLookupWrapper.java
               altrmi/src/java/org/apache/excalibur/altrmi/common
                        RmiInvocationHandler.java
               altrmi/src/java/org/apache/excalibur/altrmi/generator/ant
                        ProxyGenerationTask.java
               altrmi/src/java/org/apache/excalibur/altrmi/server/impl
                        Session.java
               altrmi/src/java/org/apache/excalibur/altrmi/server/impl/callback
                        CallbackServerClassFactory.java
  Removed:     altrmi/src/java/org/apache/excalibur/altrmi/client/impl
                        AbstractAltrmiFactory.java
                        ClientClassAltrmiFactory.java
                        DynamicClassAltrmiFactory.java
                        ServerClassAltrmiFactory.java
               altrmi/src/java/org/apache/excalibur/altrmi/client/impl/naming
                        DefaultAltrmiContext.java
                        DefaultAltrmiInitialContextFactory.java
               altrmi/src/java/org/apache/excalibur/altrmi/client/impl/rmi
                        RmiInvocationHandler.java
               altrmi/src/java/org/apache/excalibur/altrmi/client/impl/socket
                        AltrmiUserInfo.java
               
altrmi/src/java/org/apache/excalibur/altrmi/client/impl/subscriber
                        AbstractAltrmiInterfaceLookupFactory.java
               altrmi/lib phoenix-client.jar
  Log:
  Positively the last set of wholescale renames!
  
  Revision  Changes    Path
  1.3       +2 -2      
jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test2/ClassRetrievingTestCase.java
  
  Index: ClassRetrievingTestCase.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test2/ClassRetrievingTestCase.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ClassRetrievingTestCase.java      6 Jan 2003 23:42:11 -0000       1.2
  +++ ClassRetrievingTestCase.java      9 Jan 2003 22:55:27 -0000       1.3
  @@ -12,7 +12,7 @@
   import 
org.apache.excalibur.altrmi.server.impl.classretrievers.AbstractDynamicGeneratorClassRetriever;
   import org.apache.excalibur.altrmi.server.impl.piped.PipedCustomStreamServer;
   import org.apache.excalibur.altrmi.client.Factory;
  -import org.apache.excalibur.altrmi.client.impl.ServerClassAltrmiFactory;
  +import org.apache.excalibur.altrmi.client.impl.ServerSideClassFactory;
   import 
org.apache.excalibur.altrmi.client.impl.piped.PipedCustomStreamHostContext;
   
   import java.io.PipedInputStream;
  @@ -56,7 +56,7 @@
           ((PipedCustomStreamServer) server).makeNewConnection(in, out);
   
           // Client side setup
  -        Factory af = new ServerClassAltrmiFactory(false);
  +        Factory af = new ServerSideClassFactory(false);
           af.setHostContext(new PipedCustomStreamHostContext(in, out));
           testClient = (TestInterface) af.lookup("Kewl");
   
  
  
  
  1.3       +5 -5      
jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/BasicClientServerTestCase.java
  
  Index: BasicClientServerTestCase.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/BasicClientServerTestCase.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- BasicClientServerTestCase.java    28 Oct 2002 21:58:56 -0000      1.2
  +++ BasicClientServerTestCase.java    9 Jan 2003 22:55:27 -0000       1.3
  @@ -9,7 +9,7 @@
   
   import 
org.apache.excalibur.altrmi.client.impl.socket.SocketCustomStreamHostContext;
   import 
org.apache.excalibur.altrmi.client.impl.socket.SocketObjectStreamHostContext;
  -import org.apache.excalibur.altrmi.client.impl.ClientClassAltrmiFactory;
  +import org.apache.excalibur.altrmi.client.impl.ClientSideClassFactory;
   import org.apache.excalibur.altrmi.client.impl.rmi.RmiHostContext;
   import org.apache.excalibur.altrmi.common.ConnectionRefusedException;
   import org.apache.excalibur.altrmi.common.BadConnectionException;
  @@ -36,7 +36,7 @@
       {
           try
           {
  -            ClientClassAltrmiFactory altrmiFactory = new 
ClientClassAltrmiFactory(false);
  +            ClientSideClassFactory altrmiFactory = new 
ClientSideClassFactory(false);
               altrmiFactory.setHostContext(new 
SocketCustomStreamHostContext("127.0.0.1", 12345), false);
               fail("Should have have failed.");
           }
  @@ -59,7 +59,7 @@
           server.start();
   
           // Client side setup
  -        ClientClassAltrmiFactory altrmiFactory = new 
ClientClassAltrmiFactory(false);
  +        ClientSideClassFactory altrmiFactory = new 
ClientSideClassFactory(false);
           try
           {
               altrmiFactory.setHostContext(new 
SocketObjectStreamHostContext("127.0.0.1", 12346), false);
  @@ -92,7 +92,7 @@
   
   
           // Client side setup
  -        ClientClassAltrmiFactory altrmiFactory = new 
ClientClassAltrmiFactory(false);
  +        ClientSideClassFactory altrmiFactory = new 
ClientSideClassFactory(false);
           try
           {
               altrmiFactory.setHostContext(new 
SocketCustomStreamHostContext("127.0.0.1", 12347), false);
  @@ -124,7 +124,7 @@
           server.start();
   
           // Client side setup
  -        ClientClassAltrmiFactory altrmiFactory = new 
ClientClassAltrmiFactory(false);
  +        ClientSideClassFactory altrmiFactory = new 
ClientSideClassFactory(false);
           try
           {
               altrmiFactory.setHostContext(new RmiHostContext("127.0.0.1", 
12348), false);
  
  
  
  1.4       +3 -3      
jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/MemoryLeakClientTest.java
  
  Index: MemoryLeakClientTest.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/MemoryLeakClientTest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- MemoryLeakClientTest.java 6 Jan 2003 23:42:11 -0000       1.3
  +++ MemoryLeakClientTest.java 9 Jan 2003 22:55:27 -0000       1.4
  @@ -8,7 +8,7 @@
   package org.apache.excalibur.altrmi.test;
   
   import org.apache.excalibur.altrmi.client.Factory;
  -import org.apache.excalibur.altrmi.client.impl.ClientClassAltrmiFactory;
  +import org.apache.excalibur.altrmi.client.impl.ClientSideClassFactory;
   import 
org.apache.excalibur.altrmi.client.impl.socket.SocketCustomStreamHostContext;
   
   /**
  @@ -75,7 +75,7 @@
   
           System.out.println( "Memory Leak Client" );
   
  -        Factory af = new ClientClassAltrmiFactory( false );
  +        Factory af = new ClientSideClassFactory( false );
   
           af.setHostContext( new SocketCustomStreamHostContext( "127.0.0.1", 
1277 ) );
   
  
  
  
  1.5       +4 -4      
jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/ProConClientTest.java
  
  Index: ProConClientTest.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/ProConClientTest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ProConClientTest.java     6 Jan 2003 23:42:11 -0000       1.4
  +++ ProConClientTest.java     9 Jan 2003 22:55:27 -0000       1.5
  @@ -9,8 +9,8 @@
   
   import org.apache.excalibur.altrmi.client.Factory;
   import org.apache.excalibur.altrmi.client.HostContext;
  -import org.apache.excalibur.altrmi.client.impl.ClientClassAltrmiFactory;
  -import org.apache.excalibur.altrmi.client.impl.ServerClassAltrmiFactory;
  +import org.apache.excalibur.altrmi.client.impl.ClientSideClassFactory;
  +import org.apache.excalibur.altrmi.client.impl.ServerSideClassFactory;
   import 
org.apache.excalibur.altrmi.client.impl.socket.SocketCustomStreamHostContext;
   import 
org.apache.excalibur.altrmi.client.impl.socket.SocketObjectStreamHostContext;
   
  @@ -63,11 +63,11 @@
   
           if( args[ 0 ].equals( "S" ) )
           {
  -            af = new ServerClassAltrmiFactory( false );
  +            af = new ServerSideClassFactory( false );
           }
           else
           {
  -            af = new ClientClassAltrmiFactory( false );
  +            af = new ClientSideClassFactory( false );
           }
   
           af.setHostContext( arhc );
  
  
  
  1.5       +3 -3      
jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/async/SimpleAsync2TestCase.java
  
  Index: SimpleAsync2TestCase.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/async/SimpleAsync2TestCase.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SimpleAsync2TestCase.java 6 Jan 2003 23:42:11 -0000       1.4
  +++ SimpleAsync2TestCase.java 9 Jan 2003 22:55:27 -0000       1.5
  @@ -11,7 +11,7 @@
   import 
org.apache.excalibur.altrmi.server.impl.classretrievers.JavacDynamicGeneratorClassRetriever;
   import org.apache.excalibur.altrmi.server.PublicationDescription;
   import org.apache.excalibur.altrmi.server.PublicationDescriptionItem;
  -import org.apache.excalibur.altrmi.client.impl.ServerClassAltrmiFactory;
  +import org.apache.excalibur.altrmi.client.impl.ServerSideClassFactory;
   import 
org.apache.excalibur.altrmi.client.impl.socket.SocketCustomStreamHostContext;
   import org.apache.excalibur.altrmi.client.Factory;
   import junit.framework.TestCase;
  @@ -53,7 +53,7 @@
               javaHome = javaHome.getParentFile();
           }
           System.out.println("javaHome=" + javaHome.getAbsolutePath());
  -        cr.setAltrmiClasspath(".."+FS+"build"+FS+"classes"+PS+ 
javaHome.getAbsolutePath() +FS+"lib"+FS+"tools.jar");
  +        cr.setClasspath(".."+FS+"build"+FS+"classes"+PS+ 
javaHome.getAbsolutePath() +FS+"lib"+FS+"tools.jar");
           cr.setSrcGenDir(".");
           server.setClassRetriever(cr);
           asyncTestImpl = new AsyncTestImpl();
  @@ -64,7 +64,7 @@
           server.start();
   
           // Client side setup
  -        altrmiFactory = new ServerClassAltrmiFactory(false);
  +        altrmiFactory = new ServerSideClassFactory(false);
           altrmiFactory.setHostContext(
                   new SocketCustomStreamHostContext("127.0.0.1", 11004), 
false);
           testClient = (AsyncTest) altrmiFactory.lookup("AsyncTestB");
  
  
  
  1.7       +3 -3      
jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/async/SimpleAsyncTestCase.java
  
  Index: SimpleAsyncTestCase.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/async/SimpleAsyncTestCase.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- SimpleAsyncTestCase.java  6 Jan 2003 23:42:11 -0000       1.6
  +++ SimpleAsyncTestCase.java  9 Jan 2003 22:55:27 -0000       1.7
  @@ -11,7 +11,7 @@
   import 
org.apache.excalibur.altrmi.server.impl.classretrievers.JavacDynamicGeneratorClassRetriever;
   import org.apache.excalibur.altrmi.server.PublicationDescription;
   import org.apache.excalibur.altrmi.server.PublicationDescriptionItem;
  -import org.apache.excalibur.altrmi.client.impl.ServerClassAltrmiFactory;
  +import org.apache.excalibur.altrmi.client.impl.ServerSideClassFactory;
   import 
org.apache.excalibur.altrmi.client.impl.socket.SocketCustomStreamHostContext;
   import org.apache.excalibur.altrmi.client.Factory;
   import junit.framework.TestCase;
  @@ -40,7 +40,7 @@
           JavacDynamicGeneratorClassRetriever cr = new 
JavacDynamicGeneratorClassRetriever(
                   this.getClass().getClassLoader());
           cr.setClassGenDir(".");
  -        
cr.setAltrmiClasspath("..\\build\\classes;C:\\j2sdk1.4.1\\lib\\tools.jar");
  +        cr.setClasspath("..\\build\\classes;C:\\j2sdk1.4.1\\lib\\tools.jar");
           cr.setSrcGenDir(".");
           server.setClassRetriever(cr);
           asyncTestImpl = new AsyncTestImpl();
  @@ -60,7 +60,7 @@
           server.start();
   
           // Client side setup
  -        altrmiFactory = new ServerClassAltrmiFactory(false);
  +        altrmiFactory = new ServerSideClassFactory(false);
           altrmiFactory.setHostContext(
                   new SocketCustomStreamHostContext("127.0.0.1", 11003), 
false);
           testClient = (AsyncTest) altrmiFactory.lookup("AsyncTest");
  
  
  
  1.9       +2 -2      
jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/callback/CallBackTestClient.java
  
  Index: CallBackTestClient.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/callback/CallBackTestClient.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- CallBackTestClient.java   6 Jan 2003 23:42:12 -0000       1.8
  +++ CallBackTestClient.java   9 Jan 2003 22:55:27 -0000       1.9
  @@ -9,7 +9,7 @@
   
   import org.apache.excalibur.altrmi.client.Factory;
   import org.apache.excalibur.altrmi.client.HostContext;
  -import org.apache.excalibur.altrmi.client.impl.ServerClassAltrmiFactory;
  +import org.apache.excalibur.altrmi.client.impl.ServerSideClassFactory;
   import 
org.apache.excalibur.altrmi.client.impl.callback.socket.CallbackEnabledSocketCustomStreamHostContext;
   
   /**
  @@ -40,7 +40,7 @@
   
           Factory af = null;
   
  -        af = new ServerClassAltrmiFactory( false );
  +        af = new ServerSideClassFactory( false );
   
           af.setHostContext( arhc );
   
  
  
  
  1.5       +2 -2      
jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/direct/DirectMarshalledTestCase.java
  
  Index: DirectMarshalledTestCase.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/direct/DirectMarshalledTestCase.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DirectMarshalledTestCase.java     6 Jan 2003 23:42:12 -0000       1.4
  +++ DirectMarshalledTestCase.java     9 Jan 2003 22:55:27 -0000       1.5
  @@ -7,7 +7,7 @@
    */
   package org.apache.excalibur.altrmi.test.direct;
   
  -import org.apache.excalibur.altrmi.client.impl.ClientClassAltrmiFactory;
  +import org.apache.excalibur.altrmi.client.impl.ClientSideClassFactory;
   import 
org.apache.excalibur.altrmi.client.impl.direct.DirectMarshalledHostContext;
   import org.apache.excalibur.altrmi.client.Factory;
   
  @@ -45,7 +45,7 @@
           server.start();
   
           // Client side setup
  -        altrmiFactory = new ClientClassAltrmiFactory(false);
  +        altrmiFactory = new ClientSideClassFactory(false);
           altrmiFactory.setHostContext(new 
DirectMarshalledHostContext((DirectMarshalledServer)server));
           testClient = (TestInterface) altrmiFactory.lookup("Hello");
   
  
  
  
  1.5       +2 -2      
jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/direct/DirectTestCase.java
  
  Index: DirectTestCase.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/direct/DirectTestCase.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DirectTestCase.java       6 Jan 2003 23:42:12 -0000       1.4
  +++ DirectTestCase.java       9 Jan 2003 22:55:27 -0000       1.5
  @@ -7,7 +7,7 @@
    */
   package org.apache.excalibur.altrmi.test.direct;
   
  -import org.apache.excalibur.altrmi.client.impl.ClientClassAltrmiFactory;
  +import org.apache.excalibur.altrmi.client.impl.ClientSideClassFactory;
   import org.apache.excalibur.altrmi.client.impl.direct.DirectHostContext;
   import org.apache.excalibur.altrmi.client.Factory;
   
  @@ -45,7 +45,7 @@
           server.start();
   
           // Client side setup
  -        altrmiFactory = new ClientClassAltrmiFactory(false);
  +        altrmiFactory = new ClientSideClassFactory(false);
           altrmiFactory.setHostContext(new DirectHostContext(server));
           testClient = (TestInterface) altrmiFactory.lookup("Hello");
   
  
  
  
  1.8       +3 -3      
jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/generator/BCELProxyGeneratorTestCase.java
  
  Index: BCELProxyGeneratorTestCase.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/generator/BCELProxyGeneratorTestCase.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- BCELProxyGeneratorTestCase.java   6 Jan 2003 23:42:12 -0000       1.7
  +++ BCELProxyGeneratorTestCase.java   9 Jan 2003 22:55:28 -0000       1.8
  @@ -15,7 +15,7 @@
   
   import org.apache.excalibur.altrmi.client.impl.DefaultProxyHelper;
   import org.apache.excalibur.altrmi.client.impl.direct.DirectHostContext;
  -import org.apache.excalibur.altrmi.client.impl.ClientClassAltrmiFactory;
  +import org.apache.excalibur.altrmi.client.impl.ClientSideClassFactory;
   import org.apache.excalibur.altrmi.common.ProxyGenerator;
   import org.apache.excalibur.altrmi.generator.BCELProxyGeneratorImpl;
   import org.apache.excalibur.altrmi.server.PublicationDescriptionItem;
  @@ -33,7 +33,7 @@
       private ProxyGenerator mProxyGenerator;
       private Class mGeneratedProxyClass;
       private Object mGeneratedProxyObject; 
  -     private ClientClassAltrmiFactory mAltrmiFactory;
  +     private ClientSideClassFactory mAltrmiFactory;
       /************************ TestInterface *******************/
       public  static final Class 
mTestInterfaceClass=//org.apache.excalibur.altrmi.test.TestInterface.class;
                                                        
TestRemoteInterface.class;
  @@ -82,7 +82,7 @@
           _createNewClass();    
           mProxyGenerator.verbose(true);
                //create the factory;
  -             mAltrmiFactory=new ClientClassAltrmiFactory(false);
  +             mAltrmiFactory=new ClientSideClassFactory(false);
       }
       
       
  
  
  
  1.6       +2 -2      
jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/http/CustomHttpServletTestCase.java
  
  Index: CustomHttpServletTestCase.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/http/CustomHttpServletTestCase.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- CustomHttpServletTestCase.java    27 Dec 2002 00:07:27 -0000      1.5
  +++ CustomHttpServletTestCase.java    9 Jan 2003 22:55:28 -0000       1.6
  @@ -7,7 +7,7 @@
    */
   package org.apache.excalibur.altrmi.test.http;
   
  -import org.apache.excalibur.altrmi.client.impl.ClientClassAltrmiFactory;
  +import org.apache.excalibur.altrmi.client.impl.ClientSideClassFactory;
   import org.apache.excalibur.altrmi.client.impl.http.CustomHttpHostContext;
   import org.apache.excalibur.altrmi.server.PublicationDescription;
   import org.apache.excalibur.altrmi.server.impl.http.CustomHttpServlet;
  @@ -92,7 +92,7 @@
           customHttpServlet.getPublisher().publish(testServer, "Hello", pd);
   
           // Client side setup
  -        altrmiFactory = new ClientClassAltrmiFactory(false);
  +        altrmiFactory = new ClientSideClassFactory(false);
           altrmiFactory.setHostContext(new CustomHttpHostContext("127.0.0.1", 
HTTP_PORT), false);
           testClient = (TestInterface) altrmiFactory.lookup("Hello");
   
  
  
  
  1.4       +4 -4      
jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/invalidstate/BouncingServerTestCase.java
  
  Index: BouncingServerTestCase.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/invalidstate/BouncingServerTestCase.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- BouncingServerTestCase.java       5 Jan 2003 23:24:54 -0000       1.3
  +++ BouncingServerTestCase.java       9 Jan 2003 22:55:28 -0000       1.4
  @@ -16,7 +16,7 @@
   import org.apache.excalibur.altrmi.test.TestInterface;
   import org.apache.excalibur.altrmi.test.TestInterface3;
   import org.apache.excalibur.altrmi.test.TestInterface2;
  -import org.apache.excalibur.altrmi.client.impl.ClientClassAltrmiFactory;
  +import org.apache.excalibur.altrmi.client.impl.ClientSideClassFactory;
   import org.apache.excalibur.altrmi.client.impl.NeverConnectionPinger;
   import org.apache.excalibur.altrmi.client.impl.DumbConnectionListener;
   import 
org.apache.excalibur.altrmi.client.impl.socket.SocketCustomStreamHostContext;
  @@ -43,18 +43,18 @@
           // server side setup.
           CompleteSocketCustomStreamServer server = startServer();
   
  -        ClientClassAltrmiFactory altrmiFactory = null;
  +        ClientSideClassFactory altrmiFactory = null;
           try
           {
   
               // Client side setup
  -            altrmiFactory = new ClientClassAltrmiFactory(false);
  +            altrmiFactory = new ClientSideClassFactory(false);
               HostContext hc = new SocketCustomStreamHostContext("127.0.0.1", 
12101);
   
               altrmiFactory.setHostContext(hc, false);
               ClientInvocationHandler ih = hc.getClientInvocationHandler();
               ih.setConnectionPinger(new NeverConnectionPinger());
  -            ih.setAltrmiConnectionListener(new DumbConnectionListener());
  +            ih.setConnectionListener(new DumbConnectionListener());
               TestInterface testClient = (TestInterface) 
altrmiFactory.lookup("Hello");
   
               // just a kludge for unit testing given we are intrinsically 
dealing with
  
  
  
  1.2       +9 -9      
jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/mismatch/SocketMismatchTestCase.java
  
  Index: SocketMismatchTestCase.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/mismatch/SocketMismatchTestCase.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SocketMismatchTestCase.java       5 Jan 2003 10:53:21 -0000       1.1
  +++ SocketMismatchTestCase.java       9 Jan 2003 22:55:28 -0000       1.2
  @@ -16,7 +16,7 @@
   import org.apache.excalibur.altrmi.test.TestInterface;
   import org.apache.excalibur.altrmi.test.TestInterface3;
   import org.apache.excalibur.altrmi.test.TestInterface2;
  -import org.apache.excalibur.altrmi.client.impl.ClientClassAltrmiFactory;
  +import org.apache.excalibur.altrmi.client.impl.ClientSideClassFactory;
   import org.apache.excalibur.altrmi.client.impl.rmi.RmiHostContext;
   import 
org.apache.excalibur.altrmi.client.impl.socket.SocketCustomStreamHostContext;
   import 
org.apache.excalibur.altrmi.client.impl.socket.SocketObjectStreamHostContext;
  @@ -46,12 +46,12 @@
           server.publish(testServer, "Hello", pd);
           server.start();
   
  -        ClientClassAltrmiFactory altrmiFactory = null;
  +        ClientSideClassFactory altrmiFactory = null;
           try
           {
   
               // Client side setup
  -            altrmiFactory = new ClientClassAltrmiFactory(false);
  +            altrmiFactory = new ClientSideClassFactory(false);
               altrmiFactory.setHostContext(new 
SocketObjectStreamHostContext("127.0.0.1", 12001), false);
               TestInterface testClient = (TestInterface) 
altrmiFactory.lookup("Hello");
   
  @@ -96,12 +96,12 @@
           server.publish(testServer, "Hello", pd);
           server.start();
   
  -        ClientClassAltrmiFactory altrmiFactory = null;
  +        ClientSideClassFactory altrmiFactory = null;
           try
           {
   
               // Client side setup
  -            altrmiFactory = new ClientClassAltrmiFactory(false);
  +            altrmiFactory = new ClientSideClassFactory(false);
               altrmiFactory.setHostContext(new 
SocketCustomStreamHostContext("127.0.0.1", 12002), false);
               TestInterface testClient = (TestInterface) 
altrmiFactory.lookup("Hello");
   
  @@ -147,12 +147,12 @@
           server.publish(testServer, "Hello", pd);
           server.start();
   
  -        ClientClassAltrmiFactory altrmiFactory = null;
  +        ClientSideClassFactory altrmiFactory = null;
           try
           {
   
               // Client side setup
  -            altrmiFactory = new ClientClassAltrmiFactory(false);
  +            altrmiFactory = new ClientSideClassFactory(false);
               altrmiFactory.setHostContext(new RmiHostContext("127.0.0.1", 
12003), false);
               TestInterface testClient = (TestInterface) 
altrmiFactory.lookup("Hello");
   
  @@ -197,12 +197,12 @@
           server.publish(testServer, "Hello", pd);
           server.start();
   
  -        ClientClassAltrmiFactory altrmiFactory = null;
  +        ClientSideClassFactory altrmiFactory = null;
           try
           {
   
               // Client side setup
  -            altrmiFactory = new ClientClassAltrmiFactory(false);
  +            altrmiFactory = new ClientSideClassFactory(false);
               altrmiFactory.setHostContext(new 
SocketCustomStreamHostContext("127.0.0.1", 12004), false);
               TestInterface testClient = (TestInterface) 
altrmiFactory.lookup("Hello");
   
  
  
  
  1.5       +2 -2      
jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/piped/PipedCustomStreamTestCase.java
  
  Index: PipedCustomStreamTestCase.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/piped/PipedCustomStreamTestCase.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PipedCustomStreamTestCase.java    6 Jan 2003 23:42:12 -0000       1.4
  +++ PipedCustomStreamTestCase.java    9 Jan 2003 22:55:28 -0000       1.5
  @@ -7,7 +7,7 @@
    */
   package org.apache.excalibur.altrmi.test.piped;
   
  -import org.apache.excalibur.altrmi.client.impl.ClientClassAltrmiFactory;
  +import org.apache.excalibur.altrmi.client.impl.ClientSideClassFactory;
   import 
org.apache.excalibur.altrmi.client.impl.piped.PipedCustomStreamHostContext;
   import org.apache.excalibur.altrmi.client.Factory;
   
  @@ -53,7 +53,7 @@
           ((PipedCustomStreamServer) server).makeNewConnection(in, out);
   
           // Client side setup
  -        altrmiFactory = new ClientClassAltrmiFactory(false);
  +        altrmiFactory = new ClientSideClassFactory(false);
           altrmiFactory.setHostContext(new PipedCustomStreamHostContext(in, 
out));
           testClient = (TestInterface) altrmiFactory.lookup("Hello");
   
  
  
  
  1.6       +2 -2      
jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/piped/PipedObjectStreamTestCase.java
  
  Index: PipedObjectStreamTestCase.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/piped/PipedObjectStreamTestCase.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- PipedObjectStreamTestCase.java    6 Jan 2003 23:42:12 -0000       1.5
  +++ PipedObjectStreamTestCase.java    9 Jan 2003 22:55:28 -0000       1.6
  @@ -7,7 +7,7 @@
    */
   package org.apache.excalibur.altrmi.test.piped;
   
  -import org.apache.excalibur.altrmi.client.impl.ClientClassAltrmiFactory;
  +import org.apache.excalibur.altrmi.client.impl.ClientSideClassFactory;
   import 
org.apache.excalibur.altrmi.client.impl.piped.PipedObjectStreamHostContext;
   import org.apache.excalibur.altrmi.client.Factory;
   
  @@ -61,7 +61,7 @@
           ((PipedObjectStreamServer) server).makeNewConnection(in, out);
   
           // Client side setup
  -        altrmiFactory = new ClientClassAltrmiFactory(false);
  +        altrmiFactory = new ClientSideClassFactory(false);
           altrmiFactory.setHostContext(new PipedObjectStreamHostContext(in, 
out));
           testClient = (TestInterface) altrmiFactory.lookup("Hello");
   
  
  
  
  1.6       +2 -2      
jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/rmi/RmiTestCase.java
  
  Index: RmiTestCase.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/rmi/RmiTestCase.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- RmiTestCase.java  6 Jan 2003 23:42:13 -0000       1.5
  +++ RmiTestCase.java  9 Jan 2003 22:55:28 -0000       1.6
  @@ -7,7 +7,7 @@
    */
   package org.apache.excalibur.altrmi.test.rmi;
   
  -import org.apache.excalibur.altrmi.client.impl.ClientClassAltrmiFactory;
  +import org.apache.excalibur.altrmi.client.impl.ClientSideClassFactory;
   import org.apache.excalibur.altrmi.client.impl.rmi.RmiHostContext;
   import org.apache.excalibur.altrmi.client.Factory;
   
  @@ -58,7 +58,7 @@
           server.start();
   
           // Client side setup
  -        Factory af = new ClientClassAltrmiFactory(false);
  +        Factory af = new ClientSideClassFactory(false);
           af.setHostContext(new RmiHostContext( "127.0.0.1", 10003 ));
           testClient = (TestInterface) af.lookup("Hello");
   
  
  
  
  1.6       +2 -2      
jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/socket/CallbackEnabledCustomStreamTestCase.java
  
  Index: CallbackEnabledCustomStreamTestCase.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/socket/CallbackEnabledCustomStreamTestCase.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- CallbackEnabledCustomStreamTestCase.java  13 Oct 2002 11:54:28 -0000      
1.5
  +++ CallbackEnabledCustomStreamTestCase.java  9 Jan 2003 22:55:28 -0000       
1.6
  @@ -7,7 +7,7 @@
    */
   package org.apache.excalibur.altrmi.test.socket;
   
  -import org.apache.excalibur.altrmi.client.impl.ClientClassAltrmiFactory;
  +import org.apache.excalibur.altrmi.client.impl.ClientSideClassFactory;
   import 
org.apache.excalibur.altrmi.client.impl.callback.socket.CallbackEnabledSocketCustomStreamHostContext;
   
   import org.apache.excalibur.altrmi.test.TestInterface;
  @@ -46,7 +46,7 @@
           server.start();
   
           // Client side setup
  -        altrmiFactory = new ClientClassAltrmiFactory(false);
  +        altrmiFactory = new ClientSideClassFactory(false);
           altrmiFactory.setHostContext(
                   new 
CallbackEnabledSocketCustomStreamHostContext("127.0.0.1", 10004), false);
           testClient = (TestInterface) altrmiFactory.lookup("Hello");
  
  
  
  1.6       +1 -1      
jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/socket/CustomStreamJNDITestCase.java
  
  Index: CustomStreamJNDITestCase.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/socket/CustomStreamJNDITestCase.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- CustomStreamJNDITestCase.java     13 Oct 2002 11:54:28 -0000      1.5
  +++ CustomStreamJNDITestCase.java     9 Jan 2003 22:55:28 -0000       1.6
  @@ -52,7 +52,7 @@
   
           env.put(
               Context.INITIAL_CONTEXT_FACTORY,
  -            
"org.apache.excalibur.altrmi.client.impl.naming.DefaultAltrmiInitialContextFactory"
 );
  +            
"org.apache.excalibur.altrmi.client.impl.naming.DefaultInitialContextFactory" );
           env.put( Context.PROVIDER_URL, 
"altrmi://localhost:10006/SocketCustomStream" );
           env.put( "proxy.type", "ClientSideClasses" );
           env.put( "bean.type", "NotBeanOnly" );
  
  
  
  1.2       +2 -2      
jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/socket/CustomStreamOptmizedTestCase.java
  
  Index: CustomStreamOptmizedTestCase.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/socket/CustomStreamOptmizedTestCase.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CustomStreamOptmizedTestCase.java 13 Oct 2002 11:54:28 -0000      1.1
  +++ CustomStreamOptmizedTestCase.java 9 Jan 2003 22:55:28 -0000       1.2
  @@ -8,7 +8,7 @@
   package org.apache.excalibur.altrmi.test.socket;
   
   import 
org.apache.excalibur.altrmi.client.impl.socket.SocketCustomStreamHostContext;
  -import org.apache.excalibur.altrmi.client.impl.ClientClassAltrmiFactory;
  +import org.apache.excalibur.altrmi.client.impl.ClientSideClassFactory;
   
   import 
org.apache.excalibur.altrmi.server.impl.socket.CompleteSocketCustomStreamServer;
   import org.apache.excalibur.altrmi.server.PublicationDescription;
  @@ -44,7 +44,7 @@
           server.start();
   
           // Client side setup
  -        altrmiFactory = new ClientClassAltrmiFactory(false);
  +        altrmiFactory = new ClientSideClassFactory(false);
           altrmiFactory.setHostContext(new 
SocketCustomStreamHostContext("127.0.0.1", 10001), true);
           testClient = (TestInterface) altrmiFactory.lookup("Hello");
   
  
  
  
  1.7       +2 -2      
jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/socket/CustomStreamTestCase.java
  
  Index: CustomStreamTestCase.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/socket/CustomStreamTestCase.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- CustomStreamTestCase.java 6 Jan 2003 23:42:13 -0000       1.6
  +++ CustomStreamTestCase.java 9 Jan 2003 22:55:28 -0000       1.7
  @@ -8,7 +8,7 @@
   package org.apache.excalibur.altrmi.test.socket;
   
   import 
org.apache.excalibur.altrmi.client.impl.socket.SocketCustomStreamHostContext;
  -import org.apache.excalibur.altrmi.client.impl.ClientClassAltrmiFactory;
  +import org.apache.excalibur.altrmi.client.impl.ClientSideClassFactory;
   import org.apache.excalibur.altrmi.client.Factory;
   
   import 
org.apache.excalibur.altrmi.server.impl.socket.CompleteSocketCustomStreamServer;
  @@ -45,7 +45,7 @@
           server.start();
   
           // Client side setup
  -        altrmiFactory = new ClientClassAltrmiFactory(false);
  +        altrmiFactory = new ClientSideClassFactory(false);
           altrmiFactory.setHostContext(new 
SocketCustomStreamHostContext("127.0.0.1", 10001), false);
           testClient = (TestInterface) altrmiFactory.lookup("Hello");
   
  
  
  
  1.6       +2 -2      
jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/socket/JSXObjectStreamTestCase.java
  
  Index: JSXObjectStreamTestCase.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/socket/JSXObjectStreamTestCase.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- JSXObjectStreamTestCase.java      6 Jan 2003 23:42:13 -0000       1.5
  +++ JSXObjectStreamTestCase.java      9 Jan 2003 22:55:28 -0000       1.6
  @@ -8,7 +8,7 @@
   package org.apache.excalibur.altrmi.test.socket;
   
   import 
org.apache.excalibur.altrmi.client.impl.socket.SocketObjectStreamHostContext;
  -import org.apache.excalibur.altrmi.client.impl.ClientClassAltrmiFactory;
  +import org.apache.excalibur.altrmi.client.impl.ClientSideClassFactory;
   import org.apache.excalibur.altrmi.client.Factory;
   
   import 
org.apache.excalibur.altrmi.server.impl.socket.CompleteSocketObjectStreamServer;
  @@ -46,7 +46,7 @@
           server.start();
   
           // Client side setup
  -        altrmiFactory = new ClientClassAltrmiFactory(false);
  +        altrmiFactory = new ClientSideClassFactory(false);
           altrmiFactory.setHostContext(
                   new SocketObjectStreamHostContext("127.0.0.1", 10009, 
"JSX.ObjIn", "JSX.ObjOut"), false);
           testClient = (TestInterface) altrmiFactory.lookup("Hello");
  
  
  
  1.7       +2 -2      
jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/socket/ObjectStreamTestCase.java
  
  Index: ObjectStreamTestCase.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/socket/ObjectStreamTestCase.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ObjectStreamTestCase.java 6 Jan 2003 23:42:13 -0000       1.6
  +++ ObjectStreamTestCase.java 9 Jan 2003 22:55:28 -0000       1.7
  @@ -8,7 +8,7 @@
   package org.apache.excalibur.altrmi.test.socket;
   
   import 
org.apache.excalibur.altrmi.client.impl.socket.SocketObjectStreamHostContext;
  -import org.apache.excalibur.altrmi.client.impl.ClientClassAltrmiFactory;
  +import org.apache.excalibur.altrmi.client.impl.ClientSideClassFactory;
   import org.apache.excalibur.altrmi.client.Factory;
   
   import 
org.apache.excalibur.altrmi.server.impl.socket.CompleteSocketObjectStreamServer;
  @@ -53,7 +53,7 @@
           server.start();
   
           // Client side setup
  -        altrmiFactory = new ClientClassAltrmiFactory(false);
  +        altrmiFactory = new ClientSideClassFactory(false);
           altrmiFactory.setHostContext(new 
SocketObjectStreamHostContext("127.0.0.1", 10002), false);
           testClient = (TestInterface) altrmiFactory.lookup("Hello");
   
  
  
  
  1.4       +2 -2      
jakarta-avalon-excalibur/altrmi/src/xdocs/client-usage.xml
  
  Index: client-usage.xml
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/xdocs/client-usage.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- client-usage.xml  7 Jan 2003 23:27:25 -0000       1.3
  +++ client-usage.xml  9 Jan 2003 22:55:28 -0000       1.4
  @@ -23,7 +23,7 @@
   Hashtable env = new Hashtable();
   env.put(
       Context.INITIAL_CONTEXT_FACTORY,
  -    
"org.apache.excalibur.altrmi.client.impl.naming.DefaultAltrmiInitialContextFactory");
  +    
"org.apache.excalibur.altrmi.client.impl.naming.DefaultInitialContextFactory");
   env.put(Context.PROVIDER_URL, "altrmi://somehost:1235/SocketCustomStream");
   Context ctx = new InitialContext(env);
   TestInterface ti = (TestInterface) ctx.lookup("Hello");
  
  
  
  1.1                  
jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/AbstractFactory.java
  
  Index: AbstractFactory.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.excalibur.altrmi.client.impl;
  
  import java.io.IOException;
  import java.lang.ref.WeakReference;
  import java.util.HashMap;
  import java.rmi.server.UID;
  
  
  import org.apache.excalibur.altrmi.client.Factory;
  import org.apache.excalibur.altrmi.client.HostContext;
  import org.apache.excalibur.altrmi.client.Proxy;
  import org.apache.excalibur.altrmi.client.ClientInvocationHandler;
  import org.apache.excalibur.altrmi.common.OpenConnectionRequest;
  import org.apache.excalibur.altrmi.common.SameVMReply;
  import org.apache.excalibur.altrmi.common.Reply;
  import org.apache.excalibur.altrmi.common.NotPublishedReply;
  import org.apache.excalibur.altrmi.common.ReplyConstants;
  import org.apache.excalibur.altrmi.common.LookupRequest;
  import org.apache.excalibur.altrmi.common.ConnectionException;
  import org.apache.excalibur.altrmi.common.Authentication;
  import org.apache.excalibur.altrmi.common.ExceptionReply;
  import org.apache.excalibur.altrmi.common.LookupReply;
  import org.apache.excalibur.altrmi.common.ListReply;
  import org.apache.excalibur.altrmi.common.ListRequest;
  import org.apache.excalibur.altrmi.common.FacadeRefHolder;
  import org.apache.excalibur.altrmi.common.OpenConnectionReply;
  
  
  /**
   * Class AbstractFactory
   *
   *
   * @author Paul Hammant <a href="mailto:[EMAIL PROTECTED]">[EMAIL 
PROTECTED]</a>
   * @author Peter Royal <a href="mailto:[EMAIL PROTECTED]">[EMAIL 
PROTECTED]</a>
   * @version $Revision: 1.1 $
   */
  public abstract class AbstractFactory implements Factory
  {
  
      private static final UID U_ID = new UID((short)20729);
      protected AbstractHostContext m_hostContext;
      protected ClientInvocationHandler m_clientInvocationHandler;
      protected final HashMap m_refObjs = new HashMap();
      private final boolean m_beanOnly;
      private transient String m_textToSign;
      protected Long m_session;
  
      /**
       * Constructor AbstractFactory
       *
       *
       * @param beanOnly
       *
       */
      public AbstractFactory( boolean beanOnly )
      {
          m_beanOnly = beanOnly;
      }
  
      /**
       * Method isBeanOnly
       *
       *
       * @return
       *
       */
      public final boolean isBeanOnly()
      {
          return m_beanOnly;
      }
  
      /**
       * Set the HostContext (defauts to optimize = true)
       * @param hostContext the host context
       * @throws ConnectionException if a problem
       */
      public void setHostContext(HostContext hostContext) throws 
ConnectionException {
          setHostContext(hostContext, true);
      }
  
      /**
       * Set the host context
       * @param hostContext the host context
       * @param allowOptimize allow optimization
       * @throws ConnectionException if a problem
       */
      public void setHostContext( HostContext hostContext, boolean 
allowOptimize ) throws ConnectionException
      {
          if( m_hostContext == null )
          {
              m_hostContext = (AbstractHostContext) hostContext;
              m_clientInvocationHandler = 
m_hostContext.getClientInvocationHandler();
          }
  
          ( (AbstractClientInvocationHandler) m_clientInvocationHandler 
).initialize();
  
          UID machineID = allowOptimize ? U_ID : null;
  
          if(!(m_hostContext instanceof AbstractSameVmBindableHostContext))
          {
              machineID = null;
          }
  
          Reply reply =
              m_clientInvocationHandler.handleInvocation(new 
OpenConnectionRequest( machineID ) );
  
          if( reply instanceof SameVMReply )
          {
              if (m_hostContext instanceof AbstractSameVmBindableHostContext)
              {
                  AbstractSameVmBindableHostContext sameVmBindableHostContext =
                          (AbstractSameVmBindableHostContext) m_hostContext;
                  HostContext hContext = 
sameVmBindableHostContext.makeSameVmHostContext();
                  if (hContext == null)
                  {
                      // Registry not found, or a different instance to the one
                      // the server placed its piped instance in.
                      // revert to non optimized.
                      reply = m_clientInvocationHandler.handleInvocation(
                              new OpenConnectionRequest( null ) );
                  }
                  else
                  {
                      m_clientInvocationHandler = 
m_hostContext.getClientInvocationHandler();
                      reply = m_clientInvocationHandler.handleInvocation(new 
OpenConnectionRequest() );
                  }
              }
              else
              {
                  throw new ConnectionException("SameVM instruction for non 
rebindable host context.");
              }
          }
  
          if( reply instanceof OpenConnectionReply )
          {
              m_textToSign = ( (OpenConnectionReply) reply ).getTextToSign();
              m_session = ( (OpenConnectionReply) reply ).getSession();
          }
  
          else
          {
  
              throw new ConnectionException("Setting of host context blocked 
for reasons of unknown, server-side reply: (" +
                      reply.getClass().getName() + ")");
          }
      }
  
      /**
       * Method lookup
       *
       *
       * @param publishedServiceName
       * @param altrmiAuthentication
       *
       * @return
       *
       * @throws ConnectionException
       *
       */
      public Object lookup( String publishedServiceName, Authentication 
altrmiAuthentication )
          throws ConnectionException
      {
  
          Reply ar =
              m_clientInvocationHandler.handleInvocation( new LookupRequest( 
publishedServiceName, altrmiAuthentication,
                                                    m_session ) );
  
          if( ar.getReplyCode() >= ReplyConstants.PROBLEMREPLY )
          {
              if( ar instanceof NotPublishedReply )
              {
                  throw new ConnectionException( "Service " + 
publishedServiceName
                                                       + " not published" );
              }
              else if( ar instanceof ExceptionReply )
              {
                  ExceptionReply er = (ExceptionReply)ar;
  
                  throw (ConnectionException)er.getReplyException();
              }
              else
              {
                  throw new ConnectionException( "Problem doing lookup on 
service" );
              }
          }
          else if( ar instanceof ExceptionReply )
          {
              ExceptionReply er = (ExceptionReply)ar;
              Throwable t = er.getReplyException();
  
              if( t instanceof ConnectionException )
              {
                  throw (ConnectionException)t;
              }
              else if( t instanceof Error )
              {
                  throw (Error)t;
              }
              else if( t instanceof RuntimeException )
              {
                  throw (RuntimeException)t;
              }
              else
              {
                  throw new ConnectionException( "Problem doing lookup on 
service [exception: "
                                                       + t.getMessage() + "]" );
              }
          }
          else if( !( ar instanceof LookupReply ) )
          {
              throw new UnsupportedOperationException( "Unexpected reply to 
lookup [reply: " + ar
                                                       + "]" );
          }
  
          LookupReply lr = (LookupReply)ar;
          DefaultProxyHelper baseObj = new DefaultProxyHelper( this,
                                                               
m_clientInvocationHandler,
                                                               
publishedServiceName, "Main",
                                                               
lr.getReferenceID(), m_session );
          Object retVal = getInstance( publishedServiceName, "Main", baseObj, 
isBeanOnly() );
  
          baseObj.registerImplObject( retVal );
  
          return retVal;
      }
  
      protected abstract Class getFacadeClass(
          String publishedServiceName, String objectName, boolean beanOnly )
          throws ConnectionException, ClassNotFoundException;
  
      protected abstract Object getInstance(
          String publishedServiceName, String objectName, DefaultProxyHelper 
proxyHelper,
          boolean beanOnly ) throws ConnectionException;
  
      /**
       * Method registerReferenceObject
       *
       *
       *
       * @param obj
       * @param referenceID
       *
       *
       *
       */
      public final void registerReferenceObject( Object obj, Long referenceID )
      {
  
          synchronized( this )
          {
              m_refObjs.put( referenceID, new WeakReference( obj ) );
          }
  
          //Object o = m_refObjs.get(referenceID);
      }
  
      /**
       * Method getReferenceID
       *
       *
       * @param obj
       *
       * @return
       *
       */
      public final Long getReferenceID( Proxy obj )
      {
          return obj.altrmiGetReferenceID( this );
      }
  
      /**
       * Method getImplObj
       *
       *
       * @param referenceID
       *
       * @return
       *
       */
      public final Object getImplObj( Long referenceID )
      {
  
          WeakReference wr = null;
  
          synchronized( this )
          {
              wr = (WeakReference)m_refObjs.get( referenceID );
          }
  
          if( wr == null )
          {
              return null;
          }
  
          Object obj = wr.get();
  
          if( obj == null )
          {
              m_refObjs.remove( referenceID );
          }
  
          return obj;
      }
  
      /**
       * Method lookup
       *
       *
       * @param publishedServiceName
       *
       * @return
       *
       * @throws ConnectionException
       *
       */
      public final Object lookup( String publishedServiceName ) throws 
ConnectionException
      {
          return lookup( publishedServiceName, null );
      }
  
      /**
       * Method getTextToSignForAuthentication
       *
       *
       * @return
       *
       */
      public String getTextToSignForAuthentication()
      {
          return m_textToSign;
      }
  
      /**
       *  Method list
       */
      public String[] list()
      {
  
          Reply ar = m_clientInvocationHandler.handleInvocation( new 
ListRequest() );
  
          if( ar instanceof ListReply )
          {
              return ( (ListReply)ar ).getListOfPublishedObjects();
          }
          else
          {
              return new String[]
              {
              };
          }
      }
  
  
      /**
       * Wraps the reference to the remote obj within the FacadeRefHolder obj.
       * @param obj
       * @param objectName
       * @return
       */
      private FacadeRefHolder makeFacadeRefHolder( Proxy obj, String objectName 
)
      {
  
          Long refID = getReferenceID( obj );
  
          return new FacadeRefHolder( refID, objectName );
      }
  
  
  
  
      public void marshallCorrection( String methodSignature, Object[] args, 
Class[] argClasses )
      {
  
          for( int i = 0; i < args.length; i++ )
          {
              Class argClass = argClasses[ i ];
              if(argClass==null)
                  continue;
              //All remote references implement Proxy interface
              if(args[i] instanceof Proxy)
              {
                  Proxy proxy = (Proxy)args[i];
  
                      if( getReferenceID( proxy ) != null )
                      {
                          //The stripping "AltrmiGenerated2" from the proxy 
names generated by
                          //ProxyGenerator's:- "AltrmiGenerated2".length()=16
                          String objName = 
args[i].getClass().getName().substring( 16 );
  
                          args[i]= makeFacadeRefHolder( proxy, objName );
                      }
              }
              else // Let the specific InvocationHandlers be given the last 
chance to modify the arguments.
              {
                  args[i] = 
m_clientInvocationHandler.resolveArgument(methodSignature,argClasses[i],args[i]);
              }
          }
      }
  
  }
  
  
  
  1.1                  
jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/ClientSideClassFactory.java
  
  Index: ClientSideClassFactory.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.excalibur.altrmi.client.impl;
  
  import java.lang.reflect.Constructor;
  import java.lang.reflect.InvocationTargetException;
  import org.apache.excalibur.altrmi.common.ConnectionException;
  
  /**
   * Class ClientSideClassFactory
   *
   *
   * @author Paul Hammant
   * @version $Revision: 1.1 $
   */
  public class ClientSideClassFactory extends AbstractFactory
  {
  
      /**
       * Constructor ClientSideClassFactory
       *
       *
       * @param beanOnly
       *
       */
      public ClientSideClassFactory( boolean beanOnly )
      {
          super( beanOnly );
      }
  
      protected Class getFacadeClass(
          String publishedServiceName, String objectName, boolean beanOnly )
          throws ConnectionException, ClassNotFoundException
      {
  
          String code = "2";
  
          if( beanOnly )
          {
              code = "";
          }
  
          String className = "AltrmiGenerated" + code + publishedServiceName + 
"_" + objectName;
  
          try {
              return 
Thread.currentThread().getContextClassLoader().loadClass(className);
          } catch (ClassNotFoundException e) {
              return this.getClass().getClassLoader().loadClass(className);
          }
      }
  
      /**
       * Method getInstance
       *
       *
       * @param publishedServiceName
       * @param objectName
       *
       * @return
       *
       * @throws ConnectionException
       *
       */
      protected Object getInstance(
          String publishedServiceName, String objectName, DefaultProxyHelper 
proxyHelper, boolean beanOnly )
          throws ConnectionException
      {
  
          try
          {
              Class clazz = getFacadeClass( publishedServiceName, objectName, 
beanOnly );
              Constructor[] constructors = clazz.getConstructors();
              Object retVal = constructors[ 0 ].newInstance( new 
Object[]{proxyHelper} );
  
              return retVal;
          }
          catch( InvocationTargetException ite )
          {
              throw new ConnectionException( "Generated class not instantiated 
: "
                                                   + 
ite.getTargetException().getMessage() );
          }
          catch( ClassNotFoundException cnfe )
          {
              throw new ConnectionException( "Generated class not found during 
lookup : "
                                                   + cnfe.getMessage() );
          }
          catch( InstantiationException ie )
          {
              throw new ConnectionException(
                  "Generated class not instantiable during lookup : " + 
ie.getMessage() );
          }
          catch( IllegalAccessException iae )
          {
              throw new ConnectionException(
                  "Illegal access to generated class during lookup : " + 
iae.getMessage() );
          }
      }
  
      /**
       * Method close
       *
       *
       */
      public void close()
      {
          m_hostContext.getClientInvocationHandler().close();
      }
  }
  
  
  
  1.1                  
jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/DynamicClassFactory.java
  
  Index: DynamicClassFactory.java
  ===================================================================
  /*
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999-2002 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Avalon", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   * 
   */
   
  package org.apache.excalibur.altrmi.client.impl;
  
  import org.apache.excalibur.altrmi.common.ConnectionException;
  
  /**
   * DynamicClassFactory creates stubs(@see DynamicStub) for the given
   *  publishedName at the time of invocation.Using this factory removes the 
need 
   * for any compiled stubs corresponding to the remote interface 
   * to be present on the client side to invoke any remote method on the server.
   *
   * @author <a href="mailto:[EMAIL PROTECTED]">Vinay Chandran</a>
   */
  public class DynamicClassFactory extends AbstractFactory
  {
      
      //-------Constructors---------//
      /**
       * Constructor DynamicClassFactory
       * @param beanOnly
       */
      public DynamicClassFactory(boolean beanOnly)
      {
          super(beanOnly);
      }
  
      //-------AbstractFactory Overrides------//
      /**
       * @see 
org.apache.excalibur.altrmi.client.impl.AbstractFactory#getFacadeClass(String, 
String, boolean)
       */
      protected Class getFacadeClass(
          String publishedServiceName,
          String objectName,
          boolean beanOnly)
          throws ConnectionException, ClassNotFoundException
      {
          //NOT USED
          return null;
      }
  
      /**
       * @see 
org.apache.excalibur.altrmi.client.impl.AbstractFactory#getInstance(String, 
String, DefaultProxyHelper, boolean)
       */
      protected Object getInstance(
          String publishedServiceName,
          String objectName,
          DefaultProxyHelper proxyHelper,
          boolean beanOnly)
          throws ConnectionException
      {
          return new DynamicStub(publishedServiceName,objectName,proxyHelper);
      }
  
      
      /**
       * @see org.apache.excalibur.altrmi.client.InterfaceLookup#close()
       */
  
      public void close()
      {
          m_hostContext.getClientInvocationHandler().close();
      }
  }
  
  
  
  1.1                  
jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/ServerSideClassFactory.java
  
  Index: ServerSideClassFactory.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.excalibur.altrmi.client.impl;
  
  import java.lang.reflect.Constructor;
  import java.lang.reflect.InvocationTargetException;
  import java.util.HashMap;
  import org.apache.excalibur.altrmi.common.ConnectionException;
  import org.apache.excalibur.altrmi.common.Reply;
  import org.apache.excalibur.altrmi.common.ClassReply;
  import org.apache.excalibur.altrmi.common.ClassRequest;
  import org.apache.excalibur.altrmi.common.ClassRetrievalFailedReply;
  import org.apache.excalibur.altrmi.common.NotPublishedException;
  import org.apache.excalibur.altrmi.common.RequestFailedReply;
  import org.apache.excalibur.altrmi.common.ReplyConstants;
  
  /**
   * Class ServerSideClassFactory
   *
   *
   * @author Paul Hammant
   * @version $Revision: 1.1 $
   */
  public class ServerSideClassFactory extends AbstractFactory
  {
  
      private HashMap m_publishedServiceClassLoaders = new HashMap();
  
      /**
       * Constructor ServerSideClassFactory
       *
       *
       * @param beanOnly
       *
       */
      public ServerSideClassFactory( boolean beanOnly )
      {
          super( beanOnly );
      }
  
      protected Class getFacadeClass(
          String publishedServiceName, String objectName, boolean beanOnly )
          throws ConnectionException, ClassNotFoundException
      {
  
          String code = "2";
  
          if( beanOnly )
          {
              code = "";
          }
  
          TransportedClassLoader tcl = null;
          String beanClassName = "AltrmiGenerated" + publishedServiceName + "_" 
+ objectName;
          String iiClassName = "AltrmiGenerated2" + publishedServiceName + "_" 
+ objectName;
          String className = "AltrmiGenerated" + code + publishedServiceName + 
"_" + objectName;
  
          if( m_publishedServiceClassLoaders.containsKey( beanClassName ) )
          {
              tcl = (TransportedClassLoader)m_publishedServiceClassLoaders.get( 
beanClassName );
          }
          else
          {
              ClassReply cr = null;
  
              try
              {
                  Reply ar =
                      m_hostContext.getClientInvocationHandler()
                      .handleInvocation( new ClassRequest( 
publishedServiceName, objectName ) );
  
                  if( ar.getReplyCode() >= ReplyConstants.PROBLEMREPLY )
                  {
                      if( ar instanceof RequestFailedReply )
                      {
                          throw new ConnectionException( ( 
(RequestFailedReply)ar )
                                                               
.getFailureReason() );
                      }
                      else if( ar instanceof ClassRetrievalFailedReply )
                      {
                          ClassRetrievalFailedReply crfr = 
(ClassRetrievalFailedReply)ar;
  
                          throw new ConnectionException( "Class Retrieval 
Failed - "
                                                               + 
crfr.getReason() );
                      }    //TODO others.
                  }
  
                  cr = (ClassReply)ar;
              }
              catch( NotPublishedException npe )
              {
                  throw new ConnectionException( "Service " + 
publishedServiceName
                                                       + " not published on 
Server" );
              }
  
              tcl = new TransportedClassLoader( 
m_hostContext.getClientInvocationHandler()
                                                .getInterfacesClassLoader() );
  
              tcl.add( beanClassName, cr.getBeanClassBytes() );
  
              try
              {
                  byte[] bytes = cr.getInterfaceImplClassBytes();
  
                  tcl.add( iiClassName, bytes );
              }
              catch( NoClassDefFoundError ncdfe )
              {
  
                  // do nothing.  It's a fundamental error to have no interfaces
                  // on theclient side.  This is a development issue or the user
                  // is poking with a smart tool like beanshell which can use
                  // introspection to invoke methods.
              }
  
              m_publishedServiceClassLoaders.put( beanClassName, tcl );
          }
  
          return tcl.loadClass( className );
      }
  
      protected Object getInstance(
          String publishedServiceName, String objectName, DefaultProxyHelper 
proxyHelper, boolean beanOnly )
          throws ConnectionException
      {
  
          String code = "2";
  
          if( beanOnly )
          {
              code = "";
          }
  
          try
          {
              Class clazz = getFacadeClass( publishedServiceName, objectName, 
beanOnly );
              Constructor[] constructors = clazz.getConstructors();
              Object retVal = constructors[ 0 ].newInstance( new 
Object[]{proxyHelper} );
  
              return retVal;
          }
          catch( InvocationTargetException ite )
          {
              throw new ConnectionException(
                  "Generated class not instantiated.", ite.getTargetException() 
);
          }
          catch( ClassNotFoundException cnfe )
          {
              throw new ConnectionException(
                  "Generated class not found during lookup.", cnfe );
          }
          catch( InstantiationException ie )
          {
              throw new ConnectionException(
                  "Generated class not instantiable during lookup.", ie );
          }
          catch( IllegalAccessException iae )
          {
              throw new ConnectionException(
                  "Illegal access to generated class during lookup.", iae );
          }
      }
  
      /**
       * Method close
       *
       *
       */
      public void close()
      {
          m_hostContext.getClientInvocationHandler().close();
      }
  }
  
  
  
  1.1                  
jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/naming/DefaultContext.java
  
  Index: DefaultContext.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.excalibur.altrmi.client.impl.naming;
  
  import java.util.Hashtable;
  import javax.naming.Context;
  import javax.naming.Name;
  import javax.naming.NameParser;
  import javax.naming.NamingEnumeration;
  import javax.naming.NamingException;
  import org.apache.excalibur.altrmi.client.InterfaceLookup;
  import org.apache.excalibur.altrmi.client.InterfaceLookupFactory;
  import org.apache.excalibur.altrmi.client.impl.DefaultInterfaceLookupFactory;
  import org.apache.excalibur.altrmi.common.ConnectionException;
  
  /**
   * Class DefaultContext
   *
   *
   * @author Vinay Chandrasekharan <a href="mailto:[EMAIL PROTECTED]">[EMAIL 
PROTECTED]</a>
   * @author Paul Hammant
   * @version $Revision: 1.1 $
   */
  public class DefaultContext implements Context
  {
  
      InterfaceLookupFactory m_altrmiInterfaceLookupFactory =
          new DefaultInterfaceLookupFactory();
      InterfaceLookup m_altrmiInterfaceLookup = null;
  
      /**
       * Constructor DefaultContext
       *
       *
       * @param host
       * @param port
       * @param transportStream
       * @param env
       *
       * @throws NamingException
       *
       */
      DefaultContext( String host, String port, String transportStream, 
Hashtable env )
          throws NamingException
      {
  
          String proxyDetails = null;
          String beanDetails = null;
          ClassLoader interfacesClassLoader = null;
          boolean optimize;
  
          proxyDetails = (String)env.get( "proxy.type" );
  
          {
              if( proxyDetails == null )
              {
                  proxyDetails = "S";
              }
              else if( proxyDetails.equals( "ClientSideClasses" ) )
              {
                  proxyDetails = "C";
              }
              else if( proxyDetails.equals( "ServerSideClasses" ) )
              {
                  proxyDetails = "S";
              }
              else
              {
                  throw new NamingException(
                      "proxy.type should be 'ClientSideClasses' or 
'ServerSideClasses', you specified "
                      + proxyDetails );
              }
          }
  
          beanDetails = (String)env.get( "bean.type" );
  
          {
              if( beanDetails == null )
              {
                  beanDetails = "NBO";
              }
              else if( beanDetails.equals( "NotBeanOnly" ) )
              {
                  beanDetails = "NBO";
              }
              else if( beanDetails.equals( "BeanOnly" ) )
              {
                  beanDetails = "BO";
              }
              else
              {
                  throw new NamingException(
                      "proxy.type should be 'BeanOnly' or 'NotBeanOnly', you 
specified " + beanDetails );
              }
          }
  
          String optimizeStr = (String)env.get( "optimize" );
  
          {
              if( optimizeStr == null )
              {
                  optimize = true;
              }
              else if( optimizeStr.equals( "true" ) )
              {
                  optimize = true;
              }
              else if( optimizeStr.equals( "false" ) )
              {
                  optimize = false;
              }
              else
              {
                  throw new NamingException(
                      "optimize should be 'true' or 'false', you specified " + 
optimizeStr );
              }
          }
  
  
          {
              interfacesClassLoader = (ClassLoader)env.get( 
"interfaces.classloader" );
  
              if( interfacesClassLoader == null )
              {
                  interfacesClassLoader = this.getClass().getClassLoader();
              }
  
              try
              {
  
                  m_altrmiInterfaceLookup =
                      m_altrmiInterfaceLookupFactory
                      .getInterfaceLookup( transportStream + ":" + host + ":" + 
port + ":"
                                                 + proxyDetails + ":"
                                                 + beanDetails, 
interfacesClassLoader, optimize );
              }
              catch( ConnectionException ace )
              {
                  ace.printStackTrace();
  
                  throw new NamingException( ace.getMessage() );
              }
          }
      }
  
      /**
       * Method lookup
       *
       *
       * @param name
       *
       * @return
       *
       * @throws NamingException
       *
       */
      public Object lookup( Name name ) throws NamingException
      {
          return null;
      }
  
      /**
       * Method lookup
       *
       *
       * @param name
       *
       * @return
       *
       * @throws NamingException
       *
       */
      public Object lookup( String name ) throws NamingException
      {
  
          try
          {
              return m_altrmiInterfaceLookup.lookup( name );
          }
          catch( ConnectionException ace )
          {
              ace.printStackTrace();
  
              throw new NamingException( ace.getMessage() );
          }
      }
  
      /**
       * Method bind
       *
       *
       * @param name
       * @param obj
       *
       * @throws NamingException
       *
       */
      public void bind( Name name, Object obj ) throws NamingException
      {
      }
  
      /**
       * Method bind
       *
       *
       * @param name
       * @param obj
       *
       * @throws NamingException
       *
       */
      public void bind( String name, Object obj ) throws NamingException
      {
      }
  
      /**
       * Method rebind
       *
       *
       * @param name
       * @param obj
       *
       * @throws NamingException
       *
       */
      public void rebind( Name name, Object obj ) throws NamingException
      {
      }
  
      /**
       * Method rebind
       *
       *
       * @param name
       * @param obj
       *
       * @throws NamingException
       *
       */
      public void rebind( String name, Object obj ) throws NamingException
      {
      }
  
      /**
       * Method unbind
       *
       *
       * @param name
       *
       * @throws NamingException
       *
       */
      public void unbind( Name name ) throws NamingException
      {
      }
  
      /**
       * Method unbind
       *
       *
       * @param name
       *
       * @throws NamingException
       *
       */
      public void unbind( String name ) throws NamingException
      {
      }
  
      /**
       * Method rename
       *
       *
       * @param oldName
       * @param newName
       *
       * @throws NamingException
       *
       */
      public void rename( Name oldName, Name newName ) throws NamingException
      {
      }
  
      /**
       * Method rename
       *
       *
       * @param oldName
       * @param newName
       *
       * @throws NamingException
       *
       */
      public void rename( String oldName, String newName ) throws 
NamingException
      {
      }
  
      /**
       * Method list
       *
       *
       * @param name
       *
       * @return
       *
       * @throws NamingException
       *
       */
      public NamingEnumeration list( Name name ) throws NamingException
      {
          return null;
      }
  
      /**
       * Method list
       *
       *
       * @param name
       *
       * @return
       *
       * @throws NamingException
       *
       */
      public NamingEnumeration list( String name ) throws NamingException
      {
  
          final String[] names = m_altrmiInterfaceLookup.list();
  
          return new NamingEnumeration()
          {
  
              int size = names.length;
              int index = 0;
  
              public void close()
              {
              }
  
              public boolean hasMore()
              {
                  return index < names.length;
              }
  
              public Object next()
              {
                  return names[ index++ ];
              }
  
              public boolean hasMoreElements()
              {
                  return hasMore();
              }
  
              public Object nextElement()
              {
                  return next();
              }
          };
      }
  
      /**
       * Method listBindings
       *
       *
       * @param name
       *
       * @return
       *
       * @throws NamingException
       *
       */
      public NamingEnumeration listBindings( Name name ) throws NamingException
      {
          return null;
      }
  
      /**
       * Method listBindings
       *
       *
       * @param name
       *
       * @return
       *
       * @throws NamingException
       *
       */
      public NamingEnumeration listBindings( String name ) throws 
NamingException
      {
          return null;
      }
  
      /**
       * Method destroySubcontext
       *
       *
       * @param name
       *
       * @throws NamingException
       *
       */
      public void destroySubcontext( Name name ) throws NamingException
      {
      }
  
      /**
       * Method destroySubcontext
       *
       *
       * @param name
       *
       * @throws NamingException
       *
       */
      public void destroySubcontext( String name ) throws NamingException
      {
      }
  
      /**
       * Method createSubcontext
       *
       *
       * @param name
       *
       * @return
       *
       * @throws NamingException
       *
       */
      public Context createSubcontext( Name name ) throws NamingException
      {
          return null;
      }
  
      /**
       * Method createSubcontext
       *
       *
       * @param name
       *
       * @return
       *
       * @throws NamingException
       *
       */
      public Context createSubcontext( String name ) throws NamingException
      {
          return null;
      }
  
      /**
       * Method lookupLink
       *
       *
       * @param name
       *
       * @return
       *
       * @throws NamingException
       *
       */
      public Object lookupLink( Name name ) throws NamingException
      {
          return null;
      }
  
      /**
       * Method lookupLink
       *
       *
       * @param name
       *
       * @return
       *
       * @throws NamingException
       *
       */
      public Object lookupLink( String name ) throws NamingException
      {
          return null;
      }
  
      /**
       * Method getNameParser
       *
       *
       * @param name
       *
       * @return
       *
       * @throws NamingException
       *
       */
      public NameParser getNameParser( Name name ) throws NamingException
      {
          return null;
      }
  
      /**
       * Method getNameParser
       *
       *
       * @param name
       *
       * @return
       *
       * @throws NamingException
       *
       */
      public NameParser getNameParser( String name ) throws NamingException
      {
          return null;
      }
  
      /**
       * Method composeName
       *
       *
       * @param name
       * @param prefix
       *
       * @return
       *
       * @throws NamingException
       *
       */
      public Name composeName( Name name, Name prefix ) throws NamingException
      {
          return null;
      }
  
      /**
       * Method composeName
       *
       *
       * @param name
       * @param prefix
       *
       * @return
       *
       * @throws NamingException
       *
       */
      public String composeName( String name, String prefix ) throws 
NamingException
      {
          return null;
      }
  
      /**
       * Method addToEnvironment
       *
       *
       * @param propName
       * @param propVal
       *
       * @return
       *
       * @throws NamingException
       *
       */
      public Object addToEnvironment( String propName, Object propVal ) throws 
NamingException
      {
          return null;
      }
  
      /**
       * Method removeFromEnvironment
       *
       *
       * @param propName
       *
       * @return
       *
       * @throws NamingException
       *
       */
      public Object removeFromEnvironment( String propName ) throws 
NamingException
      {
          return null;
      }
  
      /**
       * Method getEnvironment
       *
       *
       * @return
       *
       * @throws NamingException
       *
       */
      public Hashtable getEnvironment() throws NamingException
      {
          return null;
      }
  
      /**
       * Method close
       *
       *
       * @throws NamingException
       *
       */
      public void close() throws NamingException
      {
          m_altrmiInterfaceLookup.close();
      }
  
      /**
       * Method getNameInNamespace
       *
       *
       * @return
       *
       * @throws NamingException
       *
       */
      public String getNameInNamespace() throws NamingException
      {
          return null;
      }
  }
  
  
  
  1.1                  
jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/naming/DefaultInitialContextFactory.java
  
  Index: DefaultInitialContextFactory.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.excalibur.altrmi.client.impl.naming;
  
  import java.util.Hashtable;
  import javax.naming.Context;
  import javax.naming.NamingException;
  import javax.naming.spi.InitialContextFactory;
  import org.apache.excalibur.altrmi.client.impl.DefaultInterfaceLookupFactory;
  
  /**
   * Class DefaultInitialContextFactory
   *
   *
   * @author Vinay Chandrasekharan <a href="mailto:[EMAIL PROTECTED]">[EMAIL 
PROTECTED]</a>
   * @version $Revision: 1.1 $
   */
  public class DefaultInitialContextFactory implements InitialContextFactory
  {
  
      /**
       * Method getInitialContext
       *
       *
       * @param env
       *
       * @return
       *
       * @throws NamingException
       *
       * @see InitialContextFactory#getInitialContext(Hashtable)
       *
       */
      public Context getInitialContext( Hashtable env ) throws NamingException
      {
  
          String transportStream = "";
          String s_url = (String)env.get( Context.PROVIDER_URL );
          int index = -1;
  
          index = ( s_url.lastIndexOf( "\\" ) > s_url.lastIndexOf( "/" ) )
              ? s_url.lastIndexOf( "\\" ) : s_url.lastIndexOf( "/" );
          transportStream = s_url.substring( index + 1 );
  
          for( int i = 0; i < 
DefaultInterfaceLookupFactory.SUPPORTEDSTREAMS.length; i++ )
          {
              if( transportStream
                  .equalsIgnoreCase( 
DefaultInterfaceLookupFactory.SUPPORTEDSTREAMS[ i ] ) )
              {
                  String host = s_url.substring( s_url.indexOf( ":" ) + 3, 
s_url.lastIndexOf( ":" ) );
                  String port = s_url.substring( s_url.lastIndexOf( ":" ) + 1, 
index );
  
                  return new DefaultContext( host, port, transportStream, env );
              }
          }
  
          throw new NamingException( "TransportStream[" + transportStream + "] 
not supported" );
      }
  }
  
  
  
  1.1                  
jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/rmi/RmiClientInvocationHandler.java
  
  Index: RmiClientInvocationHandler.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.excalibur.altrmi.client.impl.rmi;
  
  import java.net.MalformedURLException;
  import java.rmi.ConnectException;
  import java.rmi.ConnectIOException;
  import java.rmi.Naming;
  import java.rmi.NotBoundException;
  import java.rmi.RemoteException;
  import org.apache.excalibur.altrmi.client.ConnectionListener;
  import 
org.apache.excalibur.altrmi.client.impl.AbstractClientInvocationHandler;
  import org.apache.excalibur.altrmi.common.ConnectionException;
  import org.apache.excalibur.altrmi.common.InvocationException;
  import org.apache.excalibur.altrmi.common.Reply;
  import org.apache.excalibur.altrmi.common.Request;
  import org.apache.excalibur.altrmi.common.MethodRequest;
  import org.apache.excalibur.altrmi.common.NoSuchReferenceException;
  import org.apache.excalibur.altrmi.common.NoSuchReferenceReply;
  import org.apache.excalibur.altrmi.common.NotPublishedException;
  import org.apache.excalibur.altrmi.common.NotPublishedReply;
  import org.apache.excalibur.altrmi.common.PublishedNameRequest;
  import org.apache.excalibur.altrmi.common.TryLaterReply;
  import org.apache.excalibur.altrmi.common.RequestConstants;
  import org.apache.excalibur.altrmi.common.BadConnectionException;
  import org.apache.excalibur.altrmi.common.RmiInvocationHandler;
  
  /**
   * Class RmiClientInvocationHandler
   *
   *
   * @author Paul Hammant <a href="mailto:[EMAIL PROTECTED]">[EMAIL 
PROTECTED]</a>
   * @version $Revision: 1.1 $
   */
  public final class RmiClientInvocationHandler extends 
AbstractClientInvocationHandler
  {
  
      private RmiInvocationHandler m_rmiInvocationHandler;
      private String m_URL;
      private boolean m_methodLogging = false;
      private long m_lastRealRequest = System.currentTimeMillis();
  
      /**
       * Constructor RmiClientInvocationHandler
       *
       *
       * @param host
       * @param port
       *
       * @throws ConnectionException
       *
       */
      public RmiClientInvocationHandler( String host, int port ) throws 
ConnectionException
      {
  
          m_URL = "rmi://" + host + ":" + port + "/" + 
RmiInvocationHandler.class.getName();
  
          try
          {
              m_rmiInvocationHandler = (RmiInvocationHandler)Naming.lookup( 
m_URL );
          }
          catch( NotBoundException nbe )
          {
              throw new ConnectionException(
                  "Cannot bind to the remote RMI service.  Either an IP or RMI 
issue." );
          }
          catch( MalformedURLException mfue )
          {
              throw new ConnectionException( "Malformed URL, host/port (" + 
host + "/" + port
                                                   + ") must be wrong: " + 
mfue.getMessage() );
          }
          catch( ConnectIOException cioe )
          {
              throw new BadConnectionException( "Cannot connect to remote RMI 
server. "
                      + "It is possible that transport mismatch");
          }
          catch( RemoteException re )
          {
              throw new ConnectionException( "Unknown Remote Exception : " + 
re.getMessage() );
          }
      }
  
      /**
       * Method setConnectionListener
       *
       *
       * @param altrmiConnectionListener
       *
       */
      public void setConnectionListener( ConnectionListener 
altrmiConnectionListener )
      {
  
          super.setConnectionListener( altrmiConnectionListener );
  
          m_methodLogging = altrmiConnectionListener.methodLogging();
      }
  
      /**
       * Method tryReconnect
       *
       * @return
       *
       */
      protected boolean tryReconnect()
      {
  
          try
          {
              m_rmiInvocationHandler = (RmiInvocationHandler)Naming.lookup( 
m_URL );
  
              return true;
          }
          catch( Exception e )
          {
              return false;
          }
      }
  
      /**
       * Method handleInvocation
       *
       *
       * @param request
       *
       * @return
       *
       */
      public synchronized Reply handleInvocation( Request request )
      {
  
          if( request.getRequestCode() != RequestConstants.PINGREQUEST )
          {
              m_lastRealRequest = System.currentTimeMillis();
          }
  
          boolean again = true;
          Reply reply = null;
          int tries = 0;
          long start = 0;
  
          if( m_methodLogging )
          {
              start = System.currentTimeMillis();
          }
  
          while( again )
          {
              tries++;
  
              again = false;
  
              try
              {
                  reply = m_rmiInvocationHandler.handleInvocation( request );
  
                  if( reply.getReplyCode() >= 100 )
                  {
                      if( reply instanceof TryLaterReply )
                      {
                          int millis = ( (TryLaterReply)reply 
).getSuggestedDelayMillis();
  
                          m_altrmiConnectionListener.serviceSuspended( request, 
tries, millis );
  
                          again = true;
                      }
                      else if( reply instanceof NoSuchReferenceReply )
                      {
                          throw new NoSuchReferenceException( ( 
(NoSuchReferenceReply)reply )
                                                              .getReferenceID() 
);
                      }
                      else if( reply instanceof NotPublishedReply )
                      {
                          PublishedNameRequest pnr = 
(PublishedNameRequest)request;
  
                          throw new NotPublishedException( 
pnr.getPublishedServiceName(),
                                                           pnr.getObjectName() 
);
                      }
                  }
              }
              catch( RemoteException re )
              {
                  if( re instanceof ConnectException | re instanceof 
ConnectIOException )
                  {
                      int retryConnectTries = 0;
  
                      m_rmiInvocationHandler = null;
  
                      while( !tryReconnect() )
                      {
                          m_altrmiConnectionListener.serviceAbend( 
retryConnectTries, re );
  
                          retryConnectTries++;
                      }
                  }
                  else
                  {
                      throw new InvocationException( "Unknown RMI problem : "
                                                           + re.getMessage() );
                  }
              }
          }
  
          if( m_methodLogging )
          {
              if( request instanceof MethodRequest )
              {
                  m_altrmiConnectionListener.methodCalled(
                      ( (MethodRequest)request ).getMethodSignature(),
                      System.currentTimeMillis() - start );
              }
          }
  
          return reply;
      }
  
      /**
       * Method getLastRealRequest
       *
       *
       * @return
       *
       */
      public long getLastRealRequest()
      {
          return m_lastRealRequest;
      }
  }
  
  
  
  1.1                  
jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/socket/DefaultUserInfo.java
  
  Index: DefaultUserInfo.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.excalibur.altrmi.client.impl.socket;
  
  import com.jcraft.jsch.UserInfo;
  
  /**
   * Class DefaultUserInfo
   *
   * JSch :- http://www.jcraft.com/jsch/
   * "JSch is a pure Java implementation of SSH2.
   * JSch allows you to connect to an sshd server and use port forwarding,
   * X11 forwarding, file transfer, etc., and you can integrate its 
functionality
   * into your own Java programs. JSch is licensed under GNU LGPL."
   * LGPL :- http://www.gnu.org/copyleft/lesser.txt
   *
   * @author Paul Hammant
   * @version $Revision: 1.1 $
   */
  public class DefaultUserInfo implements UserInfo
  {
      private String m_userID;
      private String m_password;
  
      /**
       *
       * @param userID The user ID to use for the SSH authentiaction
       * @param password The password to use for SSH Authentication
       */
      public DefaultUserInfo(String userID, String password)
      {
          m_userID = userID;
          m_password = password;
      }
  
      public String getName()
      {
          return m_userID;
      }
  
      public String getPassphrase(String s)
      {
          return null;
      }
  
      public String getPassword()
      {
          return m_password;
      }
  
      public boolean promptNameAndPassword(String s)
      {
          return false;
      }
  
      public boolean promptNameAndPassphrase(String s)
      {
          return false;
      }
  
      public boolean prompt(String s)
      {
          return false;
      }
  
      public boolean retry()
      {
          return true;
      }
  }
  
  
  
  1.1                  
jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/subscriber/AbstractInterfaceLookupFactory.java
  
  Index: AbstractInterfaceLookupFactory.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.excalibur.altrmi.client.impl.subscriber;
  
  import java.lang.reflect.Constructor;
  
  import org.apache.avalon.excalibur.pool.ObjectFactory;
  import org.apache.avalon.framework.configuration.Configurable;
  import org.apache.avalon.framework.configuration.Configuration;
  import org.apache.avalon.framework.configuration.ConfigurationException;
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  import org.apache.excalibur.altrmi.client.Factory;
  import org.apache.excalibur.altrmi.client.HostContext;
  import org.apache.excalibur.altrmi.client.impl.ClientSideClassFactory;
  import org.apache.excalibur.altrmi.client.impl.PerpetualConnectionPinger;
  import org.apache.excalibur.altrmi.client.impl.ServerSideClassFactory;
  import org.apache.excalibur.altrmi.common.ConnectionException;
  
  /**
   * Abstract base factory to create <code>InterfaceLookup</code> instances for 
the
   * connection pool.
   *
   * Concrete subclasses provide support for the various AltRMI transports
   *
   * @author <a href="mailto:[EMAIL PROTECTED]">Peter Royal</a>
   */
  public abstract class AbstractInterfaceLookupFactory extends 
AbstractLogEnabled
      implements ObjectFactory, Configurable
  {
      private Constructor m_altrmiFactoryConstructor;
      private boolean m_isServer;
  
      public void configure( Configuration configuration ) throws 
ConfigurationException
      {
          String proxyClassLocation = configuration.getChild( 
"proxyClassLocation" ).getValue();
  
          if( proxyClassLocation.equals( "client" ) )
          {
              this.m_isServer = false;
          }
          else if( proxyClassLocation.equals( "server" ) )
          {
              this.m_isServer = true;
          }
          else
          {
              throw new ConfigurationException( "proxyClassLocation must be 
'client' or 'server'" );
          }
      }
  
      private Factory createFactory()
      {
          if( this.m_isServer )
          {
              return new ServerSideClassFactory( false );
          }
          else
          {
              return new ClientSideClassFactory( false );
          }
      }
  
      public Object newInstance() throws Exception
      {
          final Factory factory = createFactory();
          final HostContext context = createHostContext();
  
          context.getClientInvocationHandler().setConnectionPinger( new 
PerpetualConnectionPinger() );
          factory.setHostContext( context );
  
          if( getLogger().isDebugEnabled() )
              getLogger().debug( "InterfaceLookup object created" );
  
          return new InterfaceLookupWrapper( factory );
      }
  
      protected abstract HostContext createHostContext() throws 
ConnectionException;
  
      public Class getCreatedClass()
      {
          return InterfaceLookupWrapper.class;
      }
  
      public void decommission( Object object ) throws Exception
      {
          if( object instanceof InterfaceLookupWrapper )
          {
              ( ( InterfaceLookupWrapper ) object ).dispose();
          }
      }
  }
  
  
  
  1.1                  
jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/subscriber/DefaultLookupPool.java
  
  Index: DefaultLookupPool.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.excalibur.altrmi.client.impl.subscriber;
  
  import org.apache.avalon.excalibur.pool.DefaultPoolController;
  import org.apache.avalon.excalibur.pool.Poolable;
  import org.apache.avalon.excalibur.pool.SoftResourceLimitingPool;
  import org.apache.avalon.framework.activity.Disposable;
  import org.apache.avalon.framework.activity.Initializable;
  
  /**
   * The Pool implementation for InterfaceLookup's.
   *
   * @author <a href="mailto:[EMAIL PROTECTED]">Peter Royal</a>
   * @author <a href="mailto:[EMAIL PROTECTED]">Berin Loritsch</a>
   * @version CVS $Revision: 1.1 $ $Date: 2003/01/09 22:55:29 $
   */
  public class DefaultLookupPool extends SoftResourceLimitingPool implements 
Disposable, Initializable
  {
      private boolean m_noConnections = false;
  
      public DefaultLookupPool( final AbstractInterfaceLookupFactory factory,
                               final DefaultPoolController controller,
                               final int min,
                               final int max
                               )
          throws Exception
      {
          super( factory, controller, min, max );
      }
  
      public void initialize() throws Exception
      {
          this.grow( this.m_min );
  
          if( this.size() > 0 )
          {
              m_initialized = true;
          }
          else
          {
              m_noConnections = true;
          }
      }
  
      protected final Poolable newPoolable() throws Exception
      {
          InterfaceLookupWrapper wrapper = ( InterfaceLookupWrapper ) 
super.newPoolable();
  
          wrapper.setPool( this );
  
          return wrapper;
      }
  
      public Poolable get() throws Exception
      {
          if( !m_initialized )
          {
              if( m_noConnections )
              {
                  throw new IllegalStateException( "There are no connections in 
the pool, check your settings." );
              }
          }
  
          InterfaceLookupWrapper obj = ( InterfaceLookupWrapper ) super.get();
  
          if( obj.isBroken() )
          {
              if( getLogger().isDebugEnabled() )
                  getLogger().debug( "InterfaceLookup was broken, creating one 
to take its place" );
  
              try
              {
                  super.lock();
  
                  if( m_active.contains( obj ) )
                  {
                      m_active.remove( obj );
                  }
  
                  this.removePoolable( obj );
  
                  obj = ( InterfaceLookupWrapper ) this.newPoolable();
  
                  m_active.add( obj );
              }
              catch( Exception e )
              {
                  if( getLogger().isWarnEnabled() )
                      getLogger().warn( "Could not get an open connection", e );
  
                  throw e;
              }
              finally
              {
                  super.unlock();
              }
          }
  
          return obj;
      }
  }
  
  
  
  1.1                  
jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/subscriber/InterfaceLookupWrapper.java
  
  Index: InterfaceLookupWrapper.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.excalibur.altrmi.client.impl.subscriber;
  
  import org.apache.avalon.excalibur.pool.Pool;
  import org.apache.avalon.excalibur.pool.Poolable;
  import org.apache.avalon.framework.activity.Disposable;
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  import org.apache.excalibur.altrmi.client.InterfaceLookup;
  import org.apache.excalibur.altrmi.common.Authentication;
  import org.apache.excalibur.altrmi.common.ConnectionException;
  import org.apache.excalibur.altrmi.common.InvocationException;
  
  /**
   * The <code>AbstractInterfaceLookupFactory</code> uses this class to wrap the
   * <code>InterfaceLookup</code> objects it returns so they can be 
transparently pooled.
   *
   * An <code>InterfaceLookup</code> is deemed <i>broken</i> if the 
<code>lookup</code>
   * operation returns an exception. Broken <code>InterfaceLookup</code> 
instances will
   * be removed from the pool when returned.
   *
   * @author <a href="[EMAIL PROTECTED]">Peter Royal</a>
   * @version $Revision: 1.1 $
   */
  public class InterfaceLookupWrapper extends AbstractLogEnabled
      implements InterfaceLookup, Poolable, Disposable
  {
      protected final InterfaceLookup m_lookup;
      protected Pool m_pool;
  
      private boolean m_broken = false;
  
      /**
       * Private default constructor so that it cannot be instantiated any
       * other way than we desire.
       */
      private InterfaceLookupWrapper()
      {
          this.m_lookup = null;
      }
  
      /**
       * @param lookup InterfaceLookup instance to wrap
       */
      public InterfaceLookupWrapper( final InterfaceLookup lookup )
      {
          this.m_lookup = lookup;
      }
  
      protected void setPool( Pool pool )
      {
          this.m_pool = pool;
      }
  
      public boolean isBroken()
      {
          return this.m_broken;
      }
  
      public void close()
      {
          m_pool.put( this );
      }
  
      public void dispose()
      {
          this.m_lookup.close();
      }
  
      public Object lookup( String publishedServiceName ) throws 
ConnectionException
      {
          return this.m_lookup.lookup( publishedServiceName );
      }
  
      public Object lookup( String publishedServiceName, Authentication 
altrmiAuthentication )
          throws ConnectionException
      {
          try
          {
              return this.m_lookup.lookup( publishedServiceName, 
altrmiAuthentication );
          }
          catch( ConnectionException e )
          {
              this.m_broken = true;
  
              throw e;
          }
          catch( InvocationException e )
          {
              this.m_broken = true;
  
              throw e;
          }
      }
  
      public String[] list()
      {
          return this.m_lookup.list();
      }
  
      public String getTextToSignForAuthentication()
      {
          return this.m_lookup.getTextToSignForAuthentication();
      }
  }
  
  
  
  1.1                  
jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/common/RmiInvocationHandler.java
  
  Index: RmiInvocationHandler.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.excalibur.altrmi.common;
  
  import java.rmi.Remote;
  import java.rmi.RemoteException;
  
  /**
   * Interface RmiClientInvocationHandler
   *
   *
   * @author Paul Hammant <a href="mailto:[EMAIL PROTECTED]">[EMAIL 
PROTECTED]</a>
   * @version * $Revision: 1.1 $
   */
  public interface RmiInvocationHandler extends Remote
  {
  
      /**
       * Handle method invocation.
       *
       *
       * @param request the request to marshall over RMI
       *
       * @return the reply got back from the server
       *
       * @throws RemoteException in case there is outage.
       *
       */
      Reply handleInvocation( Request request ) throws RemoteException;
  }
  
  
  
  1.1                  
jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/generator/ant/ProxyGenerationTask.java
  
  Index: ProxyGenerationTask.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.excalibur.altrmi.generator.ant;
  
  import java.io.File;
  import java.util.StringTokenizer;
  import java.util.Vector;
  import org.apache.excalibur.altrmi.common.ProxyGenerationException;
  import org.apache.excalibur.altrmi.common.ProxyGenerator;
  import org.apache.excalibur.altrmi.server.PublicationDescriptionItem;
  import org.apache.tools.ant.AntClassLoader;
  import org.apache.tools.ant.BuildException;
  import org.apache.tools.ant.Task;
  import org.apache.tools.ant.types.Path;
  import org.apache.tools.ant.types.Reference;
  
  /**
   * Class ProxyGenerationTask
   *
   *
   * @author Paul Hammant
   * @version $Revision: 1.1 $
   */
  public class ProxyGenerationTask extends Task
  {
  
      protected String[] m_interfacesToExpose;
      protected String[] m_additionalFacades;
      protected File m_srcGenDir;
      protected File m_classGenDir;
      protected String m_genName;
      protected Path m_classpath;
      protected String m_verbose = "false";
      private String 
m_generatorClass="org.apache.excalibur.altrmi.generator.ProxyGeneratorImpl";
  
      /**
       * Constructor ProxyGenerationTask
       *
       *
       */
      public ProxyGenerationTask()
      {
      }
  
      /**
       * Method setInterfaces
       *
       *
       * @param interfacesToExpose
       *
       */
      public void setInterfaces( String interfacesToExpose )
      {
  
          StringTokenizer st = new StringTokenizer( interfacesToExpose, "," );
          Vector strings = new Vector();
  
          while( st.hasMoreTokens() )
          {
              strings.add( st.nextToken().trim() );
          }
  
          m_interfacesToExpose = new String[ strings.size() ];
  
          strings.copyInto( m_interfacesToExpose );
      }
  
      /**
       * Method setAdditionalfacades
       *
       *
       * @param additionalfacades
       *
       */
      public void setAdditionalfacades( String additionalfacades )
      {
  
          StringTokenizer st = new StringTokenizer( additionalfacades, "," );
          Vector strings = new Vector();
  
          while( st.hasMoreTokens() )
          {
              strings.add( st.nextToken().trim() );
          }
  
          m_additionalFacades = new String[ strings.size() ];
  
          strings.copyInto( m_additionalFacades );
      }
  
      /**
       * Method setSrcgendir
       *
       *
       * @param srcGenDir
       *
       */
      public void setSrcgendir( File srcGenDir )
      {
          m_srcGenDir = srcGenDir;
      }
  
      /**
       * Method setClassgendir
       *
       *
       * @param classGenDir
       *
       */
      public void setClassgendir( File classGenDir )
      {
          m_classGenDir = classGenDir;
      }
  
      /**
       * Method setGenname
       *
       *
       * @param genName
       *
       */
      public void setGenname( String genName )
      {
          this.m_genName = genName;
      }
  
      /**
       * Method setM_classpath
       *
       *
       * @param classpath
       *
       */
      public void setClasspath( Path classpath )
      {
  
          if( m_classpath == null )
          {
              m_classpath = classpath;
          }
          else
          {
              m_classpath.append( classpath );
          }
      }
  
      /**
       * Method createClasspath
       *
       *
       * @return
       *
       */
      public Path createClasspath()
      {
  
          if( m_classpath == null )
          {
              m_classpath = new Path( project );
          }
  
          return m_classpath.createPath();
      }
  
      /**
       * Method setClasspathRef
       *
       *
       * @param r
       *
       */
      public void setClasspathRef( Reference r )
      {
          createClasspath().setRefid( r );
      }
  
      /**
       * Method setVerbose
       *
       *
       * @param verbose
       *
       */
      public void setVerbose( String verbose )
      {
          m_verbose = verbose;
      }
  
      /**
       * Sets the GeneratorClass
       * @param generatorClass The Generator Class to set.
       */
      public void setGeneratorClass(String generatorClass)
      {
          this.m_generatorClass = generatorClass;
      }
  
      /**
       * Method execute
       *
       *
       * @throws BuildException
       *
       */
      public void execute() throws BuildException
      {
  
          if( m_interfacesToExpose == null )
          {
              throw new BuildException( "Specify at least one interface to 
expose" );
          }
  
          if( m_srcGenDir == null )
          {
              throw new BuildException( "Specify the directory to generate Java 
source in" );
          }
  
          if( m_classGenDir == null )
          {
              throw new BuildException( "Specify the directory to generate Java 
classes in" );
          }
  
          if( m_genName == null )
          {
              throw new BuildException( "Specify the name to use for lookup" );
          }
  
          ProxyGenerator proxyGenerator;
  
          try
          {
              proxyGenerator =
                  (ProxyGenerator)Class
                  .forName( m_generatorClass )
                  .newInstance();
          }
          catch( Exception e )
          {
              e.printStackTrace();
  
              throw new RuntimeException( "PrimaryGenerator Impl jar not in 
m_classpath" );
          }
  
          try
          {
              proxyGenerator.setSrcGenDir( m_srcGenDir.getAbsolutePath() );
              proxyGenerator.setClassGenDir( m_classGenDir.getAbsolutePath() );
              proxyGenerator.setGenName( m_genName );
              proxyGenerator.verbose( Boolean.valueOf( m_verbose 
).booleanValue() );
              proxyGenerator.setClasspath( m_classpath.concatSystemClasspath( 
"ignore" ).toString() );
  
              PublicationDescriptionItem[] interfacesToExpose = new 
PublicationDescriptionItem[ m_interfacesToExpose.length ];
              ClassLoader classLoader = new AntClassLoader( getProject(), 
m_classpath );
  
              for( int i = 0; i < m_interfacesToExpose.length; i++ )
              {
                  String cn = m_interfacesToExpose[ i ];
  
                  interfacesToExpose[ i ] = new 
PublicationDescriptionItem(classLoader.loadClass( cn ));
              }
  
              proxyGenerator.setInterfacesToExpose( interfacesToExpose );
  
              if( m_additionalFacades != null )
              {
                  PublicationDescriptionItem[] additionalFacades = new 
PublicationDescriptionItem[ m_additionalFacades.length ];
  
                  for( int i = 0; i < m_additionalFacades.length; i++ )
                  {
                      String cn = m_additionalFacades[ i ];
  
                      additionalFacades[ i ] = new 
PublicationDescriptionItem(classLoader.loadClass( cn ));
                  }
  
                  proxyGenerator.setAdditionalFacades( additionalFacades );
              }
  
              ClassLoader classLoader2 = null;
  
              if( m_classpath != null )
              {
                  classLoader2 = new AntClassLoader( project, m_classpath );
              }
              else
              {
                  classLoader2 = this.getClass().getClassLoader();
              }
  
              proxyGenerator.generateSrc( classLoader2 );
              proxyGenerator.generateClass( classLoader2 );
          }
          catch( ClassNotFoundException cnfe )
          {
              cnfe.printStackTrace();
  
              throw new BuildException( "Class not found : " + 
cnfe.getMessage() );
          }
          catch( ProxyGenerationException sge )
          {
              throw new BuildException( "Proxy Gerneation error : " + 
sge.getMessage() );
          }
      }
      
  
  
  }
  
  
  
  1.1                  
jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/Session.java
  
  Index: Session.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.excalibur.altrmi.server.impl;
  
  import java.util.HashMap;
  
  /**
   * Class Session
   *
   *
   * @author Paul Hammant
   * @version $Revision: 1.1 $
   */
  public class Session
  {
  
      /**
       * Session ID
       */
      private Long m_session;
  
      /**
       * A map of in-use beans
       */
      private HashMap m_beansInUse = new HashMap();
  
      /**
       * Construct an Session with a session ID
       *
       *
       * @param session the session ID
       *
       */
      public Session( Long session )
      {
          m_session = session;
      }
  
      /**
       * Get the Session ID
       *
       *
       * @return The session ID
       *
       */
      public Long getSession()
      {
          return m_session;
      }
  
      /**
       * Add a bean in use.
       *
       *
       * @param referenceID The reference ID
       * @param bean The bean to use.
       *
       */
      public void addBeanInUse( Long referenceID, Object bean )
      {
          m_beansInUse.put( referenceID, bean );
      }
  
      /**
       * Remove a bean in use
       *
       *
       * @param referenceID The reference ID.
       *
       */
      public void removeBeanInUse( Long referenceID )
      {
          m_beansInUse.remove( referenceID );
      }
  }
  
  
  
  1.1                  
jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/callback/CallbackServerClassFactory.java
  
  Index: CallbackServerClassFactory.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.excalibur.altrmi.server.impl.callback;
  
  import org.apache.excalibur.altrmi.client.HostContext;
  import org.apache.excalibur.altrmi.client.impl.AbstractHostContext;
  import org.apache.excalibur.altrmi.client.impl.DefaultProxyHelper;
  import org.apache.excalibur.altrmi.client.impl.ServerSideClassFactory;
  import org.apache.excalibur.altrmi.common.Authentication;
  import org.apache.excalibur.altrmi.common.ConnectionException;
  import org.apache.excalibur.altrmi.common.Reply;
  import org.apache.excalibur.altrmi.common.ExceptionReply;
  import org.apache.excalibur.altrmi.common.LookupReply;
  import org.apache.excalibur.altrmi.common.LookupRequest;
  import org.apache.excalibur.altrmi.common.NotPublishedReply;
  import org.apache.excalibur.altrmi.common.ReplyConstants;
  
  /**
   * Class CallbackServerClassFactory :
   *      Provides a hook for setting the hostContext
   *      for the Factory WITHOUT having to exchange
   *      OpenConnectionRequestMessage &
   *      also to provides the hacks the lookup() mechanism by modifying
   *      PublishedName during this part of the protocol.
   *
   * @author <a href="mailto:[EMAIL PROTECTED]">Vinay Chandran</a>
   * @version $Revision: 1.1 $
   */
  public class CallbackServerClassFactory extends ServerSideClassFactory
  {
  
      /**
       * Construct a CallbackServerClassFactory
       *
       *
       * @param beanOnly if to make a bean-only client side proxy
       *
       */
      public CallbackServerClassFactory( boolean beanOnly )
      {
          super( beanOnly );
      }
  
      //hack method to influence OpenConnectionRequest/reply sequence
  
      /**
       * Set an Initialized HostContext
       *
       *
       * @param hostContext The host context
       *
       */
      public void setInitializedHostContext( HostContext hostContext )
      {
          m_hostContext = (AbstractHostContext)hostContext;
      }
  
      /**
       * Method lookup
       *  PublishedName is modified during the lookup so that
       *  the client-side Server doesNOT have to generate stubs
       *  for each and every such PublishedName
       *
       *
       * @param publishedServiceName The published service name
       * @param altrmiAuthentication An Authentication
       * @return The object
       * @throws ConnectionException if a proble during connection
       */
      public Object lookup( String publishedServiceName, Authentication 
altrmiAuthentication )
          throws ConnectionException
      {
  
          String modifiedPublishedName =
              publishedServiceName.substring( 0, 
publishedServiceName.lastIndexOf( "_" ) );
          Reply ar =
              m_hostContext.getClientInvocationHandler()
              .handleInvocation( new LookupRequest( modifiedPublishedName, 
altrmiAuthentication,
                                                    m_session ) );
  
          if( ar.getReplyCode() >= ReplyConstants.PROBLEMREPLY )
          {
              if( ar instanceof NotPublishedReply )
              {
                  throw new ConnectionException( "Service " + 
publishedServiceName
                                                       + " not published" );
              }
              else if( ar instanceof ExceptionReply )
              {
                  ExceptionReply er = (ExceptionReply)ar;
  
                  throw (ConnectionException)er.getReplyException();
              }
              else
              {
                  throw new ConnectionException( "Problem doing lookup on 
service" );
              }
          }
  
          LookupReply lr = (LookupReply)ar;
          DefaultProxyHelper baseObj = new DefaultProxyHelper(
                  this, m_hostContext.getClientInvocationHandler(),
                  publishedServiceName, "Main",
                  lr.getReferenceID(), m_session );
          Object retVal = getInstance( modifiedPublishedName, "Main", baseObj, 
isBeanOnly() );
  
          baseObj.registerImplObject( retVal );
  
          return retVal;
      }
  }
  
  
  

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

Reply via email to