Mail Archive Home | jotm List | Febuary 2003 Index
| <-- Date Index --> | <-- Thread Index --> |
Miroslav.Halas@xxxxxxxxxxxxxx wote :
> Thanks a lot Guillame,
Hi Miro,
I'm back for solving this problem of JOTM integration ...
> seems like
> org.objectweb.carol.jndi.ns.NameServiceManager.startNS()
> is a way to go for me since I want to start the NS after Jetty was started
> and stop it when it is stopped.
> With the automatic start I assume I wouldn't be able to control it.
Yes
> When you said, "the NameService class name need to be configure before" how
> do I do it. I don't see any methods on NameServiceManager. Is there a way
> how Carol still parses the carol.properties and jndi.properties and I just
> decide when the NS starts and stops?
This this quit simple. This also going to change soon. In the next
Carol version (for next week CAROL 1.3) I'm going to provide a clear
configuration mechanism:
My proposal is:
CAROL will read first the carol-defaults.properties: with default for jrmp,
iiop, jeremie, cmi (cluster RMI) and lmi (local RMI). After, read the
jndi and carol properties: The carol.properties is on the top, if an
information needed by carol is not inside the carol.properties, Carol
will check first in the jndi.properties for JNDI and after in the
carol-defaults.properties
The configuration of a name server is based on the jndi properties:
java.naming.provider.url in the jndi.properties
or carol.jndi.jrmp.java.naming.provider.url in carol.properties
(for example, if this properties is rmi://localhost:15678, the rmi name
service will be start on the 15678 port.)
> One other thing which is little confusing for me is, that there is no such
> thing as "start Carol itself" if I understand it correctly to make the
> server (e.g. Jetty) work with Carol, the only thing I need to do is to
> start it with
>
> The Server has to be a standard RMI IIOP Server (with PortableRemoteObject
> export and JNDI bindings).
> Set the Server jvm properties by: java
> -Djavax.rmi.CORBA.PortableRemoteObjectClass=org.objectweb.carol.rmi.multi.MultiPRODelegate
>
> -Djava.naming.factory.initial=org.objectweb.carol.jndi.spi.MultiOrbInitialContextFactory
>
> -Djava.security.policy=${test.ext}/java.policy ...
You right, this is, I think, a problem for CAROL. Currently, carol is
based on a "non code intrusion" mechanism: you just need to set the
javax.rmi.CORBA.PortableRemoteObjectClass=org.objectweb.carol.rmi.multi.MultiPRODelegate
for export and the
java.naming.factory.initial=org.objectweb.carol.jndi.spi.MultiOrbInitialContextFactory
for binding
This is a simple delegation mechanism: call
PortableRemoteObject.exportObject() is delegate to the class pointed
by the property javax.rmi.CORBA.PortableRemoteObjectClass and so to
the Carol one
The same mechanism is use for InitialContext and
java.naming.factory.initial properties
And so when those properties are set for Carol, Carol is use for export
and bind mechanism.
The configuration of Carol is set in the first call to the InitialContext or
to the PortableObject.
This mechanism currently work fine. The problem is for deactivation of
Carol naming:
We need to add the possibility of a "non remote" and fully embedded
JOTM. For this we need to use the JNDI configure by someone else. We
need also a "locale PortableObjectDelegate" and possibly a Local JNDI
context.
I'm going to provide in CAROL 1.3 a default implementation of this "locale rmi
implementation" (lmi).
My problem is the JNDI configuration: suppose that there is a
JNDI for Jetty. This JNDI is configure in Jetty with System properties.
If we set
java.naming.factory.initial=org.objectweb.carol.jndi.spi.MultiOrbInitialContextFactory
The JNDI configure by Jetty will not be use.
So, there is 2 solutions for this problem:
1/ Use the carol.properties and set the right InitialContextFactory
(old method)
2/ Implements a CAROL start static method with a possibility a
no carol naming use.
The second solution is, for me, the best solution for integration of
JOTM in an "unknown local context". I'm going to implement this
solution for Carol 1.3. The only problem is that there is, inside the
JOTM code base, a link to a carol Class.
If you have any comments or if you need something else in Carol 1.3,
please ask me for this feature.
Best Regards,
Guillaume
>
> Reagards,
>
> Miro Hala
>
>
>
>
>
>
>
> Guillaume.riviere@in
>
> rialpes.fr To: carol@xxxxxxxxxxxxx
>
> cc:
>
> 02/10/2003 05:39 AM Subject: [carol] Re:
> [jotm] Re: Jetty/JOTM integration continues
>
>
>
>
>
>
>
>
> Miroslav.Halas@xxxxxxxxxxxxxx wote :
>> Guillame,
>>
>> can Carol start appropriate naming service registry based on some
>> configuration file in the same JVM the (mine/Jetty) server is
>> running?
>
> Yes, there is a NameService Manager inside the new Carol Release
> (1.2.0). This manager work fine in the carol test suite. We plan to to
> integrate (and use) this new carol feature in JOnAS and in JOTM soon
> as possible.
>
>> How would I go about it?
>
> This is very simple (For me ...). There is 2 ways for using this
> manager (it's not in use by default in Carol):
>
> A/By configuration:
> In the carol.properties you have to
>
> 1/ Set the property "carol.start.all.ns=true", if this property is
> true, the name service manager will start all "non started" name
> service (i.e. Check if the name service is up and, if not, call the
> Start() on
> each NameService interface)
>
>
> 2/ Set the property
>
> "carol.rmi.jrmp.NameServiceClass=org.objectweb.carol.jndi.ns.JRMPRegistry"
> (This configuration is for rmi jrmp). This property is the name
> of the implementation class of the Carol NameService interface.
>
> CAROL provide 3 basic implementation of NameService interface:
>
> org.objectweb.carol.jndi.ns.JRMPRegistry for JRMP
> org.objectweb.carol.jndi.ns.JeremieRegistry for Jeremie
> org.objectweb.carol.jndi.ns.IIOPCosNaming for IIOP
>
> B/By static methods call:
> You can directly call the carol NameService class by a
>
> 1/ org.objectweb.carol.jndi.ns.NameServiceManager.startNonStartedNS()
> or startNS() static method (the NameService class name need to be
> configure before)
>
>
> If you want to use your own Name service, you need to implements a
> Carol NameServer service (Start() and Stop() methods, relatively simple)
> (Interface org.objectweb.carol.jndi.ns.NameService)
>
>
> So for jrmp, the simplest way to start an "inside jvm" registry is to
> use the carol.properties like this one:
>
> carol.properties
> --------------------------------------------------------------------------------------------------------------------------
>
> # carol activation
> carol.rmi.activated=jrmp
> carol.start.all.ns=true
>
> # carol SPI configuration
> carol.rmi.jrmp.PortableRemoteObjectClass=org.objectweb.carol.rmi.multi.JrmpPRODelegate
>
> carol.rmi.jrmp.NameServiceClass=org.objectweb.carol.jndi.ns.JRMPRegistry
>
> # jndi properties can be set inside the jndi properties
> carol.jndi.jrmp.java.naming.factory.initial=com.sun.jndi.rmi.registry.RegistryContextFactory
>
> carol.jndi.jrmp.java.naming.provider.url=rmi://localhost:19570
>
> # not nessesary if only jrmp is in use
> carol.jvm.org.objectweb.PortableInterceptor.JRMPInitializerClass.org.objectweb.carol.rmi.jrmp.interceptor.ProtocolInterceptorInitializer
>
> --------------------------------------------------------------------------------------------------------------------------
>
>
>
>
> Note that there is a "default mechanism" inside carol:
> For jrmp, iiop and jeremie, if there is only one protocol (for example
> jrmp) and if there is no configuration of this protocol inside the
> carol.properties, defaults values are used. For example:
>
> if my files are:
>
> carol.properties
> -----------------------------------------------------
> carol.rmi.activated=jrmp
> carol.start.all.ns=true
>
> # added configuration for the transaction propagation
> carol.jvm.org.objectweb.PortableInterceptor.JRMPInitializerClass.org.objectweb.jotm.jta.rmi.JTAInterceptorInitializer
>
> -----------------------------------------------------
>
>
> jndi.properties
> ------------------------------------------------
> java.naming.factory.initial=com.sun.jndi.rmi.registry.RegistryContextFactory
>
> java.naming.provider.url=rmi://localhost:19570
> ------------------------------------------------
>
> If the server is started with CAROL, JRMP with interceptors
> for transaction propagation will be start and the if the rmiregistry
> is not started, a internal rmiregistry will be start on the 19570
> port.
>
>
> Regards,
> Guillaume
>
> --
> Guillaume Riviere
> INRIA -- SARDES/IMPACT
> ObjectWeb Consortium
> +(33)476615525
--
Guillaume Riviere
INRIA -- SARDES/IMPACT
ObjectWeb Consortium
+(33)476615525
| <-- Date Index --> | <-- Thread Index --> |
Powered by MHonArc.
Copyright © 2006-2007, OW2 Consortium | contact | webmaster.