|
Oracle® Streams Advanced Queuing Java API Reference 10g Release 2 (10.2) B14291-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.jms.AQjmsObject
oracle.jms.AQjmsConnection
This is an Oracle class which implements javax.jms.QueueConnection
and javax.jms.TopicConnection
.
Method Summary | |
void |
close() Closes the connection. |
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. |
Methods inherited from class oracle.jms.AQjmsObject |
checkClosed, children, finalize, getID, getParent, isOpen, localClose, preClose |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
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
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. 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
Connection
Since a provider typically allocates significant resources outside the JVM on behalf of a connection, clients should close these resources when they are not needed. Relying on garbage collection to eventually reclaim these resources may not be timely enough.
There is no need to close the sessions, producers, and consumers of a closed connection.
Closing a connection causes all temporary destinations to be deleted.
When this method is invoked, it should not return until message processing has been shut down in an orderly fashion. This means that all message listeners that may have been running have returned, and that all pending receives have returned. A close terminates all pending message receives on the connection's sessions' consumers. The receives may return with a message or with null, depending on whether there was a message available at the time of the close. If one or more of the connection's sessions' message listeners is processing a message at the time when connection close
is invoked, all the facilities of the connection and its sessions must remain available to those listeners until they return control to the JMS provider.
Closing a connection causes any of its sessions' transactions in progress to be rolled back. In the case where a session's work is coordinated by an external transaction manager, a session's commit
and rollback
methods are not used and the result of a closed session's work is determined later by the transaction manager. Closing a connection does NOT force an acknowledgment of client-acknowledged sessions.
Invoking the acknowledge
method of a received message from a closed connection's session must throw an IllegalStateException
. Closing a closed connection must NOT throw an exception.
close
in interface Connection
JMSException
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
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
|
Oracle® Streams Advanced Queuing Java API Reference 10g Release 2 (10.2) B14291-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |