public class TConnector extends java.lang.Object implements TopicConnector
Modifier and Type | Field and Description |
---|---|
protected javax.jms.TopicSession |
tSession |
Constructor and Description |
---|
TConnector(java.util.Map props)
Creates new TConnector
|
Modifier and Type | Method and Description |
---|---|
int |
check_subscription()
check the subscription existence by browsing SYSTEM.JMS.ADMIN.QUEUE
It returns 1 for subscribed, 0 for not subscribed and -1 for subscibed
but not the same.
|
void |
close()
closes all opened resources
|
protected void |
connect() |
javax.jms.Message |
createMessage(int type)
returns a JMS Message with the initialized JMSSession
|
javax.jms.Queue |
createQueue(java.lang.String queueName)
returns the queue created for the given name
|
java.lang.String |
getOperation()
returns the string of the operation
|
javax.jms.TopicPublisher |
getTopicPublisher()
returns an on-demand publisher in a separate session
|
javax.jms.TopicSubscriber |
getTopicSubscriber()
returns an on-demand subscriber in a separate session
|
void |
onException(javax.jms.JMSException e)
catches JMSException of Connection asynchronously
|
void |
pub(java.io.InputStream in)
It reads bytes from the InputStream and publish them into a JMS topic as
JMS messages.
|
void |
pub(XQueue xq)
It gets JMS messages from the XQueue and publishes them on a JMS topic.
|
void |
publish_v0(java.lang.String topicName,
javax.jms.Message msg)
To support MQSI V2 broker, this method uses qSender to put the message
with the bare V2 header that contains MQSI V2 PUB command.
|
java.lang.String |
reconnect()
reconnects to the JMS server for the operation or returns error text
|
void |
sub(java.lang.Object out)
It subscribes a JMS topic and sends the JMS messages into a output
channel that may be a JMS destination, an OutputStream or an XQueue.
|
void |
tClose()
closes the topic
|
void |
tOpen()
opens the topic for the operation
|
int |
tReopen()
reopens the topic for the operation
|
public TConnector(java.util.Map props) throws javax.jms.JMSException
javax.jms.JMSException
protected void connect() throws javax.jms.JMSException
javax.jms.JMSException
public void tOpen() throws javax.jms.JMSException
TopicConnector
tOpen
in interface TopicConnector
javax.jms.JMSException
public int tReopen()
TopicConnector
tReopen
in interface TopicConnector
public void tClose() throws javax.jms.JMSException
TopicConnector
tClose
in interface TopicConnector
javax.jms.JMSException
public javax.jms.Message createMessage(int type) throws javax.jms.JMSException
TopicConnector
createMessage
in interface TopicConnector
javax.jms.JMSException
public javax.jms.Queue createQueue(java.lang.String queueName) throws javax.jms.JMSException
TopicConnector
createQueue
in interface TopicConnector
javax.jms.JMSException
public java.lang.String reconnect()
TopicConnector
reconnect
in interface TopicConnector
public void onException(javax.jms.JMSException e)
TopicConnector
onException
in interface javax.jms.ExceptionListener
onException
in interface TopicConnector
public void close()
TopicConnector
close
in interface TopicConnector
public void sub(java.lang.Object out) throws java.io.IOException, javax.jms.JMSException
sub
in interface TopicConnector
java.io.IOException
javax.jms.JMSException
public void pub(java.io.InputStream in) throws java.io.IOException, javax.jms.JMSException
pub
in interface TopicConnector
java.io.IOException
javax.jms.JMSException
public void pub(XQueue xq) throws TimeoutException, javax.jms.JMSException
pub
in interface TopicConnector
TimeoutException
javax.jms.JMSException
public java.lang.String getOperation()
TopicConnector
getOperation
in interface TopicConnector
public javax.jms.TopicPublisher getTopicPublisher()
TopicConnector
getTopicPublisher
in interface TopicConnector
public javax.jms.TopicSubscriber getTopicSubscriber()
TopicConnector
getTopicSubscriber
in interface TopicConnector
public int check_subscription() throws javax.jms.JMSException
javax.jms.JMSException
public void publish_v0(java.lang.String topicName, javax.jms.Message msg) throws javax.jms.JMSException
javax.jms.JMSException