commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hamm...@apache.org
Subject cvs commit: jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/test TestClient.java TestInterface.java TestInterfaceImpl.java
Date Mon, 07 Jan 2002 16:24:35 GMT
hammant     02/01/07 08:24:34

  Modified:    armi     PROPOSAL
               armi/src/java/org/apache/commons/armi/client/impl
                        AbstractArmiFactory.java BaseServedObject.java
                        ClientClassArmiFactory.java
                        ServerClassArmiFactory.java
               armi/src/java/org/apache/commons/armi/common ClassReply.java
                        ClassRequest.java EndConnectionReply.java
                        ExceptionReply.java LookupReply.java
                        LookupRequest.java MethodFacadeReply.java
                        MethodFacadeRequest.java MethodReply.java
                        NoSuchReferenceReply.java RequestFailedReply.java
                        SuspendedReply.java
               armi/src/java/org/apache/commons/armi/generator
                        PrimarySourceGenerator.java
               armi/src/java/org/apache/commons/armi/server/impl
                        AbstractServer.java DefaultInvocationHandler.java
               armi/src/java/org/apache/commons/armi/test TestClient.java
                        TestInterface.java TestInterfaceImpl.java
  Added:       armi/src/java/org/apache/commons/armi/common
                        FacadeRefHolder.java
  Log:
  ARMI now takes other facades as parameters to method calls.
  
  Revision  Changes    Path
  1.15      +6 -13     jakarta-commons-sandbox/armi/PROPOSAL
  
  Index: PROPOSAL
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/armi/PROPOSAL,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- PROPOSAL	6 Jan 2002 23:31:52 -0000	1.14
  +++ PROPOSAL	7 Jan 2002 16:24:33 -0000	1.15
  @@ -93,8 +93,8 @@
   
   12) No just pass by value.
   
  -  - ARMI started life as 'pass by value' only.  In now support return 
  -    types wrapped in another ARMI Facade.   
  +  - ARMI started life as 'pass by value' only.  In now supports return 
  +    types and parameters wrapped in another ARMI Facade.
       
   
   Limitations:
  @@ -106,10 +106,6 @@
       This is intended for other client server solutions.  Beside RMI over IIOP
       is Sun specified.
   
  -2) Method Params must not be other ARMI Facades.
  -
  -  - To fix.
  -
   Todo:
   
   1) BCEL for generated proxy class.
  @@ -117,14 +113,11 @@
     - The current impl writes java source then compiles it.  We could do this
       inline with BCEL.  This as an heavier, but more design perfect 
       alternative to the current server side impl.
  -    
  -2) Generated classes from getResource() from jars on the serverside as an
  -   alternative to the byte arrays in the current server side impl.
  - 
  -3) Client and Server code for secure conversations.
  +     
  +2) Client and Server code for secure conversations.
   
  -4) Authentication and Authorisation on lookup(..).
  +3) Authentication and Authorisation on lookup(..).
   
  -Initial commiters:
  +Initial committers:
   
   Paul Hammant (hammant)
  
  
  
  1.3       +28 -4     jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/client/impl/AbstractArmiFactory.java
  
  Index: AbstractArmiFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/client/impl/AbstractArmiFactory.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AbstractArmiFactory.java	6 Jan 2002 15:39:51 -0000	1.2
  +++ AbstractArmiFactory.java	7 Jan 2002 16:24:34 -0000	1.3
  @@ -1,8 +1,8 @@
   
   /*
  - * $Header: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/client/impl/AbstractArmiFactory.java,v
1.2 2002/01/06 15:39:51 hammant Exp $
  - * $Revision: 1.2 $
  - * $Date: 2002/01/06 15:39:51 $
  + * $Header: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/client/impl/AbstractArmiFactory.java,v
1.3 2002/01/07 16:24:34 hammant Exp $
  + * $Revision: 1.3 $
  + * $Date: 2002/01/07 16:24:34 $
    *
    * ====================================================================
    *
  @@ -65,16 +65,20 @@
   import org.apache.commons.armi.client.ArmiHostContext;
   import org.apache.commons.armi.common.ArmiConnectionException;
   
  +import java.util.HashMap;
  +
   /**
    * Class AbstractArmiFactory
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
    */
   public abstract class AbstractArmiFactory implements ArmiFactory {
   
       protected ArmiHostContext mHostContext;
  +    protected HashMap mObjRefs = new HashMap();
  +
   
       /**
        * Method setHostContext
  @@ -107,4 +111,24 @@
        *
        */
       protected abstract Object getInstance(String publishedServiceName, String objectName,
BaseServedObject baseServedObject) throws ArmiConnectionException;
  +
  +    /**
  +     * Method registerReferenceObject
  +     *
  +     *
  +     * @param ojb
  +     * @param String referenceID
  +     *
  +     * @return
  +     *
  +     *
  +     */
  +    public void registerReferenceObject(Object obj, String referenceID) {
  +        mObjRefs.put(obj, referenceID);
  +    }
  +
  +    public String getReferenceID(Object obj) {
  +        return (String) mObjRefs.get(obj);
  +    }
  +
   }
  
  
  
  1.5       +22 -5     jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/client/impl/BaseServedObject.java
  
  Index: BaseServedObject.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/client/impl/BaseServedObject.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- BaseServedObject.java	6 Jan 2002 15:39:51 -0000	1.4
  +++ BaseServedObject.java	7 Jan 2002 16:24:34 -0000	1.5
  @@ -1,8 +1,8 @@
   
   /*
  - * $Header: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/client/impl/BaseServedObject.java,v
1.4 2002/01/06 15:39:51 hammant Exp $
  - * $Revision: 1.4 $
  - * $Date: 2002/01/06 15:39:51 $
  + * $Header: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/client/impl/BaseServedObject.java,v
1.5 2002/01/07 16:24:34 hammant Exp $
  + * $Revision: 1.5 $
  + * $Date: 2002/01/07 16:24:34 $
    *
    * ====================================================================
    *
  @@ -72,6 +72,7 @@
   import org.apache.commons.armi.common.ArmiInvocationException;
   import org.apache.commons.armi.common.MethodFacadeReply;
   import org.apache.commons.armi.common.MethodFacadeRequest;
  +import org.apache.commons.armi.common.FacadeRefHolder;
   
   
   /**
  @@ -79,7 +80,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.4 $
  + * @version $Revision: 1.5 $
    */
   public final class BaseServedObject {
   
  @@ -98,6 +99,17 @@
       }
   
       /**
  +     * Method registerImplObject
  +     *
  +     *
  +     * @param implBean
  +     *
  +     */
  +    public void registerImplObject(Object implBean) {
  +        mArmiFactory.registerReferenceObject(implBean,mReferenceID);
  +    }
  +
  +    /**
        * Method armiProcessObjectRequest
        *
        *
  @@ -121,7 +133,7 @@
   
               BaseServedObject bo2 = new BaseServedObject(mArmiFactory, mInvocationHandler,
mPublishedServiceName, objectName, mfr.getReferenceID());
               Object retFacade = mArmiFactory.getInstance(mPublishedServiceName, objectName
,bo2);
  -
  +            bo2.registerImplObject(retFacade);
               return retFacade;
           } else if (reply.getReplyCode() == ArmiReply.EXCEPTIONREPLY) {
               ExceptionReply er = (ExceptionReply) reply;
  @@ -193,5 +205,10 @@
                                                 + reply.getClass().getName());
           }
   
  +    }
  +
  +    public FacadeRefHolder makeFacadeRefHolder(Object obj, String objectName) {
  +        String refID = mArmiFactory.getReferenceID(obj);
  +        return new FacadeRefHolder(refID,objectName);
       }
   }
  
  
  
  1.4       +5 -4      jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/client/impl/ClientClassArmiFactory.java
  
  Index: ClientClassArmiFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/client/impl/ClientClassArmiFactory.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ClientClassArmiFactory.java	6 Jan 2002 15:39:51 -0000	1.3
  +++ ClientClassArmiFactory.java	7 Jan 2002 16:24:34 -0000	1.4
  @@ -1,8 +1,8 @@
   
   /*
  - * $Header: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/client/impl/ClientClassArmiFactory.java,v
1.3 2002/01/06 15:39:51 hammant Exp $
  - * $Revision: 1.3 $
  - * $Date: 2002/01/06 15:39:51 $
  + * $Header: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/client/impl/ClientClassArmiFactory.java,v
1.4 2002/01/07 16:24:34 hammant Exp $
  + * $Revision: 1.4 $
  + * $Date: 2002/01/07 16:24:34 $
    *
    * ====================================================================
    *
  @@ -77,7 +77,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.3 $
  + * @version $Revision: 1.4 $
    */
   public class ClientClassArmiFactory extends AbstractArmiFactory {
   
  @@ -105,6 +105,7 @@
           LookupReply lr = (LookupReply) ar;
           BaseServedObject bo = new BaseServedObject(this, mHostContext.getInvocationHandler(),
publishedServiceName, "Main", lr.getReferenceID());
           Object retVal = getInstance(publishedServiceName, "Main", bo);
  +        bo.registerImplObject(retVal);
           return retVal;
       }
   
  
  
  
  1.6       +5 -4      jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/client/impl/ServerClassArmiFactory.java
  
  Index: ServerClassArmiFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/client/impl/ServerClassArmiFactory.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ServerClassArmiFactory.java	6 Jan 2002 15:39:51 -0000	1.5
  +++ ServerClassArmiFactory.java	7 Jan 2002 16:24:34 -0000	1.6
  @@ -1,8 +1,8 @@
   
   /*
  - * $Header: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/client/impl/ServerClassArmiFactory.java,v
1.5 2002/01/06 15:39:51 hammant Exp $
  - * $Revision: 1.5 $
  - * $Date: 2002/01/06 15:39:51 $
  + * $Header: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/client/impl/ServerClassArmiFactory.java,v
1.6 2002/01/07 16:24:34 hammant Exp $
  + * $Revision: 1.6 $
  + * $Date: 2002/01/07 16:24:34 $
    *
    * ====================================================================
    *
  @@ -84,7 +84,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.5 $
  + * @version $Revision: 1.6 $
    */
   public class ServerClassArmiFactory extends AbstractArmiFactory {
   
  @@ -115,6 +115,7 @@
           LookupReply lr = (LookupReply) ar;
           BaseServedObject bo = new BaseServedObject(this, mHostContext.getInvocationHandler(),
publishedServiceName, "Main", lr.getReferenceID());
           Object retVal =  getInstance(publishedServiceName, "Main", bo);
  +        bo.registerImplObject(retVal);
           return retVal;
       }
   
  
  
  
  1.3       +5 -5      jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/ClassReply.java
  
  Index: ClassReply.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/ClassReply.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ClassReply.java	3 Jan 2002 10:49:37 -0000	1.2
  +++ ClassReply.java	7 Jan 2002 16:24:34 -0000	1.3
  @@ -1,8 +1,8 @@
   
   /*
  - * $Header: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/ClassReply.java,v
1.2 2002/01/03 10:49:37 hammant Exp $
  - * $Revision: 1.2 $
  - * $Date: 2002/01/03 10:49:37 $
  + * $Header: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/ClassReply.java,v
1.3 2002/01/07 16:24:34 hammant Exp $
  + * $Revision: 1.3 $
  + * $Date: 2002/01/07 16:24:34 $
    *
    * ====================================================================
    *
  @@ -68,9 +68,9 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
    */
  -public class ClassReply extends ArmiReply {
  +public final class ClassReply extends ArmiReply {
   
       private final byte[] mClassBytes;
   
  
  
  
  1.4       +5 -5      jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/ClassRequest.java
  
  Index: ClassRequest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/ClassRequest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ClassRequest.java	6 Jan 2002 15:39:52 -0000	1.3
  +++ ClassRequest.java	7 Jan 2002 16:24:34 -0000	1.4
  @@ -1,8 +1,8 @@
   
   /*
  - * $Header: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/ClassRequest.java,v
1.3 2002/01/06 15:39:52 hammant Exp $
  - * $Revision: 1.3 $
  - * $Date: 2002/01/06 15:39:52 $
  + * $Header: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/ClassRequest.java,v
1.4 2002/01/07 16:24:34 hammant Exp $
  + * $Revision: 1.4 $
  + * $Date: 2002/01/07 16:24:34 $
    *
    * ====================================================================
    *
  @@ -67,9 +67,9 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.3 $
  + * @version $Revision: 1.4 $
    */
  -public class ClassRequest extends PublishedNameRequest {
  +public final class ClassRequest extends PublishedNameRequest {
   
       /**
        * Constructor ClassRequest
  
  
  
  1.2       +3 -3      jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/EndConnectionReply.java
  
  Index: EndConnectionReply.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/EndConnectionReply.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- EndConnectionReply.java	3 Jan 2002 10:49:37 -0000	1.1
  +++ EndConnectionReply.java	7 Jan 2002 16:24:34 -0000	1.2
  @@ -1,8 +1,8 @@
   
   /*
  - * $Header: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/EndConnectionReply.java,v
1.1 2002/01/03 10:49:37 hammant Exp $
  - * $Revision: 1.1 $
  - * $Date: 2002/01/03 10:49:37 $
  + * $Header: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/EndConnectionReply.java,v
1.2 2002/01/07 16:24:34 hammant Exp $
  + * $Revision: 1.2 $
  + * $Date: 2002/01/07 16:24:34 $
    *
    * ====================================================================
    *
  @@ -66,9 +66,9 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
  -public class EndConnectionReply extends ArmiReply {
  +public final class EndConnectionReply extends ArmiReply {
   
   
       /**
  
  
  
  1.3       +5 -5      jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/ExceptionReply.java
  
  Index: ExceptionReply.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/ExceptionReply.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ExceptionReply.java	3 Jan 2002 10:49:37 -0000	1.2
  +++ ExceptionReply.java	7 Jan 2002 16:24:34 -0000	1.3
  @@ -1,8 +1,8 @@
   
   /*
  - * $Header: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/ExceptionReply.java,v
1.2 2002/01/03 10:49:37 hammant Exp $
  - * $Revision: 1.2 $
  - * $Date: 2002/01/03 10:49:37 $
  + * $Header: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/ExceptionReply.java,v
1.3 2002/01/07 16:24:34 hammant Exp $
  + * $Revision: 1.3 $
  + * $Date: 2002/01/07 16:24:34 $
    *
    * ====================================================================
    *
  @@ -68,9 +68,9 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
    */
  -public class ExceptionReply extends ArmiReply {
  +public final class ExceptionReply extends ArmiReply {
   
       private final Throwable mReplyExcpt;
   
  
  
  
  1.2       +5 -5      jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/LookupReply.java
  
  Index: LookupReply.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/LookupReply.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LookupReply.java	6 Jan 2002 15:39:52 -0000	1.1
  +++ LookupReply.java	7 Jan 2002 16:24:34 -0000	1.2
  @@ -1,8 +1,8 @@
   
   /*
  - * $Header: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/LookupReply.java,v
1.1 2002/01/06 15:39:52 hammant Exp $
  - * $Revision: 1.1 $
  - * $Date: 2002/01/06 15:39:52 $
  + * $Header: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/LookupReply.java,v
1.2 2002/01/07 16:24:34 hammant Exp $
  + * $Revision: 1.2 $
  + * $Date: 2002/01/07 16:24:34 $
    *
    * ====================================================================
    *
  @@ -68,9 +68,9 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
  -public class LookupReply extends ArmiReply {
  +public final class LookupReply extends ArmiReply {
   
       private final String mReferenceID;
   
  
  
  
  1.2       +5 -5      jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/LookupRequest.java
  
  Index: LookupRequest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/LookupRequest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LookupRequest.java	6 Jan 2002 15:39:52 -0000	1.1
  +++ LookupRequest.java	7 Jan 2002 16:24:34 -0000	1.2
  @@ -1,8 +1,8 @@
   
   /*
  - * $Header: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/LookupRequest.java,v
1.1 2002/01/06 15:39:52 hammant Exp $
  - * $Revision: 1.1 $
  - * $Date: 2002/01/06 15:39:52 $
  + * $Header: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/LookupRequest.java,v
1.2 2002/01/07 16:24:34 hammant Exp $
  + * $Revision: 1.2 $
  + * $Date: 2002/01/07 16:24:34 $
    *
    * ====================================================================
    *
  @@ -68,9 +68,9 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
  -public class LookupRequest extends PublishedNameRequest {
  +public final class LookupRequest extends PublishedNameRequest {
   
       /**
        * Constructor LookupRequest
  
  
  
  1.2       +5 -5      jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/MethodFacadeReply.java
  
  Index: MethodFacadeReply.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/MethodFacadeReply.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MethodFacadeReply.java	6 Jan 2002 15:39:52 -0000	1.1
  +++ MethodFacadeReply.java	7 Jan 2002 16:24:34 -0000	1.2
  @@ -1,8 +1,8 @@
   
   /*
  - * $Header: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/MethodFacadeReply.java,v
1.1 2002/01/06 15:39:52 hammant Exp $
  - * $Revision: 1.1 $
  - * $Date: 2002/01/06 15:39:52 $
  + * $Header: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/MethodFacadeReply.java,v
1.2 2002/01/07 16:24:34 hammant Exp $
  + * $Revision: 1.2 $
  + * $Date: 2002/01/07 16:24:34 $
    *
    * ====================================================================
    *
  @@ -68,9 +68,9 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
  -public class MethodFacadeReply extends ArmiReply {
  +public final class MethodFacadeReply extends ArmiReply {
   
       private final String mReferenceID;
   
  
  
  
  1.2       +5 -5      jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/MethodFacadeRequest.java
  
  Index: MethodFacadeRequest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/MethodFacadeRequest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MethodFacadeRequest.java	6 Jan 2002 15:39:52 -0000	1.1
  +++ MethodFacadeRequest.java	7 Jan 2002 16:24:34 -0000	1.2
  @@ -1,8 +1,8 @@
   
   /*
  - * $Header: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/MethodFacadeRequest.java,v
1.1 2002/01/06 15:39:52 hammant Exp $
  - * $Revision: 1.1 $
  - * $Date: 2002/01/06 15:39:52 $
  + * $Header: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/MethodFacadeRequest.java,v
1.2 2002/01/07 16:24:34 hammant Exp $
  + * $Revision: 1.2 $
  + * $Date: 2002/01/07 16:24:34 $
    *
    * ====================================================================
    *
  @@ -68,9 +68,9 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
  -public class MethodFacadeRequest extends MethodRequest {
  +public final class MethodFacadeRequest extends MethodRequest {
   
       private String mReturnClassNameEncoded;
   
  
  
  
  1.3       +5 -5      jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/MethodReply.java
  
  Index: MethodReply.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/MethodReply.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- MethodReply.java	3 Jan 2002 10:49:37 -0000	1.2
  +++ MethodReply.java	7 Jan 2002 16:24:34 -0000	1.3
  @@ -1,8 +1,8 @@
   
   /*
  - * $Header: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/MethodReply.java,v
1.2 2002/01/03 10:49:37 hammant Exp $
  - * $Revision: 1.2 $
  - * $Date: 2002/01/03 10:49:37 $
  + * $Header: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/MethodReply.java,v
1.3 2002/01/07 16:24:34 hammant Exp $
  + * $Revision: 1.3 $
  + * $Date: 2002/01/07 16:24:34 $
    *
    * ====================================================================
    *
  @@ -68,9 +68,9 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
    */
  -public class MethodReply extends ArmiReply {
  +public final class MethodReply extends ArmiReply {
   
       private final Object mReplyObj;
   
  
  
  
  1.2       +5 -5      jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/NoSuchReferenceReply.java
  
  Index: NoSuchReferenceReply.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/NoSuchReferenceReply.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- NoSuchReferenceReply.java	6 Jan 2002 15:39:52 -0000	1.1
  +++ NoSuchReferenceReply.java	7 Jan 2002 16:24:34 -0000	1.2
  @@ -1,8 +1,8 @@
   
   /*
  - * $Header: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/NoSuchReferenceReply.java,v
1.1 2002/01/06 15:39:52 hammant Exp $
  - * $Revision: 1.1 $
  - * $Date: 2002/01/06 15:39:52 $
  + * $Header: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/NoSuchReferenceReply.java,v
1.2 2002/01/07 16:24:34 hammant Exp $
  + * $Revision: 1.2 $
  + * $Date: 2002/01/07 16:24:34 $
    *
    * ====================================================================
    *
  @@ -66,9 +66,9 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
  -public class NoSuchReferenceReply extends NotPublishedReply {
  +public final class NoSuchReferenceReply extends NotPublishedReply {
   
   
       /**
  
  
  
  1.4       +5 -5      jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/RequestFailedReply.java
  
  Index: RequestFailedReply.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/RequestFailedReply.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RequestFailedReply.java	3 Jan 2002 10:49:37 -0000	1.3
  +++ RequestFailedReply.java	7 Jan 2002 16:24:34 -0000	1.4
  @@ -1,8 +1,8 @@
   
   /*
  - * $Header: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/RequestFailedReply.java,v
1.3 2002/01/03 10:49:37 hammant Exp $
  - * $Revision: 1.3 $
  - * $Date: 2002/01/03 10:49:37 $
  + * $Header: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/RequestFailedReply.java,v
1.4 2002/01/07 16:24:34 hammant Exp $
  + * $Revision: 1.4 $
  + * $Date: 2002/01/07 16:24:34 $
    *
    * ====================================================================
    *
  @@ -68,9 +68,9 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.3 $
  + * @version $Revision: 1.4 $
    */
  -public class RequestFailedReply extends ArmiReply {
  +public final class RequestFailedReply extends ArmiReply {
   
       private final String mFailureReason;
   
  
  
  
  1.3       +5 -5      jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/SuspendedReply.java
  
  Index: SuspendedReply.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/SuspendedReply.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SuspendedReply.java	3 Jan 2002 10:49:37 -0000	1.2
  +++ SuspendedReply.java	7 Jan 2002 16:24:34 -0000	1.3
  @@ -1,8 +1,8 @@
   
   /*
  - * $Header: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/SuspendedReply.java,v
1.2 2002/01/03 10:49:37 hammant Exp $
  - * $Revision: 1.2 $
  - * $Date: 2002/01/03 10:49:37 $
  + * $Header: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/SuspendedReply.java,v
1.3 2002/01/07 16:24:34 hammant Exp $
  + * $Revision: 1.3 $
  + * $Date: 2002/01/07 16:24:34 $
    *
    * ====================================================================
    *
  @@ -67,9 +67,9 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
    */
  -public class SuspendedReply extends TryLaterReply {
  +public final class SuspendedReply extends TryLaterReply {
   
       /**
        * Method getReplyCode.  This is quicker than instanceof for type checking.
  
  
  
  1.1                  jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/FacadeRefHolder.java
  
  Index: FacadeRefHolder.java
  ===================================================================
  
  /*
   * $Header: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/common/FacadeRefHolder.java,v
1.1 2002/01/07 16:24:34 hammant Exp $
   * $Revision: 1.1 $
   * $Date: 2002/01/07 16:24:34 $
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999-2001 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", "Commons", 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 apache@apache.org.
   *
   * 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.commons.armi.common;
  
  import java.io.Serializable;
  
  
  /**
   * Class FacadeRefHolder
   *
   *
   * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
   * @version $Revision: 1.1 $
   */
  public final class FacadeRefHolder implements Serializable {
  
      private String mReferenceID;
      private String mObjectName;
  
  
      /**
       * Constructor FacadeRefHolder
       *
       *
       * @param referenceID
       * @param objectName
       *
       */
      public FacadeRefHolder(String referenceID, String objectName) {
          mReferenceID = referenceID;
          mObjectName = objectName;
      }
  
      /**
       * Method getReferenceID
       *
       *
       */
      public String getReferenceID() {
          return mReferenceID;
      }
  
      /**
       * Method getObjectName
       *
       *
       */
      public String getObjectName() {
          return mObjectName;
      }
  }
  
  
  
  1.6       +17 -11    jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/generator/PrimarySourceGenerator.java
  
  Index: PrimarySourceGenerator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/generator/PrimarySourceGenerator.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- PrimarySourceGenerator.java	6 Jan 2002 15:39:52 -0000	1.5
  +++ PrimarySourceGenerator.java	7 Jan 2002 16:24:34 -0000	1.6
  @@ -1,8 +1,8 @@
   
   /*
  - * $Header: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/generator/PrimarySourceGenerator.java,v
1.5 2002/01/06 15:39:52 hammant Exp $
  - * $Revision: 1.5 $
  - * $Date: 2002/01/06 15:39:52 $
  + * $Header: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/generator/PrimarySourceGenerator.java,v
1.6 2002/01/07 16:24:34 hammant Exp $
  + * $Revision: 1.6 $
  + * $Date: 2002/01/07 16:24:34 $
    *
    * ====================================================================
    *
  @@ -81,7 +81,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.5 $
  + * @version $Revision: 1.6 $
    */
   public class PrimarySourceGenerator extends AbstractMethodHandler {
   
  @@ -241,13 +241,7 @@
                                                + methodSignature.toString() + "\",args);");
                       } else {
   
  -                        boolean isFacadeRetVal = false;
  -                        for (int p = 0; p < mAdditionalFacades.length; p++) {
  -                            if (method.getReturnType().getName().equals(mAdditionalFacades[p]))
{
  -                                isFacadeRetVal = true;
  -                                break;
  -                            }
  -                        }
  +                        boolean isFacadeRetVal = isAdditionalFacade(method.getReturnType().getName());
   
                           if (isFacadeRetVal) {
                               mClassSource.println("      Object retVal = mBaseServedObject.armiProcessObjectRequestGettingFacade(\""
  @@ -377,6 +371,8 @@
               mClassSource.println("    args[" + i + "] = new Boolean(v" + i + ");");
           } else if (cn.equals("byte")) {
               mClassSource.println("    args[" + i + "] = new Byte(v" + i + ");");
  +        } else if (isAdditionalFacade(cn)) {
  +            mClassSource.println("    args[" + i + "] = mBaseServedObject.makeFacadeRefHolder(v"
+ i + ",\"" + super.encodeClassName(cn)+ "\");");
           } else {
               mClassSource.println("    args[" + i + "] = v" + i + ";");
           }
  @@ -404,4 +400,14 @@
               mClassSource.println("      return (" + rClass + ") retVal;");
           }
       }
  +
  +    private boolean isAdditionalFacade(String className) {
  +        for (int p = 0; p < mAdditionalFacades.length; p++) {
  +            if (className.equals(mAdditionalFacades[p])) {
  +                return true;
  +            }
  +        }
  +        return false;
  +    }
  +
   }
  
  
  
  1.12      +12 -7     jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/server/impl/AbstractServer.java
  
  Index: AbstractServer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/server/impl/AbstractServer.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- AbstractServer.java	6 Jan 2002 21:38:26 -0000	1.11
  +++ AbstractServer.java	7 Jan 2002 16:24:34 -0000	1.12
  @@ -1,8 +1,8 @@
   
   /*
  - * $Header: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/server/impl/AbstractServer.java,v
1.11 2002/01/06 21:38:26 hammant Exp $
  - * $Revision: 1.11 $
  - * $Date: 2002/01/06 21:38:26 $
  + * $Header: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/server/impl/AbstractServer.java,v
1.12 2002/01/07 16:24:34 hammant Exp $
  + * $Revision: 1.12 $
  + * $Date: 2002/01/07 16:24:34 $
    *
    * ====================================================================
    *
  @@ -100,7 +100,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.11 $
  + * @version $Revision: 1.12 $
    */
   public abstract class AbstractServer extends AbstractMethodHandler implements ArmiServer
{
   
  @@ -197,7 +197,7 @@
           // add method maps for main lookup-able service.
   
           HashMap mainMethodMap = new HashMap();
  -        ArmiServerInvocationHandler mainAsih = new DefaultInvocationHandler(mainMethodMap);
  +        ArmiServerInvocationHandler mainAsih = new DefaultInvocationHandler(this, asName
+ "_Main", mainMethodMap);
           mainAsih.addImplementationBean("<MAIN>", impl);
   
   
  @@ -222,9 +222,10 @@
   
           for (int x = 0; x < additionalFacades.length; x++) {
               Method methods[] = additionalFacades[x].getMethods();
  +            String encodedClassName = encodeClassName(additionalFacades[x].getName());
   
               HashMap methodMap = new HashMap();
  -            ArmiServerInvocationHandler asih = new DefaultInvocationHandler(methodMap);
  +            ArmiServerInvocationHandler asih = new DefaultInvocationHandler(this, asName
+ "_" + encodedClassName, methodMap);
   
               for (int y = 0; y < methods.length; y++) {
                   Method method = methods[y];
  @@ -234,7 +235,7 @@
                       methodMap.put(methodSignature.toString(), methods[y]);
                   }
               }
  -            String encodedClassName = encodeClassName(additionalFacades[x].getName());
  +
               mPublishedObjects.put(asName + "_" + encodedClassName, asih);
   
           }
  @@ -398,6 +399,10 @@
               ArmiServerConnection asc = (ArmiServerConnection) it.next();
               asc.endConnection();
           }
  +    }
  +
  +    public ArmiServerInvocationHandler getServerInvocationHandler(MethodRequest mr, String
objectName) {
  +        return (ArmiServerInvocationHandler) mPublishedObjects.get(mr.getPublishedServiceName()
+ "_" + objectName);
       }
   
   
  
  
  
  1.5       +27 -5     jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/server/impl/DefaultInvocationHandler.java
  
  Index: DefaultInvocationHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/server/impl/DefaultInvocationHandler.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DefaultInvocationHandler.java	6 Jan 2002 15:39:52 -0000	1.4
  +++ DefaultInvocationHandler.java	7 Jan 2002 16:24:34 -0000	1.5
  @@ -1,8 +1,8 @@
   
   /*
  - * $Header: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/server/impl/DefaultInvocationHandler.java,v
1.4 2002/01/06 15:39:52 hammant Exp $
  - * $Revision: 1.4 $
  - * $Date: 2002/01/06 15:39:52 $
  + * $Header: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/server/impl/DefaultInvocationHandler.java,v
1.5 2002/01/07 16:24:34 hammant Exp $
  + * $Revision: 1.5 $
  + * $Date: 2002/01/07 16:24:34 $
    *
    * ====================================================================
    *
  @@ -71,6 +71,7 @@
   import org.apache.commons.armi.common.ArmiRequest;
   import org.apache.commons.armi.common.ArmiInvocationException;
   import org.apache.commons.armi.common.NoSuchReferenceReply;
  +import org.apache.commons.armi.common.FacadeRefHolder;
   import org.apache.commons.armi.server.ArmiServerInvocationHandler;
   
   import java.util.HashMap;
  @@ -88,7 +89,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.4 $
  + * @version $Revision: 1.5 $
    */
   public class DefaultInvocationHandler implements ArmiServerInvocationHandler {
   
  @@ -96,6 +97,8 @@
       private HashMap mBeanRefs = new HashMap();
       private HashMap mMethodMap;
       private long mNextReference = 1;
  +    private AbstractServer mAbstractServer;
  +    private String mPublishedThing;
   
       /**
        * Constructor DefaultInvocationHandler
  @@ -105,10 +108,16 @@
        * @param methodMap
        *
        */
  -    protected DefaultInvocationHandler(HashMap methodMap) {
  +    protected DefaultInvocationHandler(AbstractServer abstractServer, String publishedThing,
HashMap methodMap) {
  +        mAbstractServer = abstractServer;
  +        mPublishedThing = publishedThing;
           mMethodMap = methodMap;
       }
   
  +    public String toString() {
  +        return "DIH:" + mPublishedThing;
  +    }
  +
   
       /**
        * Method addImplementationBean
  @@ -186,6 +195,8 @@
               if (beanImpl == null) {
                   return new NoSuchReferenceReply();
               }
  +            Object[] args = mr.getArgs();
  +            correctArgs(mr, args);
               return new MethodReply(method.invoke(beanImpl, mr.getArgs()));
           } catch (InvocationTargetException ite) {
               Throwable t = ite.getTargetException();
  @@ -202,6 +213,17 @@
               return new ExceptionReply(
                   new ArmiInvocationException(
                       "Some ServerSide exception problem :" + t.getMessage()));
  +        }
  +    }
  +
  +    private void correctArgs(MethodRequest mr, Object[] args) {
  +        for (int i = 0; i < args.length; i++) {
  +            // TODO find a faster way to do this....
  +            if(args[i] instanceof FacadeRefHolder) {
  +                FacadeRefHolder frh = (FacadeRefHolder) args[i];
  +                DefaultInvocationHandler asih = (DefaultInvocationHandler) mAbstractServer.getServerInvocationHandler(mr,
frh.getObjectName());
  +                args[i] = asih.mRefBeans.get(frh.getReferenceID());
  +            }
           }
       }
   }
  
  
  
  1.6       +10 -4     jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/test/TestClient.java
  
  Index: TestClient.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/test/TestClient.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TestClient.java	6 Jan 2002 15:39:53 -0000	1.5
  +++ TestClient.java	7 Jan 2002 16:24:34 -0000	1.6
  @@ -1,8 +1,8 @@
   
   /*
  - * $Header: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/test/TestClient.java,v
1.5 2002/01/06 15:39:53 hammant Exp $
  - * $Revision: 1.5 $
  - * $Date: 2002/01/06 15:39:53 $
  + * $Header: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/test/TestClient.java,v
1.6 2002/01/07 16:24:34 hammant Exp $
  + * $Revision: 1.6 $
  + * $Date: 2002/01/07 16:24:34 $
    *
    * ====================================================================
    *
  @@ -77,7 +77,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.5 $
  + * @version $Revision: 1.6 $
    */
   public class TestClient {
   
  @@ -120,6 +120,12 @@
   
           System.out.println("CLT: Changing name for One to '111'");
           ti2One.setName("111");
  +
  +        System.out.println("CLT: One name = '" + ti2One.getName() + "'");
  +        System.out.println("CLT: Two name = '" + ti2Two.getName() + "'");
  +
  +        System.out.println("CLT: Morphing Two's name via TestInterface");
  +        ti.morphName(ti2Two);
   
           System.out.println("CLT: One name = '" + ti2One.getName() + "'");
           System.out.println("CLT: Two name = '" + ti2Two.getName() + "'");
  
  
  
  1.3       +7 -4      jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/test/TestInterface.java
  
  Index: TestInterface.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/test/TestInterface.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestInterface.java	6 Jan 2002 15:39:53 -0000	1.2
  +++ TestInterface.java	7 Jan 2002 16:24:34 -0000	1.3
  @@ -1,8 +1,8 @@
   
   /*
  - * $Header: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/test/TestInterface.java,v
1.2 2002/01/06 15:39:53 hammant Exp $
  - * $Revision: 1.2 $
  - * $Date: 2002/01/06 15:39:53 $
  + * $Header: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/test/TestInterface.java,v
1.3 2002/01/07 16:24:34 hammant Exp $
  + * $Revision: 1.3 $
  + * $Date: 2002/01/07 16:24:34 $
    *
    * ====================================================================
    *
  @@ -73,7 +73,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version * $Revision: 1.2 $
  + * @version * $Revision: 1.3 $
    */
   public interface TestInterface {
   
  @@ -126,4 +126,7 @@
       String testSpeed2(String string);
   
       TestInterface2 makeSecondThing(String thingName);
  +
  +    void morphName(TestInterface2 forThisImpl);
  +
   }
  
  
  
  1.3       +14 -4     jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/test/TestInterfaceImpl.java
  
  Index: TestInterfaceImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/test/TestInterfaceImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestInterfaceImpl.java	6 Jan 2002 15:39:53 -0000	1.2
  +++ TestInterfaceImpl.java	7 Jan 2002 16:24:34 -0000	1.3
  @@ -1,8 +1,8 @@
   
   /*
  - * $Header: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/test/TestInterfaceImpl.java,v
1.2 2002/01/06 15:39:53 hammant Exp $
  - * $Revision: 1.2 $
  - * $Date: 2002/01/06 15:39:53 $
  + * $Header: /home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/test/TestInterfaceImpl.java,v
1.3 2002/01/07 16:24:34 hammant Exp $
  + * $Revision: 1.3 $
  + * $Date: 2002/01/07 16:24:34 $
    *
    * ====================================================================
    *
  @@ -73,7 +73,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
    */
   public class TestInterfaceImpl implements TestInterface {
   
  @@ -154,5 +154,15 @@
   
       public TestInterface2 makeSecondThing(String thingName) {
           return new TestInterface2Impl(thingName);
  +    }
  +
  +    public void morphName(TestInterface2 forThisImpl) {
  +        String name = forThisImpl.getName();
  +        StringBuffer sb = new StringBuffer();
  +        for (int i = 0; i < name.length(); i++) {
  +            sb.append(name.substring(i,i+1).toUpperCase());
  +            sb.append("_");
  +        }
  +        forThisImpl.setName(sb.toString());
       }
   }
  
  
  

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


Mime
View raw message