|
WebLogic Server 6.0 Code Examples, BEA Systems, Inc. | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--examples.jms.queue.QueueBrowse
This example shows how to establish a connection to a JMS queue and browse (but not dequeue) the queued messages. The classes in this package operate on the same JMS queue. Run the classes together to observe messages being sent and received, and to browse the queue for messages. This class is used to browse, but not remove, messages in the queue.
Field Summary | |
static java.lang.String |
JMS_FACTORY
Defines the JMS connection factory for the queue. |
static java.lang.String |
JNDI_FACTORY
Defines the JNDI context factory. |
static java.lang.String |
QUEUE
Defines the queue. |
Constructor Summary | |
QueueBrowse()
|
Method Summary | |
void |
close()
Closes JMS objects. |
void |
displayQueue()
Displays the current contents of the queue. |
void |
init(javax.naming.Context ctx,
java.lang.String queueName)
Creates all the necessary objects for receiving messages from a JMS queue. |
static void |
main(java.lang.String[] args)
main() method. |
Methods inherited from class java.lang.Object |
|
Field Detail |
public static final java.lang.String JMS_FACTORY
public static final java.lang.String JNDI_FACTORY
public static final java.lang.String QUEUE
Constructor Detail |
public QueueBrowse()
Method Detail |
public void close() throws javax.jms.JMSException
javax.jms.JMSException
- if JMS fails to close objects due to internal errorpublic void displayQueue() throws javax.jms.JMSException
javax.jms.JMSException
- if JMS fails to display messages on the queue due to internal errorpublic void init(javax.naming.Context ctx, java.lang.String queueName) throws javax.naming.NamingException, javax.jms.JMSException
ctx
- JNDI initial contextqueueName
- name of queuejavax.naming.NamingException
- if operation cannot be performedjavax.jms.JMSException
- if JMS fails to initialize due to internal errorpublic static void main(java.lang.String[] args) throws java.lang.Exception
args
- WebLogic Server URLjava.lang.Exception
- if execution fails
|
Documentation is available at http://e-docs.bea.com/wls/docs60 |
|||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |