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 three properties files. The carol-defaults.properties file, the carol.properties file and the jndi.properties file. The carol-defaults.properties file is mandatory to configure CAROL (Note that this file is embedded in the carol jar file). Carol load first the default file properties and erase all configuration property with the property find in the jndi file configuration and after with the property find in the carol file configuration.
![]() | If there is an url property in the jndi.properties, the rmi name of the url is use instead of the carol-defaults.properties configured one. By defaults, in the carol.properties, the only configuration needed is the activated rmi configuration. |
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','jeremie','cmi' or 'lmi'. For all those defaults provided rmi protocol, please use those names.
Table 3-1. Carol general properties
Property name | Property value | Description | Required |
---|---|---|---|
carol.rmi.activated | 'XXX protocol-name', 'YYY protocol-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. | No, default: jrmp |
carol.start.ns | 'true', 'false' | If this property is set to 'true', CAROL will automatically start all non started and configured Name Services. | No, default: true |
carol.start.rmi | 'true', 'false' | If this property is false, the jvm PortableRemoteObjectDelegate will be used instead of the carol one (Embedded server for example). | No, default: true |
carol.start.jndi | 'true', 'false' | If this property is false, the jvm JNDI naming will be used instead of the carol one (Embedded server for example). | No, default: true |
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 |
carol.jvm.java.naming .factory.url.pkgs | 'pkgs value' | Set the jndi pkgs property. Note that this property can not be configured by carol.jndi.XXX. property | 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,JEREMIE LMI and CMI, see below). | No, There is a default for each rmi provided by carol. |
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 and there is a default for each rmi provided by carol. |
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 | No, there is defaults for each rmi provided by carol. |
One of the SPI personality provided by CAROL is the standard Sun RMI JRMP. This personality can be used with all standard RMI JRMP features. CAROL allow implicit context propagation with RMI JRMP (like a transactional or a security context) via a RMI IIOP Interceptors 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 # Example of 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, note that nothing is needed except custom interceptors configuration. You can customized your configuration with:
Table 3-3. Carol RMI JRMP specifics properties
Property name | Property value | Description | Required |
---|---|---|---|
carol.rmi.jrmp. PortableRemoteObjectClass | 'JRMP portable remote object class name' | JRMP implementation of the Portable Remote Object class name | No, there is a default for JRMP |
carol.rmi.jrmp. NameServiceClass | 'JRMP carol Name Service class name' | JRMP implementation of the Carol name service | No, there is a default for JRMP based on the registry |
carol.jndi.jrmp. 'jndi property-name' | 'jndi property-value' | No, there is defaults for JRMP | |
carol.jvm.jrmp. server.portnumber | 'jrmp port number' | All jndi properties needed for XXX name service configuration. This is equivalent to put 'property-name'='property-value' in the jndi.properties file | No, there is a default for JRMP (0) |
carol.jvm.org. objectweb. PortableInterceptor. JRMPInitializerClass. 'jrmp initializer name' | '' (empty) | Initializer for JRMP inteceptors | No, there is defaults for JRMP. If there is a multi protocol configuration, CAROL automaticaly put interceptors for multi protocol management |
One of the SPI personality provided by CAROL is the standard Sun RMI IIOP. This personality can be used with all standard RMI IIOP features. CAROL allow implicit context propagation with RMI IIOP (like a transactional or a security context) via a RMI IIOP Interceptors mechanism. The example below explains the general way for CAROL RMI IIOP configuration:
Example 3-2. RMI IIOP carol.properties file.
# activated protocols carol.rmi.activated=iiop # Example of 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, note that nothing is needed except custom interceptors configuration. You can customized your configuration with:
Table 3-4. Carol RMI IIOP specifics properties
Property name | Property value | Description | Required |
---|---|---|---|
carol.rmi.iiop. PortableRemoteObjectClass | 'IIOP portable remote object class name' | IIOP implementation of the Portable Remote Object class name | No, there is a default for IIOP |
carol.rmi.iiop. NameServiceClass | 'IIOP carol Name Service class name' | IIOP implementation of the Carol name service | No, there is a default for IIOP based on the tnameserv CosNaming |
carol.jndi.iiop. 'jndi property-name' | 'jndi property-value' | No, there is defaults for IIOP | |
carol.jvm.org.objectweb. PortableInterceptor. IIOPInitializerClass. 'iiop initializer name' | '' (empty) | Initializer for IIOP inteceptors | No, there is defaults for IIOP. If there is a multi protocol configuration, CAROL automaticaly put interceptors for multi protocol management |
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
In the file above we see a JEREMIE standard configuration, note that nothing is needed except custom interceptors configuration. You can customized your configuration with:
Table 3-5. Carol RMI JEREMIE specifics properties
Property name | Property value | Description | Required |
---|---|---|---|
carol.rmi.jeremie. PortableRemoteObjectClass | 'JEREMIE portable remote object class name' | JEREMIE implementation of the Portable Remote Object class name | No, there is a default for JEREMIE |
carol.rmi.jeremie. NameServiceClass | 'JEREMIE carol Name Service class name' | JEREMIE implementation of the Carol name service | No, there is a default for JEREMIE based on the jeremie registry |
carol.jndi.jeremie. 'jndi property-name' | 'jndi property-value' | No, there is defaults for JEREMIE |
One of the SPI personality available/provided by CAROL is the CAROL LMI personality. This personality is for, an only for, local methods call. With this personality, jndi register (and return) local java references. The Referenceable mechanism is also provide in LMI context. For the moment, LMI is only tested in a non multi protocol environment.
Example 3-5. LMI carol.properties file
# activated protocols carol.rmi.activated=lmi
In the file above we see a LMI standard configuration, note that nothing is needed. You can customized your configuration with:
Table 3-6. Carol RMI LMI specifics properties
Property name | Property value | Description | Required |
---|---|---|---|
carol.rmi.lmi. PortableRemoteObjectClass | 'LMI portable remote object class name' | LMI implementation of the Portable Remote Object class name | No, there is a default for LMI |
carol.rmi.lmi. NameServiceClass | 'LMI carol Name Service class name' | LMI implementation of the Carol name service (fake) | No, there is a default for LMI based on a fake registry service |
carol.jndi.lmi. 'jndi property-name' | 'jndi property-value' | No, there is defaults for LMI |
The example below describes a general RMI configuration with 3 RMI architectures configured and 2 RMI activated (RMI IIOP and JEREMIE) and with RMI IIOP default:
Example 3-6. MULTI RMI carol.propertiess file
# carol properties # (note that for this configuration only this # property is needed) carol.rmi.activated=iiop,jeremie # start or not all non started name services carol.start.ns=true # use carol rmi (Multi PORD) carol.start.rmi=true # use carol naming (Multi JNDI) carol.start.jndi=true ################################################### # Configuration for Rmi JRMP # ################################################### # portable remote object delegate class 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 # here, for jndi we take the jndi.properties but # we can make some : # configuration for rmi jrmp jndi # java.naming.factory.initial property carol.jndi.jrmp.java.naming.factory.initial =com.sun.jndi.rmi.registry.RegistryContextFactory # java.naming.provider.url property carol.jndi.jrmp.java.naming.provider.url =rmi://localhost:1099 # port number carol.jvm.jrmp.server.portnumber=10 #################################################### # Configuration for Rmi IIOP # #################################################### # portable remote object delegate class for this protocol 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 jrmp jndi # java.naming.factory.initial property carol.jndi.iiop.java.naming.factory.initial =org.objectweb.carol.jndi.iiop.IIOPReferenceContextWrapperFactory # java.naming.provider.url property carol.jndi.iiop.java.naming.provider.url =iiop://localhost:2000 #################################################### # Configuration for JEREMIE # #################################################### # portable remote object delegate class for this protocol 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 # here, for jndi we take the jndi.properties but we can make some : # configuration for rmi jrmp jndi # java.naming.factory.initial property carol.jndi.jeremie.java.naming.factory.initial =org.objectweb.jeremie.libs.services.registry.jndi.JRMIInitialContextFactory # java.naming.provider.url property carol.jndi.jeremie.java.naming.provider.url =jrmi://localhost:2001 #################################################### # Configuration for CMI # #################################################### # portable remote object delegate class for this protocol carol.rmi.cmi.PortableRemoteObjectClass =org.objectweb.carol.rmi.multi.CmiPRODelegate # Name service class for this protocol carol.rmi.cmi.NameServiceClass =org.objectweb.carol.jndi.ns.CmiRegistry # here, for jndi we take the jndi.properties but we can make some : # configuration for rmi jrmp jndi # java.naming.factory.initial property carol.jndi.cmi.java.naming.factory.initial =org.objectweb.carol.halborb.jndi.CmiInitialContextFactory # java.naming.provider.url property carol.jndi.cmi.java.naming.provider.url =jrmi://localhost:2002 #################################################### # Configuration for LMI # #################################################### # portable remote object delegate class for this protocol carol.rmi.lmi.PortableRemoteObjectClass =org.objectweb.carol.rmi.multi.LmiPRODelegate # Name service class for this protocol carol.rmi.lmi.NameServiceClass =org.objectweb.carol.jndi.ns.LmiRegistry # here, for jndi we take the jndi.properties but we can make some : # configuration for rmi jrmp jndi # java.naming.factory.initial property carol.jndi.lmi.java.naming.factory.initial =org.objectweb.carol.jndi.lmi.LmiInitialContextFactory # java.naming.provider.url property # (only for carol, no importance) carol.jndi.lmi.java.naming.provider.url =lmi://nohost:0 #################################################### # Configuration for Interceptor # #################################################### # xtra properties for the jvm (only in use in the multi protocol case) # Protocol Interceptors initializer class carol.jvm.org.objectweb.PortableInterceptor.JRMPInitializerClass .org.objectweb.carol.interceptor.myJRMPInterceptorInitializer # Protocol Interceptors initializer class carol.jvm.org.omg.PortableInterceptor.ORBInitializerClass .org.objectweb.carol.interceptor.myIIOPInterceptorInitializer #################################################### # Configuration for Global JNDI # #################################################### # note that all other jndi properties than # url and context factory can be found in # the jndi.properties file or in the jvm # (like this one) carol.jvm.java.naming.factory.url.pkgs =org.objectweb.carol.naming