rmi, two binding methods, what differences?

J

John_Woo

Hi,

I'm wondering, which better/differences, in the following two rmi
binding methods:

A.
java.rmi.registry.LocateRegistry.createRegistry(defport);
Services server = new ServicesImpl();
Naming.rebind("rmi://ahost:aport/aService", server);

B.
Registry registry = LocateRegistry.getRegistry();
registry.rebind("aName", astubObject);

It seems A has to use a port, which may need a special setting over
firewall; for B, what's the port number?
 
S

staudinger

John_Woo said:
B.
Registry registry = LocateRegistry.getRegistry();
registry.rebind("aName", astubObject);

It seems A has to use a port, which may need a special setting over
firewall; for B, what's the port number?

1099 by default.
 
E

EJP

John_Woo said:
what about if 1099 already in used?

It shouldn't be because it is reserved by IANA for the RMI Registry. So
if it's in use it *should* mean that the RMI Registry is already running.
what significant difference between A & B?

The significant difference is that A starts the registry on port
'defport' and B assumes it is already running on port 1099.
 
J

John_Woo

EJP said:
It shouldn't be because it is reserved by IANA for the RMI Registry. So
if it's in use it *should* mean that the RMI Registry is already running.


The significant difference is that A starts the registry on port
'defport' and B assumes it is already running on port 1099.

Thanks lots,

the port 1099, in my unix, may already be used by other app (not java).
in this case,
how would you think the default port for rmi?

John
 
E

EJP

John_Woo said:
the port 1099, in my unix, may already be used by other app (not java).
in this case,
how would you think the default port for rmi?

I don't understand the question but I've already told you that port 1099
is reserved by IANA, which is the Internet Assigned Numbers Authority,
for the RMI Registry. So any other application that is using 1099 is
non-compliant and should be fixed or trashed.

If you can't get the application using 1099 fixed, use another number,
obviously.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top