Re: Jini Service as local object reference
Richard Nicholson <[email protected]> Thu, 27 Dec 2007 13:06:12 +0000
| Newsgroups | gmane.comp.java.sun.jini |
|---|---|
| Message-ID | <[email protected]> |
Francisco, Yet another alternative would be to have a look at Newton (see newton.codecauldron.org). Here, both ClientService and ServerService are dynamically deployable OSGi based services. To use Jini/JERI simply specify a jini.binding in the system description (SCA SCDL document). Alternatively, to wire the services together locally, substitute the jini.binding, with an osgi.binding reference in the SCA SCDL system description. If interested, for further info ping the Newton development list. Regards Richard On 26 Dec 2007, at 12:57, Francisco Dário Mourão wrote: > Hi there, > I’m trying to develop a service which can be configured to run as > Jini service or to run as local object, when used by a client > application. > The reason is that I want to remove the RMI overhead of a method > call when, in a specific environment, I know that I’ll always use > the service locally. > > To be more specific: > I launch an environment by launching several services. For instance: > ClientService and ServerService (ClientService acting as client of > ServerService). > On an environment type A: I launch a ClientService on host1 and > ServerService on host2 (Both Jini services) > On an environment type B: I launch a ClientService and ServerService > on host1 (Both Jini services) > What I want to do is to improve performance for type B environments, > by configuring ServerService to run as a “local service”, and thus > eliminate the RMI overhead of ClientService to ServerService method > calls and ServerService event invocations to ClientService. > > When ServerService run as Jini, I’m creating a pure RMI proxy for > the implementation: > > serviceImplementation = new ServerServiceImpl(this); > proxy = (IService) exporter.export(serviceImplementation); > > … where exporter is configured like this: > > /* Exporter for the server proxy */ > exporter = new BasicJeriExporter(TcpServerEndpoint.getInstance(0), > new BasicILFactory()); > > > What should I do to have ClientService to use ServerService as if it > were a local object reference? > At a first glance you could say that to accomplish what I want, I > would simply have to make ServerService proxy = serviceImplementation: > > serviceImplementation = new ServerServiceImpl(this); > proxy = (IService) serviceImplementation; > > > That was what I thought too. The problem is that my > serviceImplementation is not Serializable!!! > > Does anyone know how can I overcome this problem? > Should I implement a LocalProxy which implements Serializable? But > how can it reference the serviceImplementation when > serviceImplementation is not serializable? > > Thanx for the help. > > > > > > > > > > > > > > _______________________________________________________________________ > This email has been scanned by both Message Labs and Paremus > internal systems for viruses and inappropriate attachments. Email > suspected of carrying a virus payload or inappropriate attachment > will not be delivered to you, and the sender will receive an > appropriate warning notice. > _______________________________________________________________________ > -------------------------------------------------------------------------- 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] _______________________________________________________________________ Paremus Limited. Registered in England No. 4181472 Registered Office: St Alphage House, 2 Fore Street, London, EC2Y 5DH Postal Address: 107-111 Fleet Street, London, EC4A 2AB The information transmitted is intended only for the person(s) or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. _______________________________________________________________________ -------------------------------------------------------------------------- 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]