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.JMSExceptionprotected void connect()
throws javax.jms.JMSException
javax.jms.JMSExceptionpublic void tOpen()
throws javax.jms.JMSException
TopicConnectortOpen in interface TopicConnectorjavax.jms.JMSExceptionpublic int tReopen()
TopicConnectortReopen in interface TopicConnectorpublic void tClose()
throws javax.jms.JMSException
TopicConnectortClose in interface TopicConnectorjavax.jms.JMSExceptionpublic javax.jms.Message createMessage(int type)
throws javax.jms.JMSException
TopicConnectorcreateMessage in interface TopicConnectorjavax.jms.JMSExceptionpublic javax.jms.Queue createQueue(java.lang.String queueName)
throws javax.jms.JMSException
TopicConnectorcreateQueue in interface TopicConnectorjavax.jms.JMSExceptionpublic java.lang.String reconnect()
TopicConnectorreconnect in interface TopicConnectorpublic void onException(javax.jms.JMSException e)
TopicConnectoronException in interface javax.jms.ExceptionListeneronException in interface TopicConnectorpublic void close()
TopicConnectorclose in interface TopicConnectorpublic void sub(java.lang.Object out)
throws java.io.IOException,
javax.jms.JMSException
sub in interface TopicConnectorjava.io.IOExceptionjavax.jms.JMSExceptionpublic void pub(java.io.InputStream in)
throws java.io.IOException,
javax.jms.JMSException
pub in interface TopicConnectorjava.io.IOExceptionjavax.jms.JMSExceptionpublic void pub(XQueue xq) throws TimeoutException, javax.jms.JMSException
pub in interface TopicConnectorTimeoutExceptionjavax.jms.JMSExceptionpublic java.lang.String getOperation()
TopicConnectorgetOperation in interface TopicConnectorpublic javax.jms.TopicPublisher getTopicPublisher()
TopicConnectorgetTopicPublisher in interface TopicConnectorpublic javax.jms.TopicSubscriber getTopicSubscriber()
TopicConnectorgetTopicSubscriber in interface TopicConnectorpublic int check_subscription()
throws javax.jms.JMSException
javax.jms.JMSExceptionpublic void publish_v0(java.lang.String topicName,
javax.jms.Message msg)
throws javax.jms.JMSException
javax.jms.JMSException