I have no experience with any implementations but I can give you my interpretation of the spec.
> On 24 mrt. 2016, at 15:35, Nipuni Piyabasi Perera <nipuni880...@gmail.com> > wrote: > Hi all, > I am trying to implement OSGI URL scheme support for JNDI following the OSGI > service specification[1]. While implementing the OSGI URL scheme I > encountered following issues. > As per the specification, Following are the confusions I have: > • A lookup with osgi:service path will return a service while a > servicelist path returns an context object. Does a query "osgi:servicelist/" > is valid? Or is it mandatory to have a query followed by the > osgi:servicelist/ ? The syntax is: servicelist ::= ‘osgi:servicelist/' query? This clearly allows `osgi:servicelist/` > • As per the specification, listBindings() and list() methods will > return NamingEnumeration objects. Do both "service" and "servicelist" paths > need to support aforementioned methods? > • context.list(“osgi:service/<qname>”) is this a valid URL ? Syntax is: query ::= jndi-name | qname ( '/' filter )? This clearly allows `osgi:service/<qname>` > • context.list(osgi:servicelist/<qname>) is this a valid URL ? Why do you leave out the quotes? This is not valid Java? > • If this is a valid scenario, does the Context object > need to obtain first before doing list() and listbinding() queries? (Please > find a sample code below) > • Context context = > jndiContextManager.newInitialContext(); > Context listContext = > context.lookup("osgi:servicelist/org.my.jndi.osgi.services.FooService") > NamingEnumeration<NameClassPair> namingEnumeration = > > listContext.list("osgi:service/org.wso2.carbon.jndi.osgi.services.FooService"); > • In a scenario as above, is it valid to pass two > different names to list() and lookup() methods (i.e > context.lookup(“osgi:servicelist/SERVICE-A”) and do a > context.list(osgi:servicelist/SERVICE-B)) ? You’ll have to look at the Java JNDI specification but I recall that the context is a node in a tree. I.e. the initial context is the root but the context’s returned are somewhere in that naming tree. So it seems very illogical that a context associated with a URL A can be used to find URL B? But not sure, the Java JNDI specification should be able to tell you. > • As per the specification we mainly support list(), listbindings(), > and lookup() methods. Can we consider the other methods such as bind(), > rebind() , unbind() , rename() as operations that are not supported with > the provider? > This seems not specified but logically this seems impossible to implement since the backing is the service registry. You could file an issue at the public OSGi bugzilla to ask for clarification. Kind regards, Peter Kriens > Appreciate any input on above queries. > > [1] https://osgi.org/download/r6/osgi.enterprise-6.0.0.pdf > > Thanks, > Nipuni > > -- > Nipuni Perera > Software Engineer; WSO2 Inc.; http://wso2.com > Email: nip...@wso2.com > Git hub profile: https://github.com/nipuni > Blog : http://nipunipererablog.blogspot.com/ > Mobile: +94 (71) 5626680 > _______________________________________________ > OSGi Developer Mail List > osgi-dev@mail.osgi.org > https://mail.osgi.org/mailman/listinfo/osgi-dev _______________________________________________ OSGi Developer Mail List osgi-dev@mail.osgi.org https://mail.osgi.org/mailman/listinfo/osgi-dev