Oracle® Streams Advanced Queuing Java API Reference
Release 1 (10.1)

B12023-01

oracle.jms
Class AQjmsConnection

java.lang.Object
  |
  +--oracle.jms.AQjmsObject
        |
        +--oracle.jms.AQjmsConnection
All Implemented Interfaces:
Connection, QueueConnection, TopicConnection

public class AQjmsConnection
extends oracle.jms.AQjmsObject
implements QueueConnection, TopicConnection

Oracle class implementing javax.jms.QueueConnection, javax.jms.TopicConnection


Method Summary
 void close()
          Closes the connection.
 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 (optional operation).
 javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Queue queue, java.lang.String messageSelector, javax.jms.ServerSessionPool sessionPool, int maxMessages)
          This method is not supported in the current release
 javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Topic topic, java.lang.String messageSelector, javax.jms.ServerSessionPool sessionPool, int maxMessages)
          Create a connection consumer for this connection.
 javax.jms.ConnectionConsumer createDurableConnectionConsumer(javax.jms.Topic topic, java.lang.String subscriptionName, java.lang.String messageSelector, javax.jms.ServerSessionPool sessionPool, int maxMessages)
          Create a durable connection consumer for this connection.
 javax.jms.QueueSession createQueueSession(boolean transacted, int ack_mode)
          create a queue session
 javax.jms.Session createSession(boolean transacted, int acknowledgeMode)
          Creates a Session object.
 javax.jms.TopicSession createTopicSession(boolean transacted, int ack_mode)
          Create a TopicSession
 java.lang.String getClientID()
          Get the client identifier for this connection.
 javax.jms.Session getCurrentJmsSession()
          Return the current open JMS session for this connection Important: This method will be deprecated in a future release
 javax.jms.ExceptionListener getExceptionListener()
          Get Exception Listener for this Connection.
 javax.jms.ConnectionMetaData getMetaData()
          Get the meta data for this connection.
 oracle.jdbc.pool.OracleOCIConnectionPool getOCIConnectionPool()
          Get the underlying Connection Pool for this connection
protected  boolean isUseTempLobs()
          Getter and Setter for m_usetemplobs
 void setClientID(java.lang.String clientID)
          Set the client identifier for this connection
 void setExceptionListener(javax.jms.ExceptionListener listener)
          Set an exception listener for this connection.
 void start()
          Start (or restart) a Connection's delivery of incoming messages.
 void stop()
          Used to temporarily stop 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

getClientID

public java.lang.String getClientID()
                             throws JMSException
Get the client identifier for this connection.
Specified by:
getClientID in interface Connection
Returns:
the unique client identifier.
Throws:
JMSException - if JMS implementation fails to return the client ID for this Connection due to some internal error.

setClientID

public void setClientID(java.lang.String clientID)
                 throws JMSException
Set the client identifier for this connection
Specified by:
setClientID in interface Connection
Parameters:
clientID - the unique client identifier
Throws:
JMSException - if the JMS provider fails to set the client ID for this connection due to some internal 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.

getMetaData

public javax.jms.ConnectionMetaData getMetaData()
                                         throws JMSException
Get the meta data for this connection.
Specified by:
getMetaData in interface Connection
Returns:
the connection meta data.
Throws:
JMSException - general exception if JMS implementation fails to get the Connection meta-data for this Connection.
See Also:
ConnectionMetaData

setExceptionListener

public void setExceptionListener(javax.jms.ExceptionListener listener)
                          throws JMSException
Set an exception listener for this connection.
Specified by:
setExceptionListener in interface Connection
Parameters:
listener - the exception listener
Throws:
JMSException

getExceptionListener

public javax.jms.ExceptionListener getExceptionListener()
                                                 throws JMSException
Get Exception Listener for this Connection.
Specified by:
getExceptionListener in interface Connection
Returns:
the ExceptionListener for this connection, or null. if no ExceptionListener is associated with this connection.
Throws:
JMSException
See Also:
Connection.setExceptionListener(javax.jms.ExceptionListener)

isUseTempLobs

protected boolean isUseTempLobs()
Getter and Setter for m_usetemplobs

start

public void start()
           throws JMSException
Start (or restart) a Connection's delivery of incoming messages. Restart begins with the oldest unacknowledged message. Starting a started session is ignored.
Specified by:
start in interface Connection
Throws:
JMSException - if JMS implementation fails to start the message delivery due to some internal error.
See Also:
Connection.stop()

stop

public void stop()
          throws JMSException
Used to temporarily stop a Connection's delivery of incoming messages. It can be restarted using its start method. When stopped, delivery to all the Connection's message consumers is inhibited: synchronous receive's block and messages are not delivered to message listeners. After stop is called there may still be some messages delivered. Stopping a Session has no affect on its ability to send messages. Stopping a stopped session is ignored.
Specified by:
stop in interface Connection
Throws:
JMSException - if JMS implementation fails to stop the message delivery due to some internal error.
See Also:
Connection.start()

close

public void close()
           throws JMSException
Description copied from interface: Connection
Closes the 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.

Specified by:
close in interface Connection
Overrides:
close in class oracle.jms.AQjmsObject
Throws:
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.

createQueueSession

public javax.jms.QueueSession createQueueSession(boolean transacted,
                                                 int ack_mode)
                                          throws JMSException
create a queue session
Specified by:
createQueueSession in interface QueueConnection
Parameters:
transacted - is session transacted?
ack_mode - 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.
Returns:
QueueSession. A A QueueSession provides methods for creating QueueReceiver's, QueueSender's, QueueBrowser's.
Throws:
JMSException - if JMS fails to create queue session
See Also:
Session.AUTO_ACKNOWLEDGE, Session.CLIENT_ACKNOWLEDGE, Session.DUPS_OK_ACKNOWLEDGE

createConnectionConsumer

public javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Queue queue,
                                                             java.lang.String messageSelector,
                                                             javax.jms.ServerSessionPool sessionPool,
                                                             int maxMessages)
                                                      throws JMSException
This method is not supported in the current release
Specified by:
createConnectionConsumer in interface QueueConnection
Parameters:
queue - the queue to access
messageSelector - 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 consumer
maxMessages - the maximum number of messages that can be assigned to a server session at one time
Returns:
the connection consumer
Throws:
JMSException - NOT_SUPPORTED
See Also:
ConnectionConsumer

createTopicSession

public javax.jms.TopicSession createTopicSession(boolean transacted,
                                                 int ack_mode)
                                          throws JMSException
Create a TopicSession
Specified by:
createTopicSession in interface TopicConnection
Parameters:
transacted - if true, the session is transacted.
ack_mode - 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.
Returns:
a newly created topic session.
Throws:
JMSException - if JMS Connection fails to create a session due to some internal error or lack of support for specific transaction and acknowledgement mode.
See Also:
Session.AUTO_ACKNOWLEDGE, Session.CLIENT_ACKNOWLEDGE, Session.DUPS_OK_ACKNOWLEDGE

createConnectionConsumer

public javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Topic topic,
                                                             java.lang.String messageSelector,
                                                             javax.jms.ServerSessionPool sessionPool,
                                                             int maxMessages)
                                                      throws JMSException
Create a connection consumer for this connection. This is an expert facility not used by regular JMS clients. This method is not supported in the current release
Specified by:
createConnectionConsumer in interface TopicConnection
Parameters:
topic - the topic to access
messageSelector - 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 consumer
maxMessages - the maximum number of messages that can be assigned to a server session at one time
Returns:
the connection consumer
Throws:
JMSException - NOT_SUPPORTED
See Also:
ConnectionConsumer

createDurableConnectionConsumer

public javax.jms.ConnectionConsumer createDurableConnectionConsumer(javax.jms.Topic topic,
                                                                    java.lang.String subscriptionName,
                                                                    java.lang.String messageSelector,
                                                                    javax.jms.ServerSessionPool sessionPool,
                                                                    int maxMessages)
                                                             throws JMSException
Create a durable connection consumer for this connection. This is an expert facility not used by regular JMS clients. This method is not supported in the current release
Specified by:
createDurableConnectionConsumer in interface Connection
Parameters:
topic - the topic to access
subscriptionName - durable subscription name
messageSelector - 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 consumer
maxMessages - the maximum number of messages that can be assigned to a server session at one time
Returns:
the durable connection consumer
Throws:
JMSException - NOT_SUPPORTED
See Also:
ConnectionConsumer

getCurrentJmsSession

public javax.jms.Session getCurrentJmsSession()
Return the current open JMS session for this connection

Important: This method will be deprecated in a future release

Returns:
the current open JMS Session or null, if no JMS Session is currently available.

getOCIConnectionPool

public oracle.jdbc.pool.OracleOCIConnectionPool getOCIConnectionPool()
Get the underlying Connection Pool for this connection
Returns:
oracle.jdbc.pool.OracleOCIConnectionPool pool used to create this connection or null.

createSession

public javax.jms.Session createSession(boolean transacted,
                                       int acknowledgeMode)
                                throws JMSException
Creates a Session object.
Specified by:
createSession in interface Connection
Parameters:
transacted - indicates whether the session is transacted
acknowledgeMode - 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.
Returns:
a newly created session
Throws:
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.
Since:
1.1
See Also:
Session.AUTO_ACKNOWLEDGE, Session.CLIENT_ACKNOWLEDGE, Session.DUPS_OK_ACKNOWLEDGE

createConnectionConsumer

public javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Destination destination,
                                                             java.lang.String messageSelector,
                                                             javax.jms.ServerSessionPool sessionPool,
                                                             int maxMessages)
                                                      throws JMSException
Creates a connection consumer for this connection (optional operation). This is an expert facility not used by regular JMS clients.
Specified by:
createConnectionConsumer in interface Connection
Parameters:
destination - the destination to access
messageSelector - 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 consumer
maxMessages - the maximum number of messages that can be assigned to a server session at one time
Returns:
the connection consumer
Throws:
JMSException - if the Connection object fails to create a connection consumer due to some internal error or invalid arguments for sessionPool and messageSelector.
InvalidDestinationException - if an invalid destination is specified.
InvalidSelectorException - if the message selector is invalid.
Since:
1.1
See Also:
ConnectionConsumer

Oracle® Streams Advanced Queuing Java API Reference
Release 1 (10.1)

B12023-01

Copyright © 2003, Oracle. All Rights Reserved.