| java.lang.Object org.objectweb.jonas_jms.JConnection
All known Subclasses: org.objectweb.jonas_jms.JTopicConnection, org.objectweb.jonas_jms.JQueueConnection,
JConnection | public class JConnection implements Connection(Code) | | Common methods used in JQueueConnection and JTopicConnection.
author: Laurent Chauvirey, Frederic Maistre, Nicolas Tachker author: Contributor(s): author: Philippe Durieux author: Jeff Mesnil connection anonymous author: Philippe Coq JMS 1.1 integration |
Method Summary | |
public void | close() When this method is invoked it should not return until message processing
has been orderly shut down. | public ConnectionConsumer | createConnectionConsumer(Destination destination, java.lang.String messageSelector, ServerSessionPool sessionPool, int maxMessages) | public ConnectionConsumer | createDurableConnectionConsumer(Topic topic, java.lang.String subscriptionName, java.lang.String messageSelector, ServerSessionPool sessionPool, int maxMessages) | public Session | createSession(boolean transacted, int acknowledgeMode) Creates a Session object.
Parameters: transacted - - indicates whether the session is transacted Parameters: acknowledgeMode - indicates whether the consumer or the client will acknowledge any messages it receives; ignored if the session is transacted. | public void | finalClose() | public String | getClientID() Get the client identifier for this connection. | public ExceptionListener | getExceptionListener() Get the ExceptionListener for this Connection. | public ConnectionMetaData | getMetaData() Get the meta data for this connection. | public String | getUser() | protected synchronized void | sessionClose(Session s) | protected synchronized boolean | sessionOpen(Session s) | public void | setClientID(String clientID) Set the client identifier for this connection. | public void | setExceptionListener(ExceptionListener listener) Set an exception listener for this connection. | public void | start() Start (or restart) a Connection's delivery of incoming messages. | public void | stop() Used to temporarily stop a Connection's delivery of incoming messages. |
INTERNAL_USER_NAME | final protected static String INTERNAL_USER_NAME(Code) | | |
closed | protected boolean closed(Code) | | |
globaltx | protected boolean globaltx(Code) | | |
tm | protected static TransactionManager tm(Code) | | |
xac | protected XAConnection xac(Code) | | |
JConnection | public JConnection(JConnectionFactory jcf, XAConnectionFactory xacf, String user, String passwd) throws JMSException(Code) | | Constructor of a JConnection for a specified user.
Parameters: user - user's name Parameters: passwd - user's password |
JConnection | public JConnection(JConnectionFactory jcf, XAConnectionFactory xacf) throws JMSException(Code) | | Constructor of a JConnection for an anonymous user.
|
close | public void close() throws JMSException(Code) | | When this method is invoked it should not return until message processing
has been orderly shut down. 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.
throws: JMSException - - if JMS implementation fails to return the client ID for this Connection due to some internal |
createConnectionConsumer | public ConnectionConsumer createConnectionConsumer(Destination destination, java.lang.String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException(Code) | | Creates a connection consumer for this connection (optional operation)
Parameters: destination - - the destination to access Parameters: 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. Parameters: sessionPool - - the server session pool to associate with this connection consumer Parameters: maxMessages - - the maximum number of messages that can be assigned to a server session at one time the connection consumer |
createDurableConnectionConsumer | public ConnectionConsumer createDurableConnectionConsumer(Topic topic, java.lang.String subscriptionName, java.lang.String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException(Code) | | Creates a connection consumer for this connection (optional operation)
Parameters: topic - - the topic to access Parameters: subscriptionName - - durable subscription name Parameters: 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. Parameters: sessionPool - - the server session pool to associate with this connection consumer Parameters: maxMessages - - the maximum number of messages that can be assigned to a server session at one time the durable connection consumer |
createSession | public Session createSession(boolean transacted, int acknowledgeMode) throws JMSException(Code) | | Creates a Session object.
Parameters: transacted - - indicates whether the session is transacted Parameters: 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. |
finalClose | public void finalClose() throws JMSException(Code) | | |
getClientID | public String getClientID() throws JMSException(Code) | | Get the client identifier for this connection. This value is JMS Provider specific.
Either pre-configured by an administrator in a ConnectionFactory or assigned dynamically
by the application by calling setClientID method.
the unique client identifier. throws: JMSException - - if JMS implementation fails to return the client ID for this Connection due to some internal |
getExceptionListener | public ExceptionListener getExceptionListener() throws JMSException(Code) | | Get the ExceptionListener for this Connection.
the ExceptionListener for this Connection. throws: JMSException - - general exception if JMS implementation fails to get the Exception listener for this Connection. |
getMetaData | public ConnectionMetaData getMetaData() throws JMSException(Code) | | Get the meta data for this connection.
the connection meta data. throws: JMSException - - general exception if JMS implementation fails to get the Connection meta-data for this Connection. |
getUser | public String getUser()(Code) | | Return the user associated to this connection
|
sessionClose | protected synchronized void sessionClose(Session s)(Code) | | A non transacted session has beem closed
|
sessionOpen | protected synchronized boolean sessionOpen(Session s)(Code) | | A new non transacted session has been opened
|
setClientID | public void setClientID(String clientID) throws JMSException(Code) | | Set the client identifier for this connection.
If another connection with clientID is already running when this method is called,
the JMS Provider should detect the duplicate id and throw InvalidClientIDException.
Parameters: clientID - - the unique client identifier throws: JMSException - - general exception if JMS implementation fails to set the client ID for this Connection due to some internal error. throws: InvalidClientIDException - - if JMS client specifies an invalid or duplicate client id. throws: IllegalStateException - - if attempting to set a connection's client identifier at the wrong time or when it has been administratively configured. |
setExceptionListener | public void setExceptionListener(ExceptionListener listener) throws JMSException(Code) | | Set an exception listener for this connection.
Parameters: listener - - the exception listener. throws: JMSException - - general exception if JMS implementation fails to set the Exception listener for this Connection. |
start | public void start() throws JMSException(Code) | | Start (or restart) a Connection's delivery of incoming messages.
throws: JMSException - - if JMS implementation fails to start the message delivery due to some internal error. |
stop | public void stop() throws JMSException(Code) | | 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.
throws: JMSException - - if JMS implementation fails to start the message delivery due to some internal error. |
|
|