aries-user mailing list archives

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

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

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

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 <erik_gollot@yahoo.fr> 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
>

Mime
View raw message