public abstract class AbstractJMSClient extends Object implements JMSClient
| Modifier and Type | Field and Description |
|---|---|
protected static String |
CONNECTION_FACTORY_NAME |
protected javax.jms.ConnectionFactory |
factory |
protected static String |
INVALID_MESSAGE_EXCEPTION |
protected Map<String,javax.jms.Destination> |
temporaryDestinations |
| Constructor and Description |
|---|
AbstractJMSClient(String clientID)
Create new abstract JMS client instance.
|
| Modifier and Type | Method and Description |
|---|---|
protected String |
addMessage(javax.jms.Message message)
Add JMS message instance into client's internal storage.
|
void |
clearMessages()
Clear all read messages from client's storage.
|
void |
closeConnection()
Permanently closes JMS client connection.
|
protected abstract javax.jms.ConnectionFactory |
createConnectionFactory(Map<String,Object> parameters)
Create new JMS provider specific connection factory instance.
|
String |
getClientID() |
protected javax.jms.Message |
getMessage(String messageID)
Get read message by this client instance.
|
protected boolean |
isConnected() |
void |
openConnection()
Open new connection into MQ provider/broker.
|
protected MessageTypeEnum |
resolveMessageType(javax.jms.Message message)
Resolves JMS message's type.
|
MessageTypeEnum |
resolveMessageType(String messageID)
Resolve JMS message's type.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateTemporaryQueue, createTemporaryTopic, deleteTemporaryQueue, deleteTemporaryTopic, getMessageByteContent, getMessageCorrelationID, getMessageDestinationName, getMessageExpirationTime, getMessageID, getMessageMapContent, getMessagePriority, getMessageProperty, getMessageReplyToQueue, getMessageTextContent, getMessageTimestamp, getMessageType, getQueueDepth, initializeClient, openConnection, peekFromQueue, publishIntoTopic, publishIntoTopic, publishIntoTopic, purgeQueue, readFromQueue, readFromTopic, subscribeTopic, unsubscribeTopic, writeIntoQueue, writeIntoQueue, writeIntoQueueprotected static final String CONNECTION_FACTORY_NAME
protected static final String INVALID_MESSAGE_EXCEPTION
protected javax.jms.ConnectionFactory factory
public AbstractJMSClient(String clientID)
clientID - - Unique client IDprotected abstract javax.jms.ConnectionFactory createConnectionFactory(Map<String,Object> parameters) throws Exception
parameters - - Parameters used for connection factory creation.Exception - If connection factory creation fails.public void clearMessages()
JMSClientclearMessages in interface JMSClientpublic void closeConnection()
throws javax.jms.JMSException
JMSClientcloseConnection in interface JMSClientjavax.jms.JMSException - If closing of connection failspublic String getClientID()
getClientID in interface JMSClientpublic void openConnection()
throws javax.jms.JMSException
JMSClientopenConnection in interface JMSClientjavax.jms.JMSException - If opening the connection fails.public MessageTypeEnum resolveMessageType(String messageID)
JMSClientTEXT, BYTE or MAP.resolveMessageType in interface JMSClientmessageID - - Optional message ID. If not given then method attempt to read content from latest read messageprotected String addMessage(javax.jms.Message message) throws javax.jms.JMSException
message - - Message to addjavax.jms.JMSException - If resolving message's ID fails.protected javax.jms.Message getMessage(String messageID)
messageID - - JMS message ID. If null or given message ID is not read by this client,
latest read message is returned.null if client has not read any messagesprotected boolean isConnected()
true if client wrapper is connected to MQ provider.protected MessageTypeEnum resolveMessageType(javax.jms.Message message)
Copyright © 2018. All rights reserved.