public class AQjmsConnection extends oracle.jms.AQjmsObject implements QueueConnection, TopicConnection
javax.jms.QueueConnection
and javax.jms.TopicConnection
.Modifier and Type | Method and Description |
---|---|
void |
close()
Public for test harness purposes
|
ConnectionConsumer |
createConnectionConsumer(Destination destination, java.lang.String messageSelector, ServerSessionPool sessionPool, int maxMessages)
Creates a connection consumer for this connection (optional operation).
|
ConnectionConsumer |
createConnectionConsumer(Queue queue, java.lang.String messageSelector, ServerSessionPool sessionPool, int maxMessages)
This method is not supported in the current release.
|
ConnectionConsumer |
createConnectionConsumer(Topic topic, java.lang.String messageSelector, ServerSessionPool sessionPool, int maxMessages)
Creates a connection consumer for this connection.
|
ConnectionConsumer |
createDurableConnectionConsumer(Topic topic, java.lang.String subscriptionName, java.lang.String messageSelector, ServerSessionPool sessionPool, int maxMessages)
Creates a durable connection consumer for this connection.
|
QueueSession |
createQueueSession(boolean transacted, int acknowledgeMode)
Creates a queue session.
|
Session |
createSession(boolean transacted, int acknowledgeMode)
Creates a
Session object. |
TopicSession |
createTopicSession(boolean transacted, int acknowledgeMode)
Creates a
TopicSession . |
java.lang.String |
getClientID()
Gets this connection's client identifier.
|
Session |
getCurrentJmsSession()
Returns the current open JMS session for this connection.
|
ExceptionListener |
getExceptionListener()
Gets this connection's
ExceptionListener . |
ConnectionMetaData |
getMetaData()
Gets this connection's meta data.
|
oracle.jdbc.pool.OracleOCIConnectionPool |
getOCIConnectionPool()
Gets the underlying connection pool for this connection.
|
void |
setClientID(java.lang.String clientID)
Sets this connection's client identifier.
|
void |
setExceptionListener(ExceptionListener listener)
Sets this connection's
ExceptionListener . |
void |
start()
Starts (or restarts) a connection's delivery of incoming messages.
|
void |
stop()
Temporarily stops a connection's delivery of incoming messages.
|
public java.lang.String getClientID() throws JMSException
getClientID
in interface Connection
JMSException
- if the client ID for this connection is not returned due to some error.public void setClientID(java.lang.String clientID) throws JMSException
setClientID
in interface Connection
clientID
- the unique client identifierJMSException
- if the client ID for this connection is not set due to some error.IllegalStateException
- if the JMS client attempts to set a connection's client ID at the wrong time or when it has been administratively configured.public ConnectionMetaData getMetaData() throws JMSException
getMetaData
in interface Connection
JMSException
- if the connection meta-data is not retrieved due to some error.ConnectionMetaData
public void setExceptionListener(ExceptionListener listener) throws JMSException
ExceptionListener
.setExceptionListener
in interface Connection
listener
- the exception listenerJMSException
- if the exception listener is not set due to some error.public ExceptionListener getExceptionListener() throws JMSException
ExceptionListener
.getExceptionListener
in interface Connection
ExceptionListener
for this connection, or null. if no ExceptionListener
is associated with this connection.JMSException
- if the exception listener is not retrieved due to some error.Connection.setExceptionListener(javax.jms.ExceptionListener)
public void start() throws JMSException
start
in interface Connection
JMSException
- if message delivery is not started due to some error.Connection.start()
public void stop() throws JMSException
AQjmsConnection.start()
method. When stopped, delivery to all of the connection's message consumers is inhibited: synchronous receives block and messages are not delivered to message listeners. A default timeout of 60 minutes is set to disable the MessageListener(s) set on the message consumer(s), which can by configured by setting the system property oracle.jms.notificationTimeOut in milli seconds, to an appropriate value. If there is a time out while disabling the MessageLister(s), the Connection will be started to keep the system in a good condition. After stop is called there may still be some messages delivered. Stopping a connection has no affect on its ability to send messages. Stopping a stopped connection is ignored.stop
in interface Connection
JMSException
- if message delivery is not stopped due to some error.Connection.stop()
public void close() throws JMSException
oracle.jms.AQjmsObject
close
in interface Connection
close
in class oracle.jms.AQjmsObject
JMSException
- if the JMS provider fails to close the connection due to some internal error. For example, a failure to release resources or to close a socket connection can cause this exception to be thrown.public QueueSession createQueueSession(boolean transacted, int acknowledgeMode) throws JMSException
createQueueSession
in interface QueueConnection
transacted
- is session transacted?acknowledgeMode
- acknowledgement modeJMSException
- if queue session creation fails.Session.AUTO_ACKNOWLEDGE
, Session.CLIENT_ACKNOWLEDGE
, Session.DUPS_OK_ACKNOWLEDGE
public ConnectionConsumer createConnectionConsumer(Queue queue, java.lang.String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException
createConnectionConsumer
in interface QueueConnection
queue
- the queue 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 timeJMSException
- NOT_SUPPORTED
ConnectionConsumer
public TopicSession createTopicSession(boolean transacted, int acknowledgeMode) throws JMSException
TopicSession
.createTopicSession
in interface TopicConnection
transacted
- if true
, the session is transacted.acknowledgeMode
- indicates whether the consumer or the client will acknowledge any messages it receives. This parameter is ignored if the session is transacted.JMSException
- if session creation fails due to some error or lack of support for the specific transaction and acknowledgement mode.Session.AUTO_ACKNOWLEDGE
, Session.CLIENT_ACKNOWLEDGE
, Session.DUPS_OK_ACKNOWLEDGE
public ConnectionConsumer createConnectionConsumer(Topic topic, java.lang.String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException
createConnectionConsumer
in interface TopicConnection
topic
- the topic 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 timeJMSException
- NOT_SUPPORTED
ConnectionConsumer
public ConnectionConsumer createDurableConnectionConsumer(Topic topic, java.lang.String subscriptionName, java.lang.String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException
createDurableConnectionConsumer
in interface Connection
createDurableConnectionConsumer
in interface TopicConnection
topic
- topic to accesssubscriptionName
- durable subscription namemessageSelector
- 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 durable connection consumermaxMessages
- the maximum number of messages that can be assigned to a server session at one timeJMSException
- NOT_SUPPORTED
ConnectionConsumer
public Session getCurrentJmsSession()
Important: This method will be deprecated in a future release
null
if no JMS session is currently availablepublic oracle.jdbc.pool.OracleOCIConnectionPool getOCIConnectionPool()
oracle.jdbc.pool.OracleOCIConnectionPool
pool used to create this connection or null
public Session createSession(boolean transacted, int acknowledgeMode) throws JMSException
Session
object.createSession
in interface Connection
transacted
- indicates whether the session is transactedacknowledgeMode
- indicates whether the consumer or the client will acknowledge any messages it receives; ignored if the session is transacted. Legal values are Session.AUTO_ACKNOWLEDGE
, Session.CLIENT_ACKNOWLEDGE
, and Session.DUPS_OK_ACKNOWLEDGE
.JMSException
- if session creation fails due to some error or lack of support for the specific transaction and acknowledgement mode.Session.AUTO_ACKNOWLEDGE
, Session.CLIENT_ACKNOWLEDGE
, Session.DUPS_OK_ACKNOWLEDGE
public ConnectionConsumer createConnectionConsumer(Destination destination, java.lang.String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException
createConnectionConsumer
in interface 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 timeJMSException
- NOT_SUPPORTED
ConnectionConsumer