Re: Connecting to a Jeri exported server without a LookupService / NamingService

Gregg Wonderly <[email protected]> Wed, 30 Jul 2008 11:17:07 -0500
Newsgroups gmane.comp.java.sun.jini
Message-ID <[email protected]>
Patrick Dowler wrote:
> Yes, you can do this... sort of.  That is, you don't need a lookup service to 
> get the proxy, but you do need the proxy.
> 
> I use JERI to comminucate between a client (java webstart app) and a server 
> (running inside a servlet). On servlet init, I start the server, export the 
> implementation, and then use an ObjectOutputStream to write the proxy into a 
> byte[]. The servlet has an http method (a URL the client knows) which 
> delivers the bytes. The client uses ObjectInputStream and casts the result to 
> the service interface. 
> 
> It took  a bit of time to figure out the minimal client-side classes to 
> support JERI (specifically, classdep includes for my ant build) as I didn't 
> want to bundle all of jsk-platform.jar with the client. I could post that if 
> it is useful. 
> 
> I am sure there are other solutions along these lines, but this seems pretty 
> minimal.

One of the choices is to just use a MarshalledObject and use the service side 
classloaders RMIClassLoaderSPI support to indicate where to download needed 
classes from.  If the proxy is really a "thin" proxy, then there's not much 
required though.

Gregg Wonderly

--------------------------------------------------------------------------
Getting Started:     http://www.jini.org/wiki/Category:Getting_Started
Community Web Site:  http://jini.org
jini-users Archive:  http://archives.java.sun.com/archives/jini-users.html
Unsubscribing:       email "signoff JINI-USERS"  to [email protected]