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/test CodedProxyTest.java TestInterface.java TestInterfaceImpl.java
Date Wed, 06 Mar 2002 12:52:07 GMT
hammant     02/03/06 04:52:07

  Modified:    altrmi/src/java/org/apache/commons/altrmi/client/impl
                        BaseServedObject.java
               altrmi/src/java/org/apache/commons/altrmi/generator
                        ProxyGeneratorImpl.java
               altrmi/src/java/org/apache/commons/altrmi/server/impl/adapters
                        InvocationHandlerAdapter.java
               altrmi/src/java/org/apache/commons/altrmi/test
                        CodedProxyTest.java TestInterface.java
                        TestInterfaceImpl.java
  Log:
  cater for int and null return types
  
  Revision  Changes    Path
  1.10      +7 -1      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.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- BaseServedObject.java	25 Feb 2002 20:32:56 -0000	1.9
  +++ BaseServedObject.java	6 Mar 2002 12:52:07 -0000	1.10
  @@ -30,7 +30,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.9 $
  + * @version $Revision: 1.10 $
    */
   public final class BaseServedObject {
   
  @@ -113,6 +113,12 @@
           if (reply.getReplyCode() == AltrmiReply.METHODFACADEREPLY) {
               MethodFacadeReply mfr = (MethodFacadeReply) reply;
               Long ref = mfr.getReferenceID();
  +
  +            // it might be that the return value was intended to be null.
  +            if (ref == null) {
  +                return null;
  +            }
  +
               Object implBean = mAltrmiFactory.getImplObj(ref);
   
               if (implBean == null) {
  
  
  
  1.5       +2 -2      jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/generator/ProxyGeneratorImpl.java
  
  Index: ProxyGeneratorImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/generator/ProxyGeneratorImpl.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ProxyGeneratorImpl.java	25 Feb 2002 20:32:56 -0000	1.4
  +++ ProxyGeneratorImpl.java	6 Mar 2002 12:52:07 -0000	1.5
  @@ -32,7 +32,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 ProxyGeneratorImpl extends AbstractMethodHandler implements ProxyGenerator
{
   
  @@ -469,7 +469,7 @@
   
           if (cn.equals("boolean")) {
               mClassSource.println("      return ((Boolean) retVal).booleanValue();");
  -        } else if (cn.equals("integer")) {
  +        } else if (cn.equals("int")) {
               mClassSource.println("      return ((Integer) retVal).intValue();");
           } else if (cn.equals("short")) {
               mClassSource.println("      return ((Short) retVal).shortValue();");
  
  
  
  1.2       +10 -4     jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/adapters/InvocationHandlerAdapter.java
  
  Index: InvocationHandlerAdapter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/adapters/InvocationHandlerAdapter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- InvocationHandlerAdapter.java	4 Feb 2002 12:29:03 -0000	1.1
  +++ InvocationHandlerAdapter.java	6 Mar 2002 12:52:07 -0000	1.2
  @@ -51,7 +51,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
   public class InvocationHandlerAdapter extends PublicationAdapter
           implements AltrmiInvocationHandler {
  @@ -127,9 +127,9 @@
                       new AltrmiInvocationException("TODO - you dirty rat/hacker"));
               }
   
  -            MethodInvocationHandler asih =
  +            MethodInvocationHandler mih =
                   (MethodInvocationHandler) mPublishedObjects.get(publishedThing);
  -            AltrmiReply ar = asih.handleInvocation(mFacReq);
  +            AltrmiReply ar = mih.handleInvocation(mFacReq);
   
               if (ar.getReplyCode() == AltrmiReply.EXCEPTIONREPLY) {
                   return ar;
  @@ -141,7 +141,13 @@
   
               Object replyObject = ((MethodReply) ar).getReplyObject();
   
  -            if (!replyObject.getClass().isArray()) {
  +            if ( replyObject == null) {
  +                System.out.println("---> " + ar + " " + mFacReq.getMethodSignature());
  +            }
  +
  +            if (replyObject == null ) {
  +                return new MethodFacadeReply(null); // null passing
  +            } else if (!replyObject.getClass().isArray()) {
   
                   Object beanImpl = replyObject;
   
  
  
  
  1.3       +3 -3      jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/test/CodedProxyTest.java
  
  Index: CodedProxyTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/test/CodedProxyTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CodedProxyTest.java	1 Feb 2002 14:46:08 -0000	1.2
  +++ CodedProxyTest.java	6 Mar 2002 12:52:07 -0000	1.3
  @@ -16,7 +16,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 CodedProxyTest {
   
  @@ -66,8 +66,8 @@
            * @param greeting
            *
            */
  -        public void hello2(int greeting) {
  -            mActualImpl.hello2(greeting);
  +        public int hello2(int greeting) {
  +            return mActualImpl.hello2(greeting);
           }
   
           /**
  
  
  
  1.4       +2 -2      jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/test/TestInterface.java
  
  Index: TestInterface.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/test/TestInterface.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TestInterface.java	1 Feb 2002 00:16:38 -0000	1.3
  +++ TestInterface.java	6 Mar 2002 12:52:07 -0000	1.4
  @@ -20,7 +20,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 interface TestInterface {
   
  @@ -40,7 +40,7 @@
        * @param greeting
        *
        */
  -    void hello2(int greeting);
  +    int hello2(int greeting);
   
       /**
        * Method hello3
  
  
  
  1.4       +3 -2      jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/test/TestInterfaceImpl.java
  
  Index: TestInterfaceImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/test/TestInterfaceImpl.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TestInterfaceImpl.java	1 Feb 2002 00:16:38 -0000	1.3
  +++ TestInterfaceImpl.java	6 Mar 2002 12:52:07 -0000	1.4
  @@ -22,7 +22,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 TestInterfaceImpl implements TestInterface {
   
  @@ -47,8 +47,9 @@
        * @param greeting
        *
        */
  -    public void hello2(int greeting) {
  +    public int hello2(int greeting) {
           System.out.println("SVR: Greeting2 (int)   : " + greeting);
  +        return greeting;
       }
   
       /**
  
  
  

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