ok, thanks for this detail !!
Timothy Ward a écrit :
Hi Erik, filters do work,
One warning though, if the service property used to represent the version is an
org.osgi.framework.Version, then it will have different equals and comparison
behaviour than if it is a java.lang.String.
For example the filter "(version=1.0.0)" will match an OSGi Version made with
Version.parseVersion("1.0"), but not the String "1.0".
Regards,
Tim
________________________________
Date: Sat, 26 Jun 2010 15:27:55 +0200
From: [email protected]
To: [email protected]
Subject: Re: Services and versions
So filters with the version attribute works with JNDI ! Great !!!
Thanks
Bartosz Kowalewski a écrit :
Hi Erik,
Continuing Lin's guide:
You should be now able to use something similar to:
"aries:services/javax.jms.MessageListener/(" +
Constants.VERSION_ATTRIBUTE + "=1.0)"
when doing JNDI lookup.
I hope I'm not misstating anything.
Best regards,
Bartek
2010/6/25 Lin Sun :
Hi
When you publish a service, you could specify the version info in
service property, for example, publishing a service using blueprint
XML:
Or you could do similar thing without using blueprint, using
context.registerService
Dictionary dict = new Hashtable();
dict.put(Constants.VERSION_ATTRIBUTE, "1.0");
sr = context.registerService(MessageListener.class.getName(),
new MyMessageDrivenBean(context), dict);
A client can use filter to specify the exact query it wants, for
example something like below -
String fiter = "(" + Constants.VERSION_ATTRIBUTE + "=1.0")";
Then pass the filter into context.getServiceReferences(clazz, filter)
to get the service reference for the service you are interested.
HTH
Lin
On Thu, Jun 24, 2010 at 8:16 AM, Erik Gollot wrote:
Hello,
first, thanks for your work in the OSGI world !
This is my first question about Aries.
So, when we publish a service, we can specify a version number, ok ?
So, now, if I've published 2 versions of the "same service", how a client
can specify the version he needs when a "IntialContext.lookup" is performed
? Do we need an OSGIfied JNDI ?
Thanks
_________________________________________________________________
http://clk.atdmt.com/UKM/go/197222280/direct/01/
We want to hear all your funny, exciting and crazy Hotmail stories. Tell us now