avalon-phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Hammant <Paul_Hamm...@yahoo.com>
Subject Re: Inter-SAR communication
Date Sun, 13 Oct 2002 13:56:54 GMT
Daniel,

>>Until some formal structure is written, we are tied to something like
>>AltRMI.  It is used bte cornerstone publisher and subscriber blocks as
>>well as the auto publisher.  Unfortunately it means an over-sockets
>>mechansim until I can work out how to get and instance registered in
>>JNDI.  I'm sure it must be possible, but can'd see how to do it.
>>    
>>
>
>Have you considered implementing an Interceptor that first tries to use
>Reflection to call the appropriate method and upon failure use sockets?
>This could be accomplished with Proxies as of J2SDK 1.3.
>
The trouble with a speculative attempt to use something via reflection 
is that phoenix will quite neatly hide things ffrom each other.  Thus an 
AltRMI client that wanted to do (simplified) ...

    ThingService ts;
    try {
        ts = (ThingService) Factory.lookup("ThingService");
    } catch (NotFoundException nfe) {
        ts = (ThingService) OverSocketsFactory.lookup("ThingService", 
"myhost:1900");
    }
    ts.thing("Hi");

.... it would never work on the local lookup in situations with 
classloader trees in that thecontainer hides the Factory class in a 
distant classloader to the client such that there are effectively more 
than one Factory class in the partiular VM.  They are of course 
effectively completey different classes.

Using Reflection is the solution I have chosen for the 'Registry' 
interim solution booked into CVS for AltRMI.

If that registry is mounted low in a classloader tree, and once only, 
then it will be visible to multiple classloaders higher up the tree. 
 The client side logic uses reflection to narrow to it, but will not 
fail if it can't find it at all.  In that scenario it will just use the 
sockets type to make the same connection albeit slower.

Actually on the issue of speed, it appears that local-loop sockets is 
quicker than pipes in JDK 1.4.  I'll have to do some debuggung to 
determine if that is true.  It never used to be in 1.3.

This Registry thing I have made, will be replaced later with a pure JNDI 
solution (if I can get it working).  The point being that no jar will 
need to be mounted at a low point in the tree as the JNDI classes are 
already in J2SE (the primordial classloader).  It all depends on whether 
I can place instances perfectly in a VM-wide visible JNDI tree rather 
than serialized refs.  Many hint that it is possible...

>Is there currently a JNDI provider that comes with Phoenix?
>  
>
Nope.

-ph


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


Mime
View raw message