CAROL Library User Manual: CAROL (Common Architecture for RMI ObjectWeb Layer), a RMI manager | ||
---|---|---|
Prev | Chapter 3. CAROL Configuration | Next |
CAROL configuration is based on two properties files. The carol.properties file and the jndi.properties file. One of the carol.properties file or the jndi.properties file is mandatory to configure CAROL. If there is no JNDI configuration in the carol.properties file, CAROL will automatically search for this configuration informations inside the jndi.properties file. If there is no carol.properties, CAROL will automatically use a default values based on the jndi informations (for PortableRemoteObjectClass and NameServiceClass.
![]() | CAROL use, for JNDI conformance, the standard jndi.properties file (for only one activated RMI architecture). For multi RMI architectures with multi name services (registry and CosNaming for example) CAROL need a JNDI configuration inside the carol.properties. In this case, if, for one (and only one) of those activated RMI, the JNDI configuration missing, the jndi.properties file is used by CAROL. |
The configuration described below only use the carol.properties file. One of the JNDI configuration can be set inside the jndi.properties file, this will work with CAROL.
The carol.properties file is a standard Java properties file. All properties, in this file, follow the rules below (we suppose that XXX is the rmi name like 'jrmp', 'iiop' or 'jeremie'. For RMI IIOP configuration, please use only the name 'iiop').
Table 3-1. Carol general properties
Property name | Property value | Description | Required |
---|---|---|---|
carol.rmi.activated | 'XXX protocol-name', 'YYY potocol-name' | All rmi activated architecture name. The first (XXX) is the default rmi protocol for CAROL. This default protocol is used by the server when there is no entrant protocol. | Yes |
carol.start.all.ns | 'true', 'false' | If this property is set to 'true', CAROL will automatically start all non started and configured Name Services. | No, default: false |
carol.jvm.'property-name' | 'property-value' | All extra JVM property for all RMI (directly pass to the JVM with 'name' name and 'value' value without any verifications). This is equivalent to put -D'property-name'='property-value' in the Java JVM option. | no |
Table 3-2. Carol RMI XXX specifics properties
Property name | Property value | Description | Required |
---|---|---|---|
carol.rmi.XXX .PortableRemoteObjectClass | 'XXX portable remote object class name' | The portable remote object delegate class name for this RMI (CAROL provide implementation of those classes for RMI JRMP and JEREMIE, see below). | Yes, for all activated rmi. |
carol.rmi.XXX.NameServiceClass | 'XXX carol Name Service class name' | The Name Service class name for this RMI (CAROL provide implementation of those classes for RMI JRMP, RMI IIOP and JEREMIE, see below). | No, this property is only necessary for automatically start a Name Service for this protocol. |
carol.jndi.XXX.'property-name' | 'property-value' | All jndi properties needed for XXX name service configuration. This is equivalent to put 'property-name'='property-value' in the jndi.properties file | Yes, for 'java.naming.factory.initial' and 'java.naming.provider.url' jndi property (in the carol.properties or in the jndi.properties file) |
One of the SPI personality available/provided by CAROL is the standard Sun RMI JRMP. This personality can be used with all standard RMI JRMP features. CAROL also allow this RMI JRMP to propagate implicitly a context (like a transactional or a security context) via a RMI IIOP Interceptor like mechanism. The example below explains the general way for CAROL RMI JRMP configuration:
Example 3-1. RMI JRMP carol.properties file.
# activated protocols carol.rmi.activated=jrmp # start or not all non started # name services true/false carol.start.all.ns=true # portable remote object delegate class # for this protocol (class name with package) carol.rmi.jrmp.PortableRemoteObjectClass =org.objectweb.carol.rmi.multi.JrmpPRODelegate # Name service class for this protocol carol.rmi.jrmp.NameServiceClass =org.objectweb.carol.jndi.ns.JRMPRegistry # configuration for rmi jrmp jndi carol.jndi.jrmp.java.naming.factory.initial =com.sun.jndi.rmi.registry.RegistryContextFactory carol.jndi.jrmp.java.naming.provider.url =rmi://localhost:19570 # Protocol Interceptors initializer class # (this class is mandatory for multi rmi) carol.jvm.org.objectweb.PortableInterceptor.JRMPInitializerClass .org.objectweb.carol.rmi.jrmp.interceptor.ProtocolInterceptorInitializer # Interceptors initializer class carol.jvm.org.objectweb.PortableInterceptor.JRMPInitializerClass .org.objectweb.carol.jtests.conform.interceptor.jrmp.Initializer
In the file above we see a JRMP standard configuration:
carol.rmi.activated property is set to JRMP default and activated protocol.
carol.start.all.ns property is set to true for automatically start a RMI Registry.
The carol.rmi.jrmp.PortableRemoteObjectClass property is set to org.objectweb.carol.rmi.multi.JrmpPRODelegate. This class is provide by CAROL to simulate a RMI IIOP portable remote object delegate in JRMP.
The carol.rmi.jrmp.NameServiceClass property is set to org.objectweb.carol.jndi.ns.JRMPRegistry. This class is provide by CAROL to automatically start and stop a RMI Registry.
carol.jvm.jrmp.server.portnumber property can be set for setting the TCP port used by RMI connections. This property can be set directly to the jvm with a -Djrmp.server.portnumber='port number' property.
JNDI is configured with classical property values
There is also non standard values (passed directly to the JVM). Those values are for JRMP remote call interception with a CORBA 'portable interceptor like' mechanism through CAROL interfaces. Here there is two interception instantiation classes (org.objectweb.PortableInterceptor.JRMPInitializerClass.*): ProtocolInterceptorInitializer (provided by CAROL and mandatory for multi protocol management) and Initializer (provided by CAROL tests and not mandatory, only for this example).
One of the SPI personality available/provided by CAROL is the Sun jdk1.4 RMI IIOP. This personality can be used with all standard RMI IIOP (CORBA 2.3) features. CAROL also allows RMI IIOP to propagate implicitly a context (like a transactional or a security context) via a RMI IIOP standard Interceptor mechanism. This section explain the general way for CAROL RMI IIOP configuration:
Example 3-2. RMI IIOP carol.properties file
# activated protocols carol.rmi.activated=iiop # start or not all non started # name services true/false carol.start.all.ns=true # portable remote object delegate class # for this protocol (full class name with package) carol.rmi.iiop.PortableRemoteObjectClass =com.sun.corba.se.internal.javax.rmi.PortableRemoteObject # Name service class for this protocol carol.rmi.iiop.NameServiceClass =org.objectweb.carol.jndi.ns.IIOPCosNaming # configuration for rmi iiop jndi carol.jndi.iiop.java.naming.factory.initial =com.sun.jndi.cosnaming.CNCtxFactory carol.jndi.iiop.java.naming.provider.url =iiop://localhost:19571 # util delegate carol.jvm.javax.rmi.CORBA.UtilClass =com.sun.corba.se.internal.POA.ShutdownUtilDelegate # stub delegate carol.jvm.javax.rmi.CORBA.StubClass =com.sun.corba.se.internal.javax.rmi.CORBA.StubDelegateImpl # orb carol.jvm.org.omg.CORBA.ORBClass =com.sun.corba.se.internal.Interceptors.PIORB # orb singleton carol.jvm.org.omg.CORBA.ORBSingletonClass =com.sun.corba.se.internal.corba.ORBSingleton # Protocol Interceptors initializer class # (this class is mandatory for multi rmi) carol.jvm.org.omg.PortableInterceptor.ORBInitializerClass .org.objectweb.carol.rmi.iiop.interceptor.ProtocolInitializer # Interceptors initializer class (class name with package) carol.jvm.org.omg.PortableInterceptor.ORBInitializerClass .org.objectweb.carol.jtests.conform.interceptor.iiop.IIOPInitializer
The above file describes a IIOP standard configuration:
The carol.rmi.activated property is set to IIOP default and activated protocol.
carol.start.all.ns property is set to true for automatically start a CosNaming.
The carol.rmi.iiop.PortableRemoteObjectClass property is set to com.sun.corba.se.internal.javax.rmi.PortableRemoteObject. This class is a Sun RMI IIOP standard portable remote object delegate.
The carol.rmi.iiop.NameServiceClass property is set to org.objectweb.carol.jndi.ns.IIOPCosNaming. This class is provide by CAROL to automatically start and stop a RMI IIOP CosNaming.
JNDI is configured classical properties.
There is also non standard values (passed directly to the JVM). Those values represents standard IIOP CORBA configuration and remote call interception with a CORBA portable interceptor mechanism. Here there is two interception instantiation classes (org.objectweb.PortableInterceptor.ORBInitializerClass.*): ProtocolInitializer (provided by CAROL and mandatory for multi protocol) and IIOPInitializer (provided by CAROL tests and not mandatory, only for this example).
One of the SPI personality available/provided by CAROL is the ObjectWeb Jonathan JEREMIE personality. This personality can be used with all standard JEREMIE features. CAROL also allow JEREMIE to propagate implicitly a context (like a transactionnal or a security context) via a JEREMIE handler mechanism. This section explains the general way for CAROL JEREMIE configuration in the two jonathan.xml and carol.properties files:
Example 3-3. JEREMIE jonathan.xml file
<?xml version="1.0"?> <!DOCTYPE Configuration SYSTEM "configuration.dtd"> <CONFIGURATION> <ELEM name="DavidCarolHandler"> <ATOM class="org.objectweb.carol.rmi.jonathan.david.DavidCarolHandler"/> </ELEM> <ELEM name="david/orbs/iiop/services_handler_context/1534"> <ALIAS name="/DavidCarolHandler" /> </ELEM> <ELEM name="JeremieCarolHandler"> <ATOM class="org.objectweb.carol.rmi.jonathan.jeremie.JeremieCarolHandler"/> </ELEM> <ELEM name="jeremie/service_handler_context/1535"> <ALIAS name="/JeremieCarolHandler" /> </ELEM> <ELEM name="jeremie/stub_factories/std"> <CONFIGURATION> <ELEM name="Stub name extension"> <PROPERTY type="String" value="OW"/> </ELEM> </CONFIGURATION> </ELEM> </CONFIGURATION>
Inside The above file, JEREMIE is configured to use the OW extension for stub/skeleton and to use the CAROL protocol handler.
Example 3-4. JEREMIE carol.properties file
# activated protocols carol.rmi.activated=jeremie # start or not all non started # name services true/false carol.start.all.ns=true # portable remote object delegate class # for this protocol (class name with package) carol.rmi.jeremie.PortableRemoteObjectClass =org.objectweb.carol.rmi.multi.JeremiePRODelegate # Name service class for this protocol carol.rmi.jeremie.NameServiceClass =org.objectweb.carol.jndi.ns.JeremieRegistry # configuration for rmi jrmp jndi carol.jndi.jeremie.java.naming.factory.initial =org.objectweb.jeremie.libs.services.registry.jndi.JRMIInitialContextFactory carol.jndi.jeremie.java.naming.provider.url =jrmi://localhost:19572
The above file describes a JEREMIE standard configuration:
The carol.rmi.activated property is set to JEREMIE default and activated protocols
carol.start.all.ns property is set to true for automatically start a Jeremie Registry.
The carol.rmi.jeremie.PortableRemoteObjectClass property is set to org.objectweb.carol.rmi.multi.JeremiePRODelegate. This class is provided by CAROL to simulate a RMI IIOP portable remote object delegate in JEREMIE.
The carol.rmi.jeremie.NameServiceClass property is set to org.objectweb.carol.jndi.ns.JeremieRegistry. This class is provide by CAROL to automatically start and stop a Jeremie Registry.
JNDI is configured with classical property values for JEREMIE
The example below discribes a general RMI configuration with 3 RMI architectures configured and 2 RMI activated (RMI IIOP and JEREMIE) and with RMI IIOP default:
Example 3-5. MULTI RMI carol.propertiess file
# activated and default protocol (iiop) carol.rmi.activated=iiop,jeremie # start or not all non started # name services true/false carol.start.all.ns=true ### IIOP Configuration ### # portable remote object delegate class # for this protocol (full class name with package) carol.rmi.iiop.PortableRemoteObjectClass =com.sun.corba.se.internal.javax.rmi.PortableRemoteObject # Name service class for this protocol carol.rmi.iiop.NameServiceClass =org.objectweb.carol.jndi.ns.IIOPCosNaming # configuration for rmi iiop jndi carol.jndi.iiop.java.naming.factory.initial =com.sun.jndi.cosnaming.CNCtxFactory carol.jndi.iiop.java.naming.provider.url =iiop://localhost:19571 # util delegate carol.jvm.javax.rmi.CORBA.UtilClass =com.sun.corba.se.internal.POA.ShutdownUtilDelegate # stub delegate carol.jvm.javax.rmi.CORBA.StubClass =com.sun.corba.se.internal.javax.rmi.CORBA.StubDelegateImpl # orb carol.jvm.org.omg.CORBA.ORBClass =com.sun.corba.se.internal.Interceptors.PIORB # orb singleton carol.jvm.org.omg.CORBA.ORBSingletonClass =com.sun.corba.se.internal.corba.ORBSingleton # Protocol Interceptors initializer class # (this class is mandatory for multi rmi) carol.jvm.org.omg.PortableInterceptor.ORBInitializerClass .org.objectweb.carol.rmi.iiop.interceptor.ProtocolInitializer # Interceptors initializer class (class name with package) carol.jvm.org.omg.PortableInterceptor.ORBInitializerClass .org.objectweb.carol.jtests.conform.interceptor.iiop.IIOPInitializer ### JRMP Configuration (desactivate) ### # portable remote object delegate class$ # for this protocol (class name with package) carol.rmi.jrmp.PortableRemoteObjectClass =org.objectweb.carol.rmi.multi.JrmpPRODelegate # Name service class for this protocol carol.rmi.jrmp.NameServiceClass =org.objectweb.carol.jndi.ns.JRMPRegistry # configuration for rmi jrmp jndi carol.jndi.jrmp.java.naming.factory.initial =com.sun.jndi.rmi.registry.RegistryContextFactory carol.jndi.jrmp.java.naming.provider.url =rmi://localhost:19570 # Protocol Interceptors initializer class # (this class is mandatory for multi rmi) carol.jvm.org.objectweb.PortableInterceptor.JRMPInitializerClass .org.objectweb.carol.rmi.jrmp.interceptor.ProtocolInterceptorInitializer # Interceptors initializer class carol.jvm.org.objectweb.PortableInterceptor.JRMPInitializerClass .org.objectweb.carol.jtests.conform.interceptor.jrmp.Initializer ### JEREMIE Configuration ### # portable remote object delegate class # for this protocol (class name with package) carol.rmi.jeremie.PortableRemoteObjectClass =org.objectweb.carol.rmi.multi.JeremiePRODelegate # Name service class for this protocol carol.rmi.jeremie.NameServiceClass =org.objectweb.carol.jndi.ns.JeremieRegistry # configuration for rmi jrmp jndi carol.jndi.jeremie.java.naming.factory.initial =org.objectweb.jeremie.libs.services.registry.jndi.JRMIInitialContextFactory carol.jndi.jeremie.java.naming.provider.url =jrmi://localhost:19572