org.objectweb.joram.client.jms
Class Connection

java.lang.Object
  extended byorg.objectweb.joram.client.jms.Connection
All Implemented Interfaces:
javax.jms.Connection
Direct Known Subclasses:
QueueConnection, TopicConnection, XAConnection

public class Connection
extends java.lang.Object
implements javax.jms.Connection

Implements the javax.jms.Connection interface.


Field Summary
 java.util.Hashtable repliesTable
          Table holding the server replies to synchronous requests.
 java.util.Hashtable requestsTable
          Table holding requests related objects, either locks of synchronous requests, or asynchronous consumers.
 java.util.Vector sessions
          Vector of the connection's sessions.
 
Constructor Summary
Connection(FactoryParameters factoryParameters, ConnectionItf connectionImpl)
          Creates a Connection instance.
 
Method Summary
 void close()
          API method for closing the connection; even if the connection appears to be broken, closes the sessions.
 javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Destination dest, java.lang.String selector, javax.jms.ServerSessionPool sessionPool, int maxMessages)
          API method.
 javax.jms.ConnectionConsumer createDurableConnectionConsumer(javax.jms.Topic topic, java.lang.String subName, java.lang.String selector, javax.jms.ServerSessionPool sessPool, int maxMessages)
          API method.
 javax.jms.Session createSession(boolean transacted, int acknowledgeMode)
          API method.
 boolean equals(java.lang.Object obj)
          Specializes this Object method; returns true if the parameter is a Connection instance sharing the same proxy identifier and connection key.
 java.lang.String getClientID()
          API method.
 javax.jms.ExceptionListener getExceptionListener()
          API method.
 javax.jms.ConnectionMetaData getMetaData()
          API method.
 void setClientID(java.lang.String clientID)
          API method.
 void setExceptionListener(javax.jms.ExceptionListener listener)
          API method.
 void start()
          API method for starting the connection.
 void stop()
          API method for stopping the connection; even if the connection appears to be broken, stops the sessions.
 java.lang.String toString()
          String image of the connection.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sessions

public java.util.Vector sessions
Vector of the connection's sessions.


requestsTable

public java.util.Hashtable requestsTable
Table holding requests related objects, either locks of synchronous requests, or asynchronous consumers.


repliesTable

public java.util.Hashtable repliesTable
Table holding the server replies to synchronous requests.

Constructor Detail

Connection

public Connection(FactoryParameters factoryParameters,
                  ConnectionItf connectionImpl)
           throws javax.jms.JMSException
Creates a Connection instance.

Parameters:
factoryParameters - The factory parameters.
connectionImpl - The actual connection to wrap.
Throws:
javax.jms.JMSSecurityException - If the user identification is incorrect.
javax.jms.IllegalStateException - If the server is not listening.
javax.jms.JMSException
Method Detail

toString

public java.lang.String toString()
String image of the connection.


equals

public boolean equals(java.lang.Object obj)
Specializes this Object method; returns true if the parameter is a Connection instance sharing the same proxy identifier and connection key.


createConnectionConsumer

public javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Destination dest,
                                                             java.lang.String selector,
                                                             javax.jms.ServerSessionPool sessionPool,
                                                             int maxMessages)
                                                      throws javax.jms.JMSException
API method.

Specified by:
createConnectionConsumer in interface javax.jms.Connection
Throws:
javax.jms.IllegalStateException - If the connection is closed.
InvalidSelectorException - If the selector syntax is wrong.
javax.jms.InvalidDestinationException - If the target destination does not exist.
javax.jms.JMSException - If the method fails for any other reason.

createDurableConnectionConsumer

public javax.jms.ConnectionConsumer createDurableConnectionConsumer(javax.jms.Topic topic,
                                                                    java.lang.String subName,
                                                                    java.lang.String selector,
                                                                    javax.jms.ServerSessionPool sessPool,
                                                                    int maxMessages)
                                                             throws javax.jms.JMSException
API method.

Specified by:
createDurableConnectionConsumer in interface javax.jms.Connection
Throws:
javax.jms.IllegalStateException - If the connection is closed.
InvalidSelectorException - If the selector syntax is wrong.
javax.jms.InvalidDestinationException - If the target topic does not exist.
javax.jms.JMSException - If the method fails for any other reason.

createSession

public javax.jms.Session createSession(boolean transacted,
                                       int acknowledgeMode)
                                throws javax.jms.JMSException
API method.

Specified by:
createSession in interface javax.jms.Connection
Throws:
javax.jms.IllegalStateException - If the connection is closed.
javax.jms.JMSException - In case of an invalid acknowledge mode.

setExceptionListener

public void setExceptionListener(javax.jms.ExceptionListener listener)
                          throws javax.jms.JMSException
API method.

Specified by:
setExceptionListener in interface javax.jms.Connection
Throws:
javax.jms.IllegalStateException - If the connection is closed.
javax.jms.JMSException

getExceptionListener

public javax.jms.ExceptionListener getExceptionListener()
                                                 throws javax.jms.JMSException
API method.

Specified by:
getExceptionListener in interface javax.jms.Connection
Throws:
javax.jms.IllegalStateException - If the connection is closed.
javax.jms.JMSException

setClientID

public void setClientID(java.lang.String clientID)
                 throws javax.jms.JMSException
API method.

Specified by:
setClientID in interface javax.jms.Connection
Throws:
javax.jms.IllegalStateException - Systematically thrown.
javax.jms.JMSException

getClientID

public java.lang.String getClientID()
                             throws javax.jms.JMSException
API method.

Specified by:
getClientID in interface javax.jms.Connection
Throws:
javax.jms.IllegalStateException - If the connection is closed.
javax.jms.JMSException

getMetaData

public javax.jms.ConnectionMetaData getMetaData()
                                         throws javax.jms.JMSException
API method.

Specified by:
getMetaData in interface javax.jms.Connection
Throws:
javax.jms.IllegalStateException - If the connection is closed.
javax.jms.JMSException

start

public void start()
           throws javax.jms.JMSException
API method for starting the connection.

Specified by:
start in interface javax.jms.Connection
Throws:
javax.jms.IllegalStateException - If the connection is closed or broken.
javax.jms.JMSException

stop

public void stop()
          throws javax.jms.JMSException
API method for stopping the connection; even if the connection appears to be broken, stops the sessions.

Specified by:
stop in interface javax.jms.Connection
Throws:
javax.jms.IllegalStateException - If the connection is closed or broken.
javax.jms.JMSException

close

public void close()
           throws javax.jms.JMSException
API method for closing the connection; even if the connection appears to be broken, closes the sessions.

Specified by:
close in interface javax.jms.Connection
Throws:
javax.jms.JMSException - Actually never thrown.


Copyright ? 2004 Scalagent - All rights reserved