aries-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lin Sun <>
Subject Re: Services and versions
Date Fri, 25 Jun 2010 00:55:20 GMT

When you publish a service, you could specify the version info in
service property, for example, publishing a service using blueprint

<service ref="myMessageDrivenBean" interface="javax.jms.MessageListener">
	<entry key="version" value="1.0" />

Or you could do similar thing without using blueprint, using

        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.



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

View raw message