|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.mq.jms.MQConnection
A JMS MQConnection is a client's active connection to its JMS provider.
Method Summary | |
void |
close()
Moves the connection into the closed state. |
javax.jms.ConnectionConsumer |
createConnectionConsumer(javax.jms.Destination destination,
java.lang.String messageSelector,
javax.jms.ServerSessionPool sessionPool,
int maxMessages)
Creates a connection consumer for this connection. |
javax.jms.ConnectionConsumer |
createDurableConnectionConsumer(javax.jms.Topic topic,
java.lang.String name,
java.lang.String messageSelector,
javax.jms.ServerSessionPool sessionPool,
int maxMessageCount)
Creates a durable connection consumer for this connection. |
javax.jms.Session |
createSession(boolean transacted,
int acknowledgeMode)
Creates a Session object. |
java.lang.String |
getClientID()
Gets the client ID for this connection. |
javax.jms.ExceptionListener |
getExceptionListener()
Gets the exception listener for this connection. |
javax.jms.ConnectionMetaData |
getMetaData()
Gets the meta data for this connection. |
void |
setClientID(java.lang.String clientID)
Sets the client ID for this connection. |
void |
setExceptionListener(javax.jms.ExceptionListener listener)
Sets an exception listener for this connection. |
void |
start()
Start or restart delivering incoming messages. |
void |
stop()
Temporarily stops a connection's delivery of incoming messages. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public java.lang.String getClientID() throws javax.jms.JMSException
getClientID
in interface javax.jms.Connection
javax.jms.JMSException
- if JMS implementation fails to return
the client ID for this Connection due to an internal error.public void setClientID(java.lang.String clientID) throws javax.jms.JMSException
setClientID
in interface javax.jms.Connection
clientID
- the unique client identifier.
javax.jms.JMSException
- general exception if JMS implementation fails to
set the client ID for this Connection due to an internal error.
javax.jms.InvalidClientIDException
- if JMS client specifies an
invalid or duplicate client ID.public void start() throws javax.jms.JMSException
start
in interface javax.jms.Connection
javax.jms.JMSException
public void stop() throws javax.jms.JMSException
start()
method.
When it is stopped, it inhibits delivery to all its message consumers.
Synchronous receives are blocked, and messages are not delivered to message listeners.
Stopping a session has no affect on its ability to send messages.
Stopping a session that is already stopped has no effect.
stop
in interface javax.jms.Connection
javax.jms.JMSException
- if the JMS implementation fails to stop the message delivery
because of an internal error.public void close() throws javax.jms.JMSException
close
in interface javax.jms.Connection
javax.jms.JMSException
- if the connection cannot be closed.public void setExceptionListener(javax.jms.ExceptionListener listener) throws javax.jms.JMSException
setExceptionListener
in interface javax.jms.Connection
listener
- the exception listener.
javax.jms.JMSException
ExceptionListener
public javax.jms.ExceptionListener getExceptionListener() throws javax.jms.JMSException
getExceptionListener
in interface javax.jms.Connection
javax.jms.JMSException
ExceptionListener
public javax.jms.ConnectionMetaData getMetaData() throws javax.jms.JMSException
getMetaData
in interface javax.jms.Connection
javax.jms.JMSException
- general exception if JMS implementation fails to
get the Connection meta-data for this Connection.public javax.jms.Session createSession(boolean transacted, int acknowledgeMode) throws javax.jms.JMSException
createSession
in interface javax.jms.Connection
transacted
- true indicates that the session is transacted.acknowledgeMode
- indicates whether the consumer or the client acknowledges
any messages it receives.
Possible values are:
Session.AUTO_ACKNOWLEDGE
Session.CLIENT_ACKNOWLEDGE
Session.DUPS_OK_ACKNOWLEDGE
javax.jms.JMSException
- if the Connection object fails to create a session due
to some internal error or lack of support for the specific transaction and acknowledgement mode.public javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Destination destination, java.lang.String messageSelector, javax.jms.ServerSessionPool sessionPool, int maxMessages) throws javax.jms.JMSException
createConnectionConsumer
in interface javax.jms.Connection
destination
- the destination to accessmessageSelector
- only messages with properties matching the message selector expression are delivered. A value of null or an empty string indicates that there is no message selector for the message consumer.sessionPool
- the server session pool to associate with this connection consumermaxMessages
- the maximum number of messages that can be assigned to a server session at one time
javax.jms.JMSException
- if the Connection object fails to create a connection consumer due to some internal error or invalid arguments for sessionPool and messageSelector.
javax.jms.InvalidDestinationException
- if an invalid destination is specified.
javax.jms.InvalidSelectorException
- if the message selector is invalid.public javax.jms.ConnectionConsumer createDurableConnectionConsumer(javax.jms.Topic topic, java.lang.String name, java.lang.String messageSelector, javax.jms.ServerSessionPool sessionPool, int maxMessageCount) throws javax.jms.JMSException
createDurableConnectionConsumer
in interface javax.jms.Connection
topic
- the topic to be accessed.name
- the name of the durable subscription.messageSelector
- delivers only those messages with properties that match
the message selector expression.
A value of null or an empty string indicates that there is no message selector
for the message consumer.sessionPool
- the server session pool to associate with this
connection consumer.maxMessageCount
- the maximum number of messages that can be
assigned to a server session at one time.
javax.jms.JMSException
- if JMS Connection fails to create a durable connection
consumer due to some internal error or invalid arguments for sessionPool and
message selector.
javax.jms.InvalidSelectorException
- if the message selector is invalid.ConnectionConsumer
|
(c) Copyright IBM Corp. 2005. All Rights Reserved. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |