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. Only the carol.properties file is mandatory to configure CAROL. If there is no JNDI configuration in the carol.properties file, CAROL will automatically search for those configuration informations in the jndi.properties file. In this case, if there is no jndi.properties file, an Exception will be raised.
![]() | CAROL use, for JNDI conformance, the standard jndi.properties file (for only one RMI architecture activate). 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. |
All the configuration below use only the carol.properties file. You can put one of the JNDI configuration in a 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.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 those classes for RMI JRMP and JEREMIE, see below). | Yes, for all activated rmi. |
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 in 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 transactional or 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 # portable remote object delegate class # for this protocol (class name with package) carol.rmi.jrmp.PortableRemoteObjectClass =org.objectweb.carol.rmi.multi.JrmpPRODelegate # 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.
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.
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 in 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 this RMI IIOP to propagate implicitly a context (like transactional or security context) via a standard RMI IIOP 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 # 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 # 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
In the file above we see a IIOP standard configuration:
The carol.rmi.activated property is set to IIOP default and activated protocol.
The carol.rmi.iiop.PortableRemoteObjectClass property is set to com.sun.corba.se.internal.javax.rmi.PortableRemoteObject. This class is the standard Sun RMI IIOP portable remote object delegate.
JNDI is configured with classical property values
There is also non standard values (passed directly to the JVM). Those values are for 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 in CAROL is the ObjectWeb Jonathan JEREMIE personality. This personality can be used with all standard JEREMIE features. CAROL also allow this JEREMIE to propagate implicitly a context (like transactionnal or security context) via a JEREMIE handler mechanism. This section explain the general way for CAROL JEREMIE configuration in the two file jonathan.xml and carol.properties:
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>
In the file above, 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 # portable remote object delegate class # for this protocol (class name with package) carol.rmi.jeremie.PortableRemoteObjectClass =org.objectweb.carol.rmi.multi.JeremiePRODelegate # 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
In the file above we see a JEREMIE standard configuration:
The carol.rmi.activated property is set JEREMIE default and activated protocols
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.
JNDI is configured with classical property values for JEREMIE
The example below show a general RMI configuration with 3 RMI architectures configured and 2 activated (RMI IIOP and JEREMIE) and with RMI IIOP default:
Example 3-5. MULTI RMI carol.properties file
# activated and default protocol (iiop) carol.rmi.activated=iiop,jeremie ### 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 # 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 # 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 # 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