incubator-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vin...@apache.org
Subject cvs commit: incubator-altrmi/tools/src/java/org/apache/altrmi/tools/generator ProxyGeneratorImpl.java
Date Wed, 17 Sep 2003 16:49:59 GMT
vinayc      2003/09/17 09:49:59

  Modified:    client/impl/src/java/org/apache/altrmi/client/impl
                        AbstractClientInvocationHandler.java
                        AbstractFactory.java DefaultProxyHelper.java
               integrationtests/src/test/org/apache/altrmi/test
                        AbstractHelloTestCase.java
                        CustomSerializableParam.java
                        DummyInvocationHandler.java
               client/impl/src/java/org/apache/altrmi/client/impl/callback/stream
                        CallbackEnabledClientCustomStreamReadWriter.java
               client/impl/src/java/org/apache/altrmi/client/impl/callback/socket
                        CallbackEnabledSocketCustomStreamInvocationHandler.java
               server/impl/src/java/org/apache/altrmi/server/impl/callback
                        CallbackServerClassFactory.java
               server/impl/src/java/org/apache/altrmi/server/impl/callback/stream
                        CallbackStreamInvocationHandler.java
               client/api/src/java/org/apache/altrmi/client
                        ClientInvocationHandler.java
               server/impl/src/java/org/apache/altrmi/server/impl
                        DefaultServerSideClientContext.java
               server/impl/src/java/org/apache/altrmi/server/impl/adapters
                        InvocationHandlerAdapter.java
               tools/src/java/org/apache/altrmi/tools/generator
                        ProxyGeneratorImpl.java
  Log:
  Callback enablement ( Integration Tests for callback passes , ProxyGenerators ant task generates
callback facades ) + some code cleanup(license headers)
  
  Revision  Changes    Path
  1.2       +3 -2      incubator-altrmi/client/impl/src/java/org/apache/altrmi/client/impl/AbstractClientInvocationHandler.java
  
  Index: AbstractClientInvocationHandler.java
  ===================================================================
  RCS file: /home/cvs/incubator-altrmi/client/impl/src/java/org/apache/altrmi/client/impl/AbstractClientInvocationHandler.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AbstractClientInvocationHandler.java	28 Aug 2003 18:08:14 -0000	1.1
  +++ AbstractClientInvocationHandler.java	17 Sep 2003 16:49:57 -0000	1.2
  @@ -163,12 +163,13 @@
        * resolveArgument can handle any changes that one has to  do to the arguments being
        * marshalled to the server.
        * Noop Default behaviour.
  +     * @param remoteObjName 
        * @param objClass
        * @param obj
        * @return Object
        */
   
  -    public Object resolveArgument(String methodSignature ,Class objClass , Object obj)
  +    public Object resolveArgument(String remoteObjName, String methodSignature ,Class objClass
, Object obj)
       {
           return obj;
       }
  
  
  
  1.2       +3 -3      incubator-altrmi/client/impl/src/java/org/apache/altrmi/client/impl/AbstractFactory.java
  
  Index: AbstractFactory.java
  ===================================================================
  RCS file: /home/cvs/incubator-altrmi/client/impl/src/java/org/apache/altrmi/client/impl/AbstractFactory.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AbstractFactory.java	28 Aug 2003 18:08:14 -0000	1.1
  +++ AbstractFactory.java	17 Sep 2003 16:49:57 -0000	1.2
  @@ -395,7 +395,7 @@
   
   
   
  -    public void marshallCorrection( String methodSignature, Object[] args, Class[] argClasses
)
  +    public void marshallCorrection(String remoteObjName, String methodSignature, Object[]
args, Class[] argClasses )
       {
   
           for( int i = 0; i < args.length; i++ )
  @@ -419,7 +419,7 @@
               }
               else // Let the specific InvocationHandlers be given the last chance to modify
the arguments.
               {
  -                args[i] = m_clientInvocationHandler.resolveArgument(methodSignature,argClasses[i],args[i]);
  +                args[i] = m_clientInvocationHandler.resolveArgument(remoteObjName,methodSignature,argClasses[i],args[i]);
               }
           }
       }
  
  
  
  1.2       +3 -3      incubator-altrmi/client/impl/src/java/org/apache/altrmi/client/impl/DefaultProxyHelper.java
  
  Index: DefaultProxyHelper.java
  ===================================================================
  RCS file: /home/cvs/incubator-altrmi/client/impl/src/java/org/apache/altrmi/client/impl/DefaultProxyHelper.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultProxyHelper.java	28 Aug 2003 18:08:14 -0000	1.1
  +++ DefaultProxyHelper.java	17 Sep 2003 16:49:57 -0000	1.2
  @@ -274,7 +274,7 @@
       public Object processObjectRequest(String methodSignature, Object[] args, Class[] argClasses)
throws Throwable {
   
           try {
  -            m_factory.marshallCorrection(methodSignature, args, argClasses);
  +            m_factory.marshallCorrection(m_publishedServiceName,methodSignature, args,
argClasses);
   
               MethodRequest request = new MethodRequest(m_publishedServiceName, m_objectName,
                       methodSignature, args, m_referenceID, m_session);
  @@ -308,7 +308,7 @@
       public void processVoidRequest(String methodSignature, Object[] args, Class[] argClasses)
throws Throwable {
   
           try {
  -            m_factory.marshallCorrection(methodSignature, args, argClasses);
  +            m_factory.marshallCorrection(m_publishedServiceName,methodSignature, args,
argClasses);
   
               MethodRequest request = new MethodRequest(m_publishedServiceName, m_objectName,
                       methodSignature, args, m_referenceID, m_session);
  
  
  
  1.3       +7 -3      incubator-altrmi/integrationtests/src/test/org/apache/altrmi/test/AbstractHelloTestCase.java
  
  Index: AbstractHelloTestCase.java
  ===================================================================
  RCS file: /home/cvs/incubator-altrmi/integrationtests/src/test/org/apache/altrmi/test/AbstractHelloTestCase.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AbstractHelloTestCase.java	8 Sep 2003 06:58:54 -0000	1.2
  +++ AbstractHelloTestCase.java	17 Sep 2003 16:49:57 -0000	1.3
  @@ -341,9 +341,13 @@
           // lookup worked ?
           assertNotNull(testClient);
           
  -        CustomSerializableParam custom = new CustomSerializableParam();
  -        testClient.testCustomSerializableParameter(custom);
  -        assertNotNull(custom);
  +        CustomSerializableParam sendParam = new CustomSerializableParam();
  +        sendParam.name="sent-by-caller";
  +        CustomSerializableParam recvParam= testClient.testCustomSerializableParameter(sendParam);
  +        //test receipt of serialized value object from server
  +        assertNotNull(recvParam);
  +        //check whether its the same as one sent (server merely echos back whatever it
received)
  +        assertEquals(sendParam.name,recvParam.name);
       }
   
   }
  
  
  
  1.2       +62 -4     incubator-altrmi/integrationtests/src/test/org/apache/altrmi/test/CustomSerializableParam.java
  
  Index: CustomSerializableParam.java
  ===================================================================
  RCS file: /home/cvs/incubator-altrmi/integrationtests/src/test/org/apache/altrmi/test/CustomSerializableParam.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CustomSerializableParam.java	9 Sep 2003 18:13:40 -0000	1.1
  +++ CustomSerializableParam.java	17 Sep 2003 16:49:57 -0000	1.2
  @@ -1,6 +1,64 @@
  -package org.apache.altrmi.test;
  +/* ====================================================================
  + * The Apache Software License, Version 1.1
  + *
  + * Copyright (c) 1997-2003 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 acknowledgment:
  + *    "This product includes software developed by the
  + *    Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowledgment may appear in the software
  + *    itself, if and wherever such third-party acknowledgments
  + *    normally appear.
  + *
  + * 4. The names "Incubator", "AltRMI", 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 name, without prior written
  + *    permission of the Apache Software Foundation.
  + *
  + * 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.altrmi.test;
   import java.io.Serializable;
  -
  -public class CustomSerializableParam implements Serializable {
  -}
  +/** Serializable class for testing
  + */
  +public class CustomSerializableParam implements Serializable
  +{
  +    //a serializable attribute
  +    public String name;
  +}
  \ No newline at end of file
  
  
  
  1.2       +2 -2      incubator-altrmi/integrationtests/src/test/org/apache/altrmi/test/DummyInvocationHandler.java
  
  Index: DummyInvocationHandler.java
  ===================================================================
  RCS file: /home/cvs/incubator-altrmi/integrationtests/src/test/org/apache/altrmi/test/DummyInvocationHandler.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DummyInvocationHandler.java	28 Aug 2003 18:24:44 -0000	1.1
  +++ DummyInvocationHandler.java	17 Sep 2003 16:49:57 -0000	1.2
  @@ -130,7 +130,7 @@
           throw new java.lang.UnsupportedOperationException();
       }
   
  -    public Object resolveArgument(String methodSignature, Class inputArgumentClass, Object
inputArgumentInstance)
  +    public Object resolveArgument(String remoteObjName,String methodSignature, Class inputArgumentClass,
Object inputArgumentInstance)
       {
           throw new java.lang.UnsupportedOperationException();
       }
  
  
  
  1.4       +12 -8     incubator-altrmi/client/impl/src/java/org/apache/altrmi/client/impl/callback/stream/CallbackEnabledClientCustomStreamReadWriter.java
  
  Index: CallbackEnabledClientCustomStreamReadWriter.java
  ===================================================================
  RCS file: /home/cvs/incubator-altrmi/client/impl/src/java/org/apache/altrmi/client/impl/callback/stream/CallbackEnabledClientCustomStreamReadWriter.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- CallbackEnabledClientCustomStreamReadWriter.java	5 Sep 2003 16:21:46 -0000	1.3
  +++ CallbackEnabledClientCustomStreamReadWriter.java	17 Sep 2003 16:49:57 -0000	1.4
  @@ -60,6 +60,7 @@
   import org.apache.altrmi.common.ClientInvocationAbendReply;
   import org.apache.altrmi.common.ConnectionException;
   import org.apache.altrmi.common.ExceptionReply;
  +import org.apache.altrmi.common.MethodNameHelper;
   import org.apache.altrmi.common.Reply;
   import org.apache.altrmi.common.ReqRepBytes;
   import org.apache.altrmi.common.Request;
  @@ -314,10 +315,10 @@
        * @return boolean
        * @throws CallbackException
        */
  -    public boolean exposeObject(Object tobeExposedObject, Class tobeExposedInterface) throws
CallbackException {
  +    public boolean exposeObject(String remoteObjName, Object tobeExposedObject, Class tobeExposedInterface)
throws CallbackException {
           if (m_exposedObjPublishNameHash_.get(tobeExposedObject) != null)
               return false;
  -        String _uniquePublishedName = getUniqueNameForExposedObject(tobeExposedObject);
  +        String _uniquePublishedName = getUniqueNameForExposedObject(remoteObjName,tobeExposedInterface);
           m_exposedObjPublishNameHash_.put(tobeExposedObject, _uniquePublishedName);
           try {
               m_clientServerHostingExposedObjects.publish(tobeExposedObject, _uniquePublishedName,
tobeExposedInterface);
  @@ -330,14 +331,17 @@
       /**
        * Method getUniqueNameForExposedObject.
        *     Generate Unqiue name for the exposedObject.
  -     *  Right now its as simple as ClassName_1,ClassName_2  etc....
        * @param tobeExposedObject
        * @return String
        */
  -    private String getUniqueNameForExposedObject(Object tobeExposedObject) {
  -        m_random++;
  -        return tobeExposedObject.getClass().getName().substring(tobeExposedObject.getClass().getName().lastIndexOf(".")
+ 1) + "_" + m_random;
  -    }
  +     private String getUniqueNameForExposedObject(String remotePublishName,Class exposedInterface)

  +     {
  +     	   m_random++;
  +     	   String uniqueName=remotePublishName+"_"+MethodNameHelper.encodeClassName(exposedInterface)+"_"+m_random;
  +     	   return uniqueName;
  +     	   
  +     	   
  +     }
   
       /**
        * Method getPublishedName.
  
  
  
  1.2       +5 -4      incubator-altrmi/client/impl/src/java/org/apache/altrmi/client/impl/callback/socket/CallbackEnabledSocketCustomStreamInvocationHandler.java
  
  Index: CallbackEnabledSocketCustomStreamInvocationHandler.java
  ===================================================================
  RCS file: /home/cvs/incubator-altrmi/client/impl/src/java/org/apache/altrmi/client/impl/callback/socket/CallbackEnabledSocketCustomStreamInvocationHandler.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CallbackEnabledSocketCustomStreamInvocationHandler.java	4 Sep 2003 21:24:24 -0000	1.1
  +++ CallbackEnabledSocketCustomStreamInvocationHandler.java	17 Sep 2003 16:49:57 -0000	1.2
  @@ -111,9 +111,9 @@
           return m_callbackEnabledClientCustomStreamReadWriter;
       }
   
  -    public boolean exposeObject( Object tobeExposedObject, Class tobeExposedInterface )
throws CallbackException
  +    public boolean exposeObject( String remoteObjName,Object tobeExposedObject, Class tobeExposedInterface
) throws CallbackException
       {
  -        return m_callbackEnabledClientCustomStreamReadWriter.exposeObject( tobeExposedObject,
tobeExposedInterface );
  +        return m_callbackEnabledClientCustomStreamReadWriter.exposeObject( remoteObjName,
tobeExposedObject, tobeExposedInterface );
       }
   
       public String getPublishedName( Object tobeExposedObject )
  @@ -134,6 +134,7 @@
        * @see org.apache.altrmi.client.ClientInvocationHandler#resolveArgument(String, Class,
Object)
        */
       public Object resolveArgument(
  +        String remoteObjName,
           String methodSignature,
           Class inputArgumentClass,
           Object inputArgumentInstance)
  @@ -161,7 +162,7 @@
                   {
                       try
                       {
  -                        exposeObject( inputArgumentInstance, inputArgumentClass );
  +                        exposeObject(remoteObjName, inputArgumentInstance, inputArgumentClass
);
                       }
                       catch( CallbackException ace )
                       {
  
  
  
  1.2       +7 -7      incubator-altrmi/server/impl/src/java/org/apache/altrmi/server/impl/callback/CallbackServerClassFactory.java
  
  Index: CallbackServerClassFactory.java
  ===================================================================
  RCS file: /home/cvs/incubator-altrmi/server/impl/src/java/org/apache/altrmi/server/impl/callback/CallbackServerClassFactory.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CallbackServerClassFactory.java	4 Sep 2003 21:36:47 -0000	1.1
  +++ CallbackServerClassFactory.java	17 Sep 2003 16:49:57 -0000	1.2
  @@ -111,12 +111,12 @@
               m_session= reply.getSession();
           }
   
  -
  -        String modifiedPublishedName =
  -            publishedServiceName.substring( 0, publishedServiceName.lastIndexOf( "_" )
);
  -        Reply ar =
  +        String modifiedPublishedName = publishedServiceName.substring( 0, publishedServiceName.lastIndexOf(
"_" ) );
  +        String mainPublishName=modifiedPublishedName.substring( 0, modifiedPublishedName.lastIndexOf(
"_" ) );
  +        String facadePublishName = modifiedPublishedName.substring( modifiedPublishedName.lastIndexOf(
"_" )+1,modifiedPublishedName.length() );
  + 		Reply ar =
               m_hostContext.getInvocationHandler()
  -            .handleInvocation( new LookupRequest( modifiedPublishedName, authentication,
  +            .handleInvocation( new LookupRequest( publishedServiceName, authentication,
                                                     m_session ) );
   
           if( ar.getReplyCode() >= ReplyConstants.PROBLEMREPLY )
  @@ -143,7 +143,7 @@
                   this, m_hostContext.getInvocationHandler(),
                   publishedServiceName, "Main",
                   lr.getReferenceID(), m_session );
  -        Object retVal = getInstance( modifiedPublishedName, "Main", baseObj);
  +        Object retVal = getInstance( mainPublishName, facadePublishName, baseObj);
   
           baseObj.registerImplObject( retVal );
   
  
  
  
  1.2       +22 -3     incubator-altrmi/server/impl/src/java/org/apache/altrmi/server/impl/callback/stream/CallbackStreamInvocationHandler.java
  
  Index: CallbackStreamInvocationHandler.java
  ===================================================================
  RCS file: /home/cvs/incubator-altrmi/server/impl/src/java/org/apache/altrmi/server/impl/callback/stream/CallbackStreamInvocationHandler.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CallbackStreamInvocationHandler.java	4 Sep 2003 21:36:47 -0000	1.1
  +++ CallbackStreamInvocationHandler.java	17 Sep 2003 16:49:57 -0000	1.2
  @@ -54,10 +54,14 @@
    */
   package org.apache.altrmi.server.impl.callback.stream;
   
  +import org.apache.altrmi.client.ClientMonitor;
  +import org.apache.altrmi.client.ConnectionPinger;
   import org.apache.altrmi.client.impl.ClientStreamReadWriter;
   import org.apache.altrmi.client.impl.stream.AbstractStreamClientInvocationHandler;
  -import org.apache.altrmi.client.ConnectionPinger;
  -import org.apache.altrmi.client.ClientMonitor;
  +import org.apache.altrmi.common.OpenConnectionReply;
  +import org.apache.altrmi.common.Reply;
  +import org.apache.altrmi.common.Request;
  +import org.apache.altrmi.common.RequestConstants;
   import org.apache.altrmi.common.ThreadPool;
   
   /**
  @@ -118,5 +122,20 @@
       {
           super.setObjectReadWriter( clientStreamReadWriter );
       }
  +    
  +    /**
  +	 * @see org.apache.altrmi.client.ClientInvocationHandler#handleInvocation(Request)
  +	 */
  +	public Reply handleInvocation(Request request)
  +	{
  +        //hook into request sent out to the client, short-circuit the need to 
  +        // create an a fresh connection request    
  +		if(request.getRequestCode()==RequestConstants.OPENCONNECTIONREQUEST)
  +		{
  +			return new OpenConnectionReply();
  +		}
  +		Reply reply = super.handleInvocation(request);
  +		return reply;
  +	}
   }
   
  
  
  
  1.2       +3 -2      incubator-altrmi/client/api/src/java/org/apache/altrmi/client/ClientInvocationHandler.java
  
  Index: ClientInvocationHandler.java
  ===================================================================
  RCS file: /home/cvs/incubator-altrmi/client/api/src/java/org/apache/altrmi/client/ClientInvocationHandler.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ClientInvocationHandler.java	28 Aug 2003 18:00:29 -0000	1.1
  +++ ClientInvocationHandler.java	17 Sep 2003 16:49:58 -0000	1.2
  @@ -126,12 +126,13 @@
       /**
        * morphObject handles any changes  to the arguments being
        * marshalled to the server.
  +     * @param remoteObjName String remote objecct name
        * @param inputArgumentClass Class of the input argument
        * @param inputArgumentInstance instance of the object being marshalled to the server
        * @return Object new object that replaces the input argument.
        */
   
  -    Object resolveArgument(String methodSignature,Class inputArgumentClass, Object inputArgumentInstance);
  +    Object resolveArgument(String remoteObjName,String methodSignature,Class inputArgumentClass,
Object inputArgumentInstance);
   
       boolean isCallBackEnabled();
   
  
  
  
  1.2       +58 -1     incubator-altrmi/server/impl/src/java/org/apache/altrmi/server/impl/DefaultServerSideClientContext.java
  
  Index: DefaultServerSideClientContext.java
  ===================================================================
  RCS file: /home/cvs/incubator-altrmi/server/impl/src/java/org/apache/altrmi/server/impl/DefaultServerSideClientContext.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultServerSideClientContext.java	28 Aug 2003 18:36:06 -0000	1.1
  +++ DefaultServerSideClientContext.java	17 Sep 2003 16:49:58 -0000	1.2
  @@ -1,3 +1,57 @@
  +/* ====================================================================
  + * The Apache Software License, Version 1.1
  + *
  + * Copyright (c) 1997-2003 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 acknowledgment:
  + *    "This product includes software developed by the
  + *    Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowledgment may appear in the software
  + *    itself, if and wherever such third-party acknowledgments
  + *    normally appear.
  + *
  + * 4. The names "Incubator", "AltRMI", 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 name, without prior written
  + *    permission of the Apache Software Foundation.
  + *
  + * 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.altrmi.server.impl;
   
   import org.apache.altrmi.common.ClientContext;
  @@ -12,7 +66,10 @@
       {
           this.session = session;
           this.clientSideClientContext = clientSideClientContext;
  -        hashCode = session.hashCode() + clientSideClientContext.hashCode();
  +        if(session!=null && clientSideClientContext!=null)
  +        {
  +            hashCode = session.hashCode() + clientSideClientContext.hashCode();
  +        }
       }
   
       public int hashCode()
  
  
  
  1.2       +3 -3      incubator-altrmi/server/impl/src/java/org/apache/altrmi/server/impl/adapters/InvocationHandlerAdapter.java
  
  Index: InvocationHandlerAdapter.java
  ===================================================================
  RCS file: /home/cvs/incubator-altrmi/server/impl/src/java/org/apache/altrmi/server/impl/adapters/InvocationHandlerAdapter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- InvocationHandlerAdapter.java	28 Aug 2003 18:30:51 -0000	1.1
  +++ InvocationHandlerAdapter.java	17 Sep 2003 16:49:58 -0000	1.2
  @@ -272,7 +272,7 @@
       private Reply doMethodFacadeRequest( MethodFacadeRequest facadeRequest, Object connectionDetails
)
       {
   
  -        if (!sessionExists(facadeRequest.getSession()))
  +        if (!sessionExists(facadeRequest.getSession()) && (connectionDetails==null
||  !connectionDetails.equals("callback")))
           {
               return new NoSuchSessionReply(facadeRequest.getSession());
           }
  @@ -439,7 +439,7 @@
       private Reply doMethodRequest( MethodRequest methodRequest, Object connectionDetails
)
       {
   
  -        if (!sessionExists(methodRequest.getSession()))
  +        if (  !sessionExists(methodRequest.getSession()) && (connectionDetails==null
||  !connectionDetails.equals("callback")) )
           {
               return new NoSuchSessionReply(methodRequest.getSession());
           }
  
  
  
  1.2       +22 -1     incubator-altrmi/tools/src/java/org/apache/altrmi/tools/generator/ProxyGeneratorImpl.java
  
  Index: ProxyGeneratorImpl.java
  ===================================================================
  RCS file: /home/cvs/incubator-altrmi/tools/src/java/org/apache/altrmi/tools/generator/ProxyGeneratorImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ProxyGeneratorImpl.java	28 Aug 2003 18:40:12 -0000	1.1
  +++ ProxyGeneratorImpl.java	17 Sep 2003 16:49:59 -0000	1.2
  @@ -102,6 +102,15 @@
                   makeSource( classLoader, MethodNameHelper.encodeClassName( facade.getFacadeClass()
), new PublicationDescriptionItem[]{facade} );
               }
           }
  +        if( getCallbackFacades() != null )
  +        {
  +            for( int i = 0; i < getCallbackFacades().length; i++ )
  +            {
  +                PublicationDescriptionItem facade = getCallbackFacades()[ i ];
  +
  +                makeSource( classLoader, MethodNameHelper.encodeClassName( facade.getFacadeClass()
), new PublicationDescriptionItem[]{facade} );
  +            }
  +        }
   
       }
   
  @@ -135,6 +144,18 @@
   
                   jc.doCompile( getSrcGenDir() + File.separator + "AltrmiGenerated"
                           + getGenName() + "_" + classname + ".java" );
  +                System.out.println( jc.getCompilerMessage() );
  +            }
  +        }
  +        if( getCallbackFacades() != null )
  +        {
  +            for( int i = 0; i < getCallbackFacades().length; i++ )
  +            {
  +                String classname = MethodNameHelper.encodeClassName( getCallbackFacades()[
i ].getFacadeClass() );
  +
  +                jc.doCompile( getSrcGenDir() + File.separator + "AltrmiGenerated"
  +                        + getGenName() + "_" + classname + ".java" );
  +                System.out.println( jc.getCompilerMessage() );
               }
           }
   
  
  
  

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


Mime
View raw message