Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [riena-dev] Remote Services from updated Configurations of Managed Services

Christian Campo schrieb:
exactly.....

Your service instance implements two interfaces. So it needs to register twice. Well actually I think you can register a service with a list of interfaces. However the problem is that the properties are set later for the second interface and these properties are immutable.

only to verify that we talk about the same ;-)

in the example below:

first Service:
service.id=1717
implements 2 interfaces:
a) org.ekkehard.abc.dataManager.mitarbeiter.FahrerRemoteManagerI
b) org.osgi.service.cm.ManagedService

second service:
service.id=1718
implements 1 interface:
org.ekkehard.abc.dataManager.mitarbeiter.FahrerRemoteManagerI
(same as service.id 1717 a)

1717a) and b) are registered from EasyBeans and have some properties from EasyBeans
1718 is registered by me and has set the Riena properties

so I have two services for exactly the same Interface

regards

ekke
So I see no other solution. Not sure if ConfigAdmin is overkill for this or not. Thats up to you. Depends how flexible your protocol and url properties have to be (are they static or do they change between starts of the service instance).

regards

christian campo

Am 29.08.2008 um 10:59 schrieb ekkehard:

Christian,

I followed your advice:

while tracking my ManagedServices and filtering the ejb Services:
.........

Object service = context.getService(reference);

........

Dictionary properties =  new Hashtable(3);
properties.put(RSDPublisherProperties.PROP_IS_REMOTE, Boolean.TRUE.toString()); properties.put(RSDPublisherProperties.PROP_REMOTE_PROTOCOL, "hessian"); properties.put(RSDPublisherProperties.PROP_REMOTE_PATH, "/WS_"+reference.getProperty("ejb.interface"));

then I register the service itself for the interface with Riena Properties:

context.registerService((String)reference.getProperty("ejb.interface"), service, properties);

now I'm having these services:

{org.ekkehard.abc.dataManager.mitarbeiter.FahrerRemoteManagerI, org.osgi.service.cm.ManagedService}={service.pid=org.ekkehard.abc.dataManager.mitarbeiter.FahrerRemoteManagerI:FahrerManagerBean, ejb.id=4543710, ejb.classname=org.ekkehard.abc.dataManager.mitarbeiter.FahrerManagerBean, ejb.name=FahrerManagerBean, ejb.interface=org.ekkehard.abc.dataManager.mitarbeiter.FahrerRemoteManagerI, ejb.container.name=org.ekkehard.abc.dataManager, service.id=1717} Registered by bundle: initial@reference:file:../../ekkehard/plugins/org.ekkehard.abc.dataManager_1.0.0.jar/ [28]
Bundles using service:
initial@reference:file:../../ekkehard/plugins/org.ekkehard.server_1.0.0.jar/ [42]

{org.ekkehard.abc.dataManager.mitarbeiter.FahrerRemoteManagerI}={riena.remote.protocol=hessian, riena.remote.path=/WS_org.ekkehard.abc.dataManager.mitarbeiter.FahrerRemoteManagerI, riena.remote=true, service.id=1718} Registered by bundle: initial@reference:file:../../ekkehard/plugins/org.ekkehard.server_1.0.0.jar/ [42]
Bundles using service:
initial@reference:file:../../riena/plugins/org.eclipse.riena.communication.publisher_1.0.0.M3.jar/ [61]

----
My intention to use the ConfigAdmin was to avoid the second Service,
but if I understand you right this isn't possible

thanks again

ekke
_______________________________________________
riena-dev mailing list
riena-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/riena-dev

_______________________________________________
riena-dev mailing list
riena-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/riena-dev




Back to the top