org.jboss.jms.serverless.client
Class Interactive

java.lang.Object
  extended byorg.jboss.jms.serverless.client.Interactive

public class Interactive
extends java.lang.Object

An interactive JMS client. Run it with org.clester.Main.

See Also:
org.clester.Main

Constructor Summary
Interactive()
           
 
Method Summary
 void close(int index)
           
 void closeConsumer(java.lang.String consumerID)
          Equivalent with calling JMS API method close() on the consumer instance.
 void createConnection()
           
 void createConnection(java.lang.String connectionFactoryJNDIName)
           
 void createConsumer(java.lang.String sessionID, java.lang.String destinationJNDIName)
          Creates a Consumer associated with the session whose index is specified as the first parameter.
 void createProducer(java.lang.String sessionID, java.lang.String destinationJNDIName)
          Creates a Producer associated with the session whose index is specified as the first parameter.
 void createSession(int index, boolean transacted, java.lang.String acknowledgeModeString)
          Creates a session using the active connection.
 void exit()
           
 void forward(java.lang.String consumerID, java.lang.String producerID)
          The method creates a "bridge" between a consumer and a producer: Every message received by the consumer is automatically forwarded to the producer and sent on the producer's destination.
 void lookupConnectionFactory(java.lang.String name)
           
 void lookupDestination(java.lang.String destinationJNDIName)
          Performs a JNDI lookup for the specified destination, overwritting the local cache if the destination is found.
 void runtime()
          Displays a snapshot of the JMS runtime
 void send(java.lang.String producerID, java.lang.String payload)
           
 void setMessageListener(java.lang.String consumerID)
          Attaches a message listener to the specified consumer, possibly replacing the current one.
 void start()
           
 void start(int index)
           
 void stop(int index)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Interactive

public Interactive()
            throws java.lang.Exception
Method Detail

exit

public void exit()

runtime

public void runtime()
             throws java.lang.Exception
Displays a snapshot of the JMS runtime

Throws:
java.lang.Exception

lookupConnectionFactory

public void lookupConnectionFactory(java.lang.String name)
                             throws java.lang.Exception
Throws:
java.lang.Exception

lookupDestination

public void lookupDestination(java.lang.String destinationJNDIName)
                       throws java.lang.Exception
Performs a JNDI lookup for the specified destination, overwritting the local cache if the destination is found.

Throws:
java.lang.Exception

createConnection

public void createConnection(java.lang.String connectionFactoryJNDIName)
                      throws java.lang.Exception
Throws:
java.lang.Exception

createConnection

public void createConnection()
                      throws java.lang.Exception
Throws:
java.lang.Exception

start

public void start(int index)
           throws java.lang.Exception
Throws:
java.lang.Exception

start

public void start()
           throws java.lang.Exception
Throws:
java.lang.Exception

stop

public void stop(int index)
          throws java.lang.Exception
Throws:
java.lang.Exception

close

public void close(int index)
           throws java.lang.Exception
Throws:
java.lang.Exception

createSession

public void createSession(int index,
                          boolean transacted,
                          java.lang.String acknowledgeModeString)
                   throws java.lang.Exception
Creates a session using the active connection.

Parameters:
index - - the index of the Connection this Session will be created on.
transacted - - a boolean indicating whether the session to be created is transacted or not.
acknowledgeModeString - - The string representation of the acknowledgement mode for the session to be created. One of "AUTO_ACKNOWLEDGE", "CLIENT_ACKNOWLEDGE", "DUPS_OK_ACKNOWLEDGE".
Throws:
java.lang.Exception

createProducer

public void createProducer(java.lang.String sessionID,
                           java.lang.String destinationJNDIName)
                    throws java.lang.Exception
Creates a Producer associated with the session whose index is specified as the first parameter.

Parameters:
sessionID - - A "." string.
Throws:
java.lang.Exception

createConsumer

public void createConsumer(java.lang.String sessionID,
                           java.lang.String destinationJNDIName)
                    throws java.lang.Exception
Creates a Consumer associated with the session whose index is specified as the first parameter.

Parameters:
sessionID - - A "." string.
Throws:
java.lang.Exception

closeConsumer

public void closeConsumer(java.lang.String consumerID)
                   throws java.lang.Exception
Equivalent with calling JMS API method close() on the consumer instance.

Parameters:
consumerID - - A ".." string.
Throws:
java.lang.Exception

setMessageListener

public void setMessageListener(java.lang.String consumerID)
                        throws java.lang.Exception
Attaches a message listener to the specified consumer, possibly replacing the current one. The message listener just displays the string representation of the messages it receives.

Parameters:
consumerID - - A ".." string.
Throws:
java.lang.Exception

send

public void send(java.lang.String producerID,
                 java.lang.String payload)
          throws java.lang.Exception
Parameters:
producerID - - A ".." string.
Throws:
java.lang.Exception

forward

public void forward(java.lang.String consumerID,
                    java.lang.String producerID)
             throws java.lang.Exception
The method creates a "bridge" between a consumer and a producer: Every message received by the consumer is automatically forwarded to the producer and sent on the producer's destination.

Throws:
java.lang.Exception