JOnAS provides a multi-protocol support through the integration of the CAROL component.
Supported communication protocols are the following:
RMI/JRMP is the JRE implementation of RMI on the JRMP protocol. This is the default communication protocol.
RMI/IIOP is the JacORB implementation of RMI over the IIOP protocol.
IRMI is an RMI implementation that can be used with Open Source
JDK that doesn't provide com.sun.*
classes.
For each of these protocols, the clustering of RMI objects can be enabled with the component CMI.
The choice of the protocol is made in the
carol.protocols property of
carol.properties
file in JONAS_BASE/conf
directory.
carol.protocols=jrmp
carol.protocols=jrmp carol.jrmp.url=rmi://localhost:1099 carol.jvm.rmi.local.call=false carol.jvm.rmi.local.registry=false carol.jrmp.server.port=0 carol.jrmp.interfaces.bind.single=false
choice of the protocol or list of protocols |
|
connexion url to the RMI registry the hostname (localhost) and port number must be changed if needed. In a distributed configuration changing the hostname is mandatory. |
|
if true local calls are optimized: calls to methods of the remote interface are treated as call to local methods (it is not always possible depending on the packaging of the application). |
|
if true a local Naming context is used. This must be used only with a collocated registry and it is mandatory when the jonas.security.manager property of jonas.properties is set to true. |
|
exported objects will listen on this port for remote method invocations. 0 means random port. Specify a port may be useful when the server run behind a firewall. |
|
if true use only a single interface (choosen from the url) when creating the registry. False means use all interfaces available. |
The JacORB implementation of RMI over the IIOP is used. The
configuration file of JacORB is the $JONAS_BASE/conf/jacorb.properties
file.
As for the other protocols RMI over IIOP is ready to used in the
default distribution. It is only for tuning purpose that the $JONAS_BASE/conf/jacorb.properties
file
must be customized.
By default the CORBA Naming service is run using the port 2001 (as
it is set in the carol.properties
file)
So the only thing to do for working in RMI over IIOP is to set the property protocols in carol.properties:
carol.protocols=iiop # RMI IIOP URL carol.iiop.url=iiop://localhost:2001 carol.iiop.server.port=0 carol.iiop.server.sslport=2003 carol.iiop.PortableRemoteObjectClass=org.ow2.jonas.registry.carol.delegate.JacORBPRODelegate
carol.protocols=irmi carol.irmi.url=rmi://localhost:1098 carol.irmi.server.port=0 carol.irmi.interfaces.bind.single=false
for irmi the default port is 1098 |
||||
exported objects will listen on this port for remote method invocations:0 means random port.
|
||||
if true use only a single interface when creating the registry (specified in carol.irmi.url property). Default configuration = false(use all interfaces available) |
CMI is the component to use for clustering purpose. It is embedded in the component CAROL.
CMI is just composed of wrappers and interceptors and is fully independant of the implementation of protocol. CMI relies on JGroups group-communication protocol for ensuring the replication of the cluster view. CMI provides jndi high availability, the load-balancing and fail-over at the EJB level.
For using CMI with a protocol (in addition to the activation of
service cmi), a property must be added in
carol.properties
:
carol.jrmp.cmi=true carol.iiop.cmi=true carol.irmi.cmi=false
Note | |
---|---|
By default, the property is set at true. |
JOnAS can be configured to use several protocols simultaneously.
To do this, just specify a comma-separated list of protocols in the
carol.protocols property of the carol.properties
file. For example:
carol.protocols=iiop,jrmp carol.jrmp.url=rmi://localhost:1099 carol.iiop.url=iiop://localhost:2001
Caution | |
---|---|
When iiop is used in a multiprotocol configuration, it must appear at the first position in the protocol list. |