Class PooledConnection
- java.lang.Object
-
- org.objectweb.joram.client.jms.pool.PooledConnection
-
- All Implemented Interfaces:
AutoCloseable,Connection
public class PooledConnection extends Object implements Connection
Implements a pooled connection.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) ConnectiondelegateThe underlying connection to Joram's server(package private) StringnameThe identity of the authentified user for this connection(package private) StringpasswordThe identity of the authentified user for this connection(package private) PooledConnectionFactorypcfThe pooled ConnectionFactory
-
Constructor Summary
Constructors Constructor Description PooledConnection(PooledConnectionFactory pcf, String name, String password)Creates a new pooled connection.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close the pooled connection, depending of the pool state this can results in the real closing of the connection of the inserting in the pool of idle connections.ConnectionConsumercreateConnectionConsumer(Destination dest, String selector, ServerSessionPool sessionPool, int maxMessages)ConnectionConsumercreateDurableConnectionConsumer(Topic topic, String subName, String selector, ServerSessionPool sessPool, int maxMessages)SessioncreateSession()SessioncreateSession(boolean transacted, int acknowledgeMode)SessioncreateSession(int sessionMode)ConnectionConsumercreateSharedConnectionConsumer(Topic topic, String subscriptionName, String messageSelector, ServerSessionPool sessionPool, int maxMessages)ConnectionConsumercreateSharedDurableConnectionConsumer(Topic topic, String subscriptionName, String messageSelector, ServerSessionPool sessionPool, int maxMessages)StringgetClientID()ExceptionListenergetExceptionListener()ConnectionMetaDatagetMetaData()voidsetClientID(String clientID)voidsetExceptionListener(ExceptionListener listener)voidstart()voidstop()StringtoString()
-
-
-
Field Detail
-
pcf
PooledConnectionFactory pcf
The pooled ConnectionFactory
-
delegate
Connection delegate
The underlying connection to Joram's server
-
name
String name
The identity of the authentified user for this connection
-
password
String password
The identity of the authentified user for this connection
-
-
Constructor Detail
-
PooledConnection
public PooledConnection(PooledConnectionFactory pcf, String name, String password) throws JMSException
Creates a new pooled connection.- Parameters:
pcf- The pooled ConnectionFactory.name- The name of the authentified user for this connection.password- The password of the authentified user for this connection.- Throws:
JMSException- An error occurs during the connection.
-
-
Method Detail
-
close
public void close() throws JMSExceptionClose the pooled connection, depending of the pool state this can results in the real closing of the connection of the inserting in the pool of idle connections.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceConnection- Throws:
JMSException- See Also:
Connection.close()
-
createConnectionConsumer
public ConnectionConsumer createConnectionConsumer(Destination dest, String selector, ServerSessionPool sessionPool, int maxMessages) throws JMSException
- Specified by:
createConnectionConsumerin interfaceConnection- Throws:
JMSException- See Also:
Connection.createConnectionConsumer(javax.jms.Destination, java.lang.String, javax.jms.ServerSessionPool, int)
-
createDurableConnectionConsumer
public ConnectionConsumer createDurableConnectionConsumer(Topic topic, String subName, String selector, ServerSessionPool sessPool, int maxMessages) throws JMSException
- Specified by:
createDurableConnectionConsumerin interfaceConnection- Throws:
JMSException- See Also:
Connection.createDurableConnectionConsumer(javax.jms.Topic, java.lang.String, java.lang.String, javax.jms.ServerSessionPool, int)
-
createSession
public Session createSession(boolean transacted, int acknowledgeMode) throws JMSException
- Specified by:
createSessionin interfaceConnection- Throws:
JMSException- See Also:
Connection.createSession(boolean, int)
-
getClientID
public String getClientID() throws JMSException
- Specified by:
getClientIDin interfaceConnection- Throws:
JMSException- See Also:
Connection.getClientID()
-
getExceptionListener
public ExceptionListener getExceptionListener() throws JMSException
- Specified by:
getExceptionListenerin interfaceConnection- Throws:
JMSException- See Also:
Connection.getExceptionListener()
-
getMetaData
public ConnectionMetaData getMetaData() throws JMSException
- Specified by:
getMetaDatain interfaceConnection- Throws:
JMSException- See Also:
Connection.getMetaData()
-
setClientID
public void setClientID(String clientID) throws JMSException
- Specified by:
setClientIDin interfaceConnection- Throws:
JMSException- See Also:
Connection.setClientID(java.lang.String)
-
setExceptionListener
public void setExceptionListener(ExceptionListener listener) throws JMSException
- Specified by:
setExceptionListenerin interfaceConnection- Throws:
JMSException- See Also:
Connection.setExceptionListener(javax.jms.ExceptionListener)
-
start
public void start() throws JMSException- Specified by:
startin interfaceConnection- Throws:
JMSException- See Also:
Connection.start()
-
stop
public void stop() throws JMSException- Specified by:
stopin interfaceConnection- Throws:
JMSException- See Also:
Connection.stop()
-
toString
public String toString()
- Overrides:
toStringin classObject- See Also:
Object.toString()
-
createSession
public Session createSession(int sessionMode) throws JMSException
- Specified by:
createSessionin interfaceConnection- Throws:
JMSException
-
createSession
public Session createSession() throws JMSException
- Specified by:
createSessionin interfaceConnection- Throws:
JMSException
-
createSharedConnectionConsumer
public ConnectionConsumer createSharedConnectionConsumer(Topic topic, String subscriptionName, String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException
- Specified by:
createSharedConnectionConsumerin interfaceConnection- Throws:
JMSException
-
createSharedDurableConnectionConsumer
public ConnectionConsumer createSharedDurableConnectionConsumer(Topic topic, String subscriptionName, String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException
- Specified by:
createSharedDurableConnectionConsumerin interfaceConnection- Throws:
JMSException
-
-