Skip to content
This repository has been archived by the owner on Nov 16, 2021. It is now read-only.

Clarifications on OSGI URL scheme support for JNDI #24

Open
bjhargrave opened this issue Mar 30, 2016 · 2 comments
Open

Clarifications on OSGI URL scheme support for JNDI #24

bjhargrave opened this issue Mar 30, 2016 · 2 comments
Labels
publiccomment Public comment

Comments

@bjhargrave
Copy link
Member

Original bug ID: BZ#185
From: Nipuni Perera <[email protected]>
Reported version: R6

@bjhargrave
Copy link
Member Author

Comment author: Nipuni Perera <[email protected]>

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:

  1. 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/ ?

  2. As per the specification, listBindings() and list() methods will return NamingEnumeration objects. Do both "service" and "servicelist" paths need to support aforementioned methods?
    a. context.list("osgi:service/") is this a valid URL ?
    b. context.list(osgi:servicelist/) is this a valid URL ?
    c. If this(above (b)) 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.my.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) or what should passed as the parameters to the list() method) ?

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?

Appreciate any input on above queries.

[1] https://osgi.org/download/r6/osgi.enterprise-6.0.0.pdf

Thanks,
Nipuni

@bjhargrave
Copy link
Member Author

Comment author: Nipuni Perera <[email protected]>

I have raised this in osgi-dev list, and as per the replies:

  1. "osgi:servicelist/" is a valid query. (this answers my first question)

  2. We can imply that the other methods such as bind(), rebind() , unbind() , rename() as operations that are not supported with the provider. (this answers my last issue)

Appreciate if anyone can give a clarification on the other issues.

Seems my second question is not much clear. Hence adding the same question with more details below:

  1. As per the specification, listBindings() and list() methods will return NamingEnumeration objects. Do both "service" and "servicelist" paths need to support aforementioned methods?
    a. eg: context.list("osgi:service/") is this a valid statement ?
    b. eg: context.list(osgi:servicelist/) is this a valid statement ?
    c. If this(above (b)) 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.my.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)) ?

  • In a scenario as above say we received a context object with lookup method.
    Context listContext = context.lookup("osgi:servicelist/");
    We should be able to do lookup() calls with this received context object. In such cases what should pass as the URL.
    eg: is it "listContext.lookup("osgi:servicelist/") or listContext.lookup("|")"


Thanks,
Nipuni

@bjhargrave bjhargrave added the publiccomment Public comment label May 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
publiccomment Public comment
Projects
None yet
Development

No branches or pull requests

1 participant