Re: Bootstrap stubs with fixed UUIDs

Peter Jones <[email protected]> Wed, 18 Mar 2009 14:55:23 -0400
Newsgroups gmane.comp.java.sun.jini
Message-ID <20090318185522.GA4066@east>
Something like that, yes.  You may want to include TrustEquivalence in
the proxy interfaces as well, at least BasicInvocationHandler supports
it.  Also, for a remote object with a fixed/well-known port and UUID,
you probably don't mean to enable DGC (i.e. pass true for the third
argument to the BasicObjectEndpoint constructor).

-- Peter


On Tue, Mar 17, 2009 at 04:35:36PM -0600, Esmond Pitt wrote:
> Thanks Peter. So assuming my remote interface is RemoteSubject, it would go
> something like this?
> 
> 	Class<?>[] intfs = {
> 		// fill in the remote interface(s) to be implemented
> 		RemoteMethodControl.class,
> 		RemoteSubject.class
> 	};
> 	// Build a bootstrap stub
> 	Endpoint	ep = SslEndpoint.getInstance("localhost", RemoteSubject.PORT);
> 	ObjectEndpoint	oe = new BasicObjectEndpoint(ep, RemoteSubject.UUID, true);
> 	InvocationHandler	ih = new BasicInvocationHandler(oe, clientConstraints);
> 	Remote proxy =
> (Remote)Proxy.newProxyInstance(RemoteMethodControl.class.getClassLoader(),
> intfs, ih);
> 	RemoteSubject	rs = (RemoteSubject)pp.prepareProxy(proxy);
> 
> Seems to work.
> 
> TIA
> 
> EJP

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