Arvind
Arvind

Reputation: 6474

java- what is the property name for setting RMI port via System.setProperty command

what is the property name for setting RMI port via System.setProperty command

I understand that the property for setting RMI policy file is "java.security.policy"

I would like to know the property for setting RMI port.

Upvotes: 0

Views: 888

Answers (1)

ritorujon
ritorujon

Reputation: 61

You can set the port for exporting during the object export: UnicastRemoteObject.exportObject((Remote obj, int port)
I don't think that there is a way to set it globally to one specific port (default is 0 -> dynamic allocation).

But if you meant the activator port, then it's: "java.rmi.activation.port" System.setProperty("java.rmi.activation.port", port)

Reference: http://docs.oracle.com/javase/6/docs/technotes/guides/rmi/javarmiproperties.html

Hope that helps...

Upvotes: 2

Related Questions