File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other JSE/JEE APIs and the fly likes How to check jndi bind/unbind status? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "How to check jndi bind/unbind status?" Watch "How to check jndi bind/unbind status?" New topic

How to check jndi bind/unbind status?

Valdemar Kabozya

Joined: Mar 04, 2011
Posts: 1
I'm looking for way of checking bind status of object and appropriate JNDI name.

For example, I've got some ldap jms queue name: "/TheRootContext/SomeSubContext/SOME.QUEUE.NAME:queue"

I need to check that appropriate queue exists and it is binded with passed name.

What will be the correct way to check "bind status"?

I see such algorithm:

  • Perform jndi lookup to ensure that provided name exists.

  • %I don't know what to do next%, but suggest something like checking that:

  • ===
    Another way, suggested here:
    is to use listBindings method, passing to it parent context name: and checking what interested binding present in returned NamingEnumeration. But this is actually the same as previous method. This way something like this should be done:

    So, what is the correct way?

    With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    subject: How to check jndi bind/unbind status?
    It's not a secret anymore!