Use the simplest, clearest way that works. If the second technique is a more complicated and indirect way that adds unnecessary code to the first technique, it should be obvious which to use.
Everything should be made as simple as possible, but not simpler...
A. Einstein
Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.
Agreed. But I'm not shure what I understand correctly what does "check for unbind" mean.
As I understand LDAP name may exist, but no appropriate object (JMS queue) exist. Or both may exist, but they may be "unbind".
I need to check three things:
JNDI name (LDAP name in that case) exists
JNDI name is bound to expected object (JMS queue)
Not shure here: JMS queue really exists
How is it possible and is it really necessary to perform this checks separately?
As I see now, everything is too simple. There could be done only one operation -- lookup that will return object bound to name or throw exception if name doesn't exist. So this operation in couple with checking it's result covers first 2 (or may be all 3) upper list items.
Is it enough and am I correct in my understanding "check for unbind" activity?
It's been a while since I messed with this stuff, but as I understand it, JNDI binding is simply the mapping of an object to a name in a specified naming context (e.g. map).
If a name exists in the context, and there is an object mapped to it, the object and name are bound in that context. If there is no object mapped to the name, or if the name is not found in the context, there is no binding of that name/object.
It's pretty simple really - binding is the JNDI synonym for mapping.
Doing more things faster is no substitute for doing the right things...
S. R. Covey
Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.
Bookmarks