how to pass in a wildcard as an argument to a method
Hi,
I am calling to a method which "normally" works like this:
sContext.lookup(jndiName)
The argument jndiName which I am passing looks like:
/jms/topic/my/topic
If the above jndiName exists, the method looks it up. If it does not exist, obviously an exception occurs.
However, what I want to do is to pass a wildcard like * as an agrument for the method, so that it looks up everything that does exist. Or better yet, I want to lookup everything that starts with /jms/topic/*/*/*.
Is this possible to do by using some wildcard? Or is there another way to do this?
Thanks!
[630 byte] By [
ahujava] at [2007-11-26 22:34:12]

I want do this because what if I don't know the jndiName (which is a string) - and I want to lookup all the ones that do exist.
Once I get a list of all the jndiName's that exist - I will display them to the user - so the user is now aware of all the ones that exist.
Yes, at this time the user will pass the now known jndiName as an argument and then I will look up the specifc object to use them.
The lookup method is in the class:
javax.naming.InitialContext
which implements interface Context
sounds odd, but it's your code. I don't think this can be done, but re-ask the question on [url=http://forum.java.sun.com/forum.jspa?forumID=51]this[/url] forum for a better chance of the definitive answer. mention that you've posted it here and been redirected, or someone will jump down your throat for "crossposting"