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

Patrick Dowler <[email protected]> Tue, 29 Jul 2008 12:38:57 -0700
Newsgroups gmane.comp.java.sun.jini
Organization National Research Council Canada
Message-ID <[email protected]>
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.

Patrick

On 2008-7-29 10:58:48 Christian Schuhegger wrote:
> Hello,
>
> is it possible to connect to a Jeri exported server (e.g. as described
> here: http://jan.newmarch.name/java/jini/tutorial/Jeri.xml
> but with TcpServerEndpoint.getInstance(9999) instead of
> TcpServerEndpoint.getInstance(0), so that I know the port number)
> by just knowing the hostname and port number without the need of using a
> LookupLocator or a similar registry?
>
> I've only found how to access the server if you have a way to
> deserialize a serialized version of the proxy as described here:
> http://markmail.org/message/5wkcyivyeeujtg6s
>
> Many thanks,



-- 

Patrick Dowler
Tel/Tél: (250) 363-6914                  | fax/télécopieur: (250) 363-0045
Canadian Astronomy Data Centre   | Centre canadien de donnees astronomiques
National Research Council Canada | Conseil national de recherches Canada
Government of Canada                  | Gouvernement du Canada
5071 West Saanich Road               | 5071, chemin West Saanich
Victoria, BC                                  | Victoria (C.-B.)

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