com.ibm.di.systemqueue
Class SystemQueue

java.lang.Object
  extended by com.ibm.di.systemqueue.SystemQueue

public class SystemQueue
extends Object

The System Queue holds single connection to JMS Provider. It capsulate JMS specific methods and expose API for working with JMS. It receive all needed specific parameters to create JMS Driver, Connection Factories, Queues, Topics. It provides methods for sending and receiving messages to/from JMS Provider.


Constructor Summary
protected SystemQueue(String aJmsDriverName, String username, String password, Hashtable aDriverParams)
          Constructor for the SystemQueueEngine object
 
Method Summary
 byte[] getBytesMessage(String queueName, int aTimeOut)
          Gets a BytesMessage from the System Queue.
 Entry getEntry(String aQueueName, int aTimeOut)
          Gets an Entry object from the System Queue
 javax.jms.Message getMessage(String aQueueName, int aTimeOut)
          Gets a Message from the System Queue
 javax.jms.QueueConnectionFactory getQueueConnectionFactory()
          Public getter of QueueConnectionFactory
 String getTextMessage(String aQueueName, int aTimeOut)
          Gets a TextMessage from the System Queue
 javax.jms.TopicConnectionFactory getTopicConnectionFactory()
          Public getter of TopicConnectionFactory
 void putBytesMessage(String aQueueName, byte[] aMessageBytes)
          Puts a BytesMessage to the System Queue.
 void putEntry(String aQueueName, Entry aEntry)
          Puts an Entry object to the System Queue
 void putMessage(String aQueueName, javax.jms.Message aMessage)
          Puts a Message to the System Queue
 void putTextMessage(String aQueueName, String aMessageText)
          Puts a TextMessage to the System Queue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SystemQueue

protected SystemQueue(String aJmsDriverName,
                      String username,
                      String password,
                      Hashtable aDriverParams)
               throws Exception
Constructor for the SystemQueueEngine object

Parameters:
aJmsDriverName - the JMS Driver classname
aDriverParams - properties used for JMS Driver initialization
Throws:
Exception - if JMS Driver cannot be initialized and used
Method Detail

getQueueConnectionFactory

public javax.jms.QueueConnectionFactory getQueueConnectionFactory()
                                                           throws Exception
Public getter of QueueConnectionFactory

Returns:
QueueConnectionFactory object that holds Queue connection to JMS Provider
Throws:
Exception - i f QueueConnectionFactory cannot be obtained

getTopicConnectionFactory

public javax.jms.TopicConnectionFactory getTopicConnectionFactory()
                                                           throws Exception
Public getter of TopicConnectionFactory

Returns:
TopicConnectionFactory object that holds Topic connection to JMS Provider
Throws:
Exception - if TopicConnectionFactory cannot be obtained

getMessage

public javax.jms.Message getMessage(String aQueueName,
                                    int aTimeOut)
                             throws Exception
Gets a Message from the System Queue

Parameters:
aQueueName - queue name from what the message is get
aTimeOut - Specifies the maximum time of waiting for a new message
Returns:
the javax.jms.Message object.
Throws:
Exception - if an error occurs during receiving

putMessage

public void putMessage(String aQueueName,
                       javax.jms.Message aMessage)
                throws Exception
Puts a Message to the System Queue

Parameters:
aQueueName - queue name to what the message have to be sent
aMessage - object that have to be sent
Throws:
Exception - if an error occurs during sending

getTextMessage

public String getTextMessage(String aQueueName,
                             int aTimeOut)
                      throws Exception
Gets a TextMessage from the System Queue

Parameters:
aQueueName - queue name from what the message is get
aTimeOut - Specifies the maximum time of waiting for a new message
Returns:
The text of the message
Throws:
Exception - if an error occurs during receiving

putTextMessage

public void putTextMessage(String aQueueName,
                           String aMessageText)
                    throws Exception
Puts a TextMessage to the System Queue

Parameters:
aQueueName - queue name to what the message have to be sent
aMessageText - The text of the message to be sent
Throws:
Exception - if an error occurs during sending

getBytesMessage

public byte[] getBytesMessage(String queueName,
                              int aTimeOut)
                       throws Exception
Gets a BytesMessage from the System Queue.

Parameters:
queueName - queue name from what the message is get
aTimeOut - Specifies the maximum time of waiting for a new message
Returns:
The bytes of the message
Throws:
Exception - if an error occurs during receiving

putBytesMessage

public void putBytesMessage(String aQueueName,
                            byte[] aMessageBytes)
                     throws Exception
Puts a BytesMessage to the System Queue.

Parameters:
aQueueName - Queue name to what the message have to be sent.
aMessageBytes - The bytes of the message to be sent.
Throws:
Exception - if an error occurs during sending

getEntry

public Entry getEntry(String aQueueName,
                      int aTimeOut)
               throws Exception
Gets an Entry object from the System Queue

Parameters:
aQueueName - queue name from what the message is get
aTimeOut - Specifies the maximum time of waiting for a new message
Returns:
The Entry
Throws:
Exception - if an error occurs during receiving

putEntry

public void putEntry(String aQueueName,
                     Entry aEntry)
              throws Exception
Puts an Entry object to the System Queue

Parameters:
aQueueName - queue name to what the message have to be sent
aEntry - The Entry to be sent
Throws:
Exception - if an error occurs during sending