Vinay,
OK dude I have looked at the code and think you are 85% of the way
there. Overall though an excellent effort.
The problem is that the Client the way you have coded it is very
conscious of the fact that AltRMI is in the middle. It should be
transparent. Also it looks like there can only be one callback for a
published name, I think the Callback object passed back should also
hold a reference to the sessionID and referenceID, thus the client could
register many callbacks to the same event (as would likely be the case
in normal Java).
What I have done is committed your tests (after a rename and some mods,
but still in your name). If you look at the CallBackTestClient you will
see the mods that make it transparent (the goal). Given that this test
cannot complete until the thing is working, this is a true XP style test
before impl... Also the CallBackTestClient and Server use the normal
custom stream transports (so that it compiles), these you are obviously
allowed to change :-)
Go for it dude, this will be brilliant when you have finished it (but do
remember to take your time - there is no rush)...
Regards,
- Paul
>Hi,
>Attached herewith is the first Iteration of the
>*Callback* feature for *Altrmi* :->
>1. callback.patch (cvs diff for existing code)
>2. callback-new-files.zip (archive of new files to be
>add'd)
>
>Among the archives is a sample illustrating
>this new feature too.
>(callback.xml script has the essential targets
>{server^client} to run this example too)
>
>Regards,
>V i n a y
>
>
>__________________________________________________
>Do You Yahoo!?
>Yahoo! Tax Center - online filing with TurboTax
>http://taxes.yahoo.com/
>
>
>------------------------------------------------------------------------
>
>cvs -q diff (in directory
>C:\avalon\cvs\jakarta-avalon-excalibur\altrmi\src\java\org\apache\excalibur\altrmi)
>? client/impl/socket/CallbackEnabledCustomSocketStreamInvocationHandler.java
>? client/impl/socket/CallbackEnabledCustomSocketStreamHostContext.java
>? client/impl/stream/CallbackEnabledClientCustomStreamReadWriter.java
>? common/AltrmiCallbackException.java
>? common/ExposedObjectProxy.java
>? server/impl/CallbackEnabledCustomSocketStreamReadWriter.java
>? server/impl/socket/CallbackEnabledCustomSocketStreamServer.java
>Index: client/impl/BaseServedObject.java
>===================================================================
>RCS file:
>/home/cvspublic/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/BaseServedObject.java,v
>retrieving revision 1.1
>diff -r1.1 BaseServedObject.java
>29a30,33
>
>>//callback
>>import org.apache.excalibur.altrmi.common.ExposedObjectProxy;
>>import
>org.apache.excalibur.altrmi.client.impl.socket.CallbackEnabledCustomSocketStreamInvocationHandler;
>>
>47c51,54
><
>---
>
>> //<callback related>
>> private boolean mbIsCallbackAware=false;
>> private CallbackEnabledCustomSocketStreamInvocationHandler
>mCallbackEnabledCustomSocketStreamInvocationHandler=null;
>> //</callback related>
>>
>70a78,86
>
>> //<callback related>
>> if(mInvocationHandler instanceof
>CallbackEnabledCustomSocketStreamInvocationHandler)
>> {
>>
>> mCallbackEnabledCustomSocketStreamInvocationHandler =
>>
>(CallbackEnabledCustomSocketStreamInvocationHandler)mInvocationHandler;
>> mbIsCallbackAware=true;
>> }
>> //</callback related>
>>
>326a343,351
>
>> else if(mbIsCallbackAware)
>> {
>> String publishedName =
>mCallbackEnabledCustomSocketStreamInvocationHandler.getPublishedName(args[i]);
>> if(publishedName!=null)
>> {
>> ExposedObjectProxy exposedObjectProxy = new
>ExposedObjectProxy(publishedName);
>> args[i]=exposedObjectProxy;
>> }
>> }
>>
>Index: generator/ProxyGeneratorImpl.java
>===================================================================
>RCS file:
>/home/cvspublic/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/generator/ProxyGeneratorImpl.java,v
>retrieving revision 1.1
>diff -r1.1 ProxyGeneratorImpl.java
>14d13
>< import org.apache.excalibur.altrmi.test.TestInterface;
>Index: server/impl/classretrievers/PlainClassRetriever.java
>===================================================================
>RCS file:
>/home/cvspublic/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/classretrievers/PlainClassRetriever.java,v
>retrieving revision 1.1
>diff -r1.1 PlainClassRetriever.java
>60c60
>< is = mClassLoader.getResourceAsStream(thingName);
>---
>
>> is = mClassLoader.getResourceAsStream(thingName+".class");
>>
>>
>>------------------------------------------------------------------------
>>
>>--
>>To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
>>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>