java - How to check jndi bind/unbind status? -
i'm looking way of checking bind status of object , appropriate jndi name.
for example, i've got ldap jms queue name: "/therootcontext/somesubcontext/some.queue.name:queue"
i need check appropriate queue exists , binded passed name.
what correct way check "bind status"?
i see such algorithm:
perform jndi lookup ensure provided name exists.
object obj = ctx.lookup("/therootcontext/somesubcontext/some.queue.name:queue");
%i don't know next%, suggest checking that:
obj != null && obj instanceof javax.jms.queue
am correct? correct way?
most if object not found lookup throw namingexception in 1. need either catch exception or try use list method check if object exists.
Comments
Post a Comment