Re: Different Sockets on Different Ports

Peter Jones <[email protected]> Fri, 27 Mar 2009 17:48:50 -0400
Newsgroups gmane.comp.java.sun.rmi
Message-ID <20090327214850.GA8681@east>
I realized that I should probably point out that JRMP's limitation of
only being able to export a given object once at a time is related to
its API/semantics in certain ways, one way being the implicit
replacement of a remote object with its stub in remote invocations'
arguments and results (if the same object could be exported more than
once, which stub should it be replaced with, in general?).  With the
suggestion below, any assumptions about implicit stub replacement, if
any, would need to be considered.  (By contrast, JERI does not do such
implicit impl-to-stub replacement, but it is not limited to exporting
an object only once at a time.)

-- Peter


On Wed, Mar 25, 2009 at 02:35:33PM -0400, Peter Jones wrote:
> 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