I have a generic piece of code that takes a javax.jms.Destination that does different
things depending if the destination is a queue or a topic.
The problem is that it seems that destinations in Weblogic implement both queue
and topic:
instanceof queue <new_JMSTopic_1>
queue name: <new_JMSTopic_1>
weblogic.jms.common.InvalidDestinationException: Destination must be a queue,
ne
w_JMSTopic_1
at weblogic.jms.common.Destination.checkDestinationType(Destination.java
:113)
at weblogic.jms.client.JMSSession.createBrowser(JMSSession.java:1516)
at weblogic.jms.client.JMSSession.createBrowser(JMSSession.java:1500)
at Test.run(Test.java:100)
at Test.main(Test.java:311)
Is there anyway for me to programatically distinguish between queues and topics
as there seems not to be any javadoc on weblogic.jms.common.Destination and instanceof
does not work? I would prefer not to rely on exceptions.
I'm using Weblogic 8.1 sp2.
Thanks
Riad
This has come up before.
For now, you may cast dest to weblogic.jms.common.DestinationImpl
and call "isQueue()". Normally, only the javadoc'd methods
in weblogic.jms.extensions are intended for public use,
but for this case we make an exception.
In the next release, this method will be exposed through
a new public WL JMS API extension:
weblogic.jms.extensions.WLDestination,
and might not be available otherwise.
Tom, BEA
P.S. A java tip: The JDK's built-in "javap"
is useful for viewing an arbitrary class api.
As in "javap weblogic.jms.extensions.JMSHelper".
Riad