commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hamm...@apache.org
Subject cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl AbstractAltrmiFactory.java BaseServedObject.java ClientClassAltrmiFactory.java ServerClassAltrmiFactory.java
Date Sat, 02 Feb 2002 12:18:03 GMT
hammant     02/02/02 04:18:02

  Modified:    altrmi/src/java/org/apache/commons/altrmi/client/impl
                        AbstractAltrmiFactory.java BaseServedObject.java
                        ClientClassAltrmiFactory.java
                        ServerClassAltrmiFactory.java
  Log:
  alternate facades as arrays/retval now works in a more classloader aware manner.
  
  Revision  Changes    Path
  1.13      +3 -1      jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/AbstractAltrmiFactory.java
  
  Index: AbstractAltrmiFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/AbstractAltrmiFactory.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- AbstractAltrmiFactory.java	1 Feb 2002 00:16:38 -0000	1.12
  +++ AbstractAltrmiFactory.java	2 Feb 2002 12:18:02 -0000	1.13
  @@ -31,7 +31,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.12 $
  + * @version $Revision: 1.13 $
    */
   public abstract class AbstractAltrmiFactory implements AltrmiFactory {
   
  @@ -95,6 +95,8 @@
               //TODO
           }
       }
  +
  +    protected abstract Class getFacadeClass(String publishedServiceName, String objectName,
boolean beanOnly) throws AltrmiConnectionException, ClassNotFoundException;
   
       protected abstract Object getInstance(
           String publishedServiceName, String objectName, BaseServedObject baseServedObject,
  
  
  
  1.8       +3 -2      jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/BaseServedObject.java
  
  Index: BaseServedObject.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/BaseServedObject.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- BaseServedObject.java	1 Feb 2002 00:16:38 -0000	1.7
  +++ BaseServedObject.java	2 Feb 2002 12:18:02 -0000	1.8
  @@ -30,7 +30,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.7 $
  + * @version $Revision: 1.8 $
    */
   public final class BaseServedObject {
   
  @@ -130,7 +130,8 @@
               }
           } else if (reply.getReplyCode() == AltrmiReply.METHODFACADEARRAYREPLY) {
               MethodFacadeArrayReply mfar = (MethodFacadeArrayReply) reply;
  -            Class clazz = Class.forName(objNameWithoutArray.replace('$','.'));
  +            Class clazz = mAltrmiFactory.getFacadeClass(mPublishedServiceName, objNameWithoutArray,
  +                                                                  mAltrmiFactory.isBeanOnly());
               Long[] refs = mfar.getReferenceIDs();
               Object[] implBeans = (Object[]) Array.newInstance(clazz, refs.length);
   
  
  
  
  1.9       +13 -7     jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/ClientClassAltrmiFactory.java
  
  Index: ClientClassAltrmiFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/ClientClassAltrmiFactory.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ClientClassAltrmiFactory.java	30 Jan 2002 23:42:44 -0000	1.8
  +++ ClientClassAltrmiFactory.java	2 Feb 2002 12:18:02 -0000	1.9
  @@ -29,7 +29,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.8 $
  + * @version $Revision: 1.9 $
    */
   public class ClientClassAltrmiFactory extends AbstractAltrmiFactory {
   
  @@ -92,6 +92,17 @@
           return retVal;
       }
   
  +    protected Class getFacadeClass(String publishedServiceName, String objectName, boolean
beanOnly) throws AltrmiConnectionException, ClassNotFoundException {
  +        String code = "2";
  +
  +        if (beanOnly) {
  +            code = "";
  +        }
  +
  +        return Class.forName("AltrmiGenerated" + code + publishedServiceName + "_"
  +                                        + objectName);
  +    }
  +
       /**
        * Method getInstance
        *
  @@ -109,15 +120,10 @@
               boolean beanOnly)
                   throws AltrmiConnectionException {
   
  -        String code = "2";
   
  -        if (beanOnly) {
  -            code = "";
  -        }
   
           try {
  -            Class clazz = Class.forName("AltrmiGenerated" + code + publishedServiceName
+ "_"
  -                                        + objectName);
  +            Class clazz = getFacadeClass(publishedServiceName, objectName, beanOnly);
               Constructor[] constructors = clazz.getConstructors();
               Object retVal = constructors[0].newInstance(new Object[]{ baseServedObject
});
   
  
  
  
  1.11      +16 -6     jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/ServerClassAltrmiFactory.java
  
  Index: ServerClassAltrmiFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/ServerClassAltrmiFactory.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- ServerClassAltrmiFactory.java	1 Feb 2002 00:16:38 -0000	1.10
  +++ ServerClassAltrmiFactory.java	2 Feb 2002 12:18:02 -0000	1.11
  @@ -36,7 +36,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.10 $
  + * @version $Revision: 1.11 $
    */
   public class ServerClassAltrmiFactory extends AbstractAltrmiFactory {
   
  @@ -110,9 +110,7 @@
           return retVal;
       }
   
  -    protected Object getInstance(
  -            String publishedServiceName, String objectName, BaseServedObject baseServedObject,
boolean beanOnly)
  -                throws AltrmiConnectionException {
  +    protected Class getFacadeClass(String publishedServiceName, String objectName, boolean
beanOnly) throws AltrmiConnectionException, ClassNotFoundException{
   
           String code = "2";
   
  @@ -120,7 +118,6 @@
               code = "";
           }
   
  -        try {
               TransportedClassLoader tcl = null;
               String beanClassName = "AltrmiGenerated" + publishedServiceName + "_" + objectName;
               String iiClassName = "AltrmiGenerated2" + publishedServiceName + "_" + objectName;
  @@ -171,8 +168,21 @@
   
                   mPublishedServiceClassLoaders.put(beanClassName, tcl);
               }
  +            return tcl.loadClass(className);
  +    }
  +
  +    protected Object getInstance(
  +            String publishedServiceName, String objectName, BaseServedObject baseServedObject,
boolean beanOnly)
  +                throws AltrmiConnectionException {
  +
  +        String code = "2";
  +
  +        if (beanOnly) {
  +            code = "";
  +        }
   
  -            Class clazz = tcl.loadClass(className);
  +        try {
  +            Class clazz = getFacadeClass(publishedServiceName, objectName, beanOnly);
               Constructor[] constructors = clazz.getConstructors();
               Object retVal = constructors[0].newInstance(new Object[]{ baseServedObject
});
   
  
  
  

--
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