Re: Different Sockets on Different Ports

Peter Jones <[email protected]> Wed, 25 Mar 2009 14:35:33 -0400
Newsgroups gmane.comp.java.sun.rmi
Message-ID <20090325183533.GA7673@east>
With JRMP, you cannot export the same object (by ==) more than once at
the same time.  Perhaps you could, however, export different objects
that all delegate to the same remote object-- say, an instance of an
inner class of the remote object's class that forwards all remote
methods to the enclosing instance?

-- Peter


On Thu, Mar 19, 2009 at 03:00:58PM -0700, Robert DiFalco wrote:
> Sorry, the important part I forgot to mention -- without having multiple
> instances for each remote object. For example if I have an object called
> Server, I would like there to be only one instance of it even if both
> protocols are involved. 
> 
> Can I just export the same instance twice with different factories? 
> 
> -----Original Message-----
> From: Robert DiFalco [mailto:[email protected]] 
> Sent: Thursday, March 19, 2009 1:57 PM
> To: [email protected]
> Subject: Different Sockets on Different Ports
> 
> I have a scenario where I need different clients to use different
> protocols. The simplest way to think about this is that I have some
> clients that will use SSL and others that will not. I assumed I could
> create two different RmiSocketFactories and just have them listen on
> different ports - SSL on one and plain on another and just configure the
> clients appropriately to communicate with the correct port based on its
> protocol. However, since these factories act as a singleton in the Java
> implementation, I have not been able to find a straight forward way to
> do this. Any pointers? Different approaches?
> 
> TIA, 
> 
> Robert
> 

===========================================================================
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff RMI-USERS".  For general help, send email to
[email protected] and include in the body of the message "help".

For a list of frequently asked RMI questions please refer to:
http://java.sun.com/j2se/1.3/docs/guide/rmi/faq.html

To view past RMI-USERS postings, please see:
http://archives.java.sun.com/archives/rmi-users.html