Re: How To get port of the RMI Server?
Niclas Hedhman <[email protected]> Fri, 17 Apr 2009 12:52:24 +0800
| Newsgroups | gmane.comp.java.sun.rmi |
|---|---|
| Message-ID | <[email protected]> |
On Fri, Apr 17, 2009 at 5:49 AM, Tony Obermeit <[email protected]> wrote: > This is very useful to me, thanks. > > When using the constructor that allows a specific port number to be > specified, what happens if you want to have multiple remote objects > (say RemoteEmployee, RemoteDepartment, RemoteJobClassification, > etc)... Do you need a separate port for each remote object, or is it > ok to have multiple objects on a single port. > > Is there are situation / throughput level that would cause you to use > more than a single port? =A0Any guidance appreciated. By default, RMI will manage ports for you. There can be any number of remote objects per port, they all have an ObjectID. And the RMI client will make additional connections when multiple concurrent requests are happening, but in general are trying to reuse existing connections. Another common misconception is that each remote object needs to be registered in RMI Registry or JNDI. In fact, that is not at all needed. Normally only used as bootstrap, but you could transfer the serialized Stub to the client by any digital transport; your own socket, email, http request, avian carriers... And when you have a reference to an exported remote object being serialized, the Stub will be the replacement and sent across in the MarshalledObject. You can also provide Server and Client socket factories for more control. Cheers --=20 Niclas Hedhman, Software Developer http://www.qi4j.org - New Energy for Java I live here; http://tinyurl.com/2qq9er I work here; http://tinyurl.com/2ymelc I relax here; http://tinyurl.com/2cgsug =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 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