public abstract class AbstractConnection extends Object implements javax.jms.Connection
Base implementation for a JMS connection
| Modifier and Type | Field and Description |
|---|---|
protected String |
clientID |
protected boolean |
closed |
protected ReadWriteLock |
externalAccessLock |
protected String |
id |
protected IntegerIDProvider |
idProvider |
protected boolean |
started |
| Constructor and Description |
|---|
AbstractConnection(String clientID)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkNotClosed()
Check that the connection is not closed
|
void |
close() |
javax.jms.ConnectionConsumer |
createConnectionConsumer(javax.jms.Destination destination,
String messageSelector,
javax.jms.ServerSessionPool sessionPool,
int maxMessages) |
javax.jms.ConnectionConsumer |
createDurableConnectionConsumer(javax.jms.Topic topic,
String subscriptionName,
String messageSelector,
javax.jms.ServerSessionPool sessionPool,
int maxMessages) |
abstract void |
deleteTemporaryQueue(String queueName)
Delete a temporary queue
|
abstract void |
deleteTemporaryTopic(String topicName)
Delete a temporary topic
|
void |
exceptionOccured(javax.jms.JMSException exception)
Triggered when a JMSException is internally catched
|
protected void |
finalize() |
String |
getClientID() |
int |
getConsumersCount()
Get the number of active producers for this connection
|
void |
getEntitiesDescription(StringBuilder sb)
Get a description of entities held by this object
|
javax.jms.ExceptionListener |
getExceptionListener() |
String |
getId()
Get the connection id
|
javax.jms.ConnectionMetaData |
getMetaData() |
int |
getProducersCount()
Get the number of active producers for this connection
|
int |
getSessionsCount()
Get the number of active sessions for this connection
|
boolean |
isRegisteredTemporaryQueue(String queueName)
Check if a temporary queue was registered with this connection
|
boolean |
isRegisteredTemporaryTopic(String topicName)
Check if a temporary topic was registered with this connection
|
boolean |
isStarted()
Check if the connection is started
NOT SYNCHRONIZED TO AVOID DEADLOCKS
|
AbstractSession |
lookupRegisteredSession(IntegerID sessionId)
Lookup a registered session
|
protected void |
onConnectionClose() |
protected void |
onConnectionClosed() |
protected void |
registerSession(AbstractSession sessionToAdd)
Register a session
|
void |
registerTemporaryQueue(String queueName)
Register a temporary queue name
|
void |
registerTemporaryTopic(String topicName)
Register a temporary topic name
|
void |
setClientID(String clientID) |
void |
setExceptionListener(javax.jms.ExceptionListener listener) |
String |
toString() |
void |
unregisterSession(AbstractSession sessionToRemove)
Unregister a session
|
void |
unregisterTemporaryQueue(String queueName)
Unregister a temporary queue name
|
void |
unregisterTemporaryTopic(String topicName)
Unregister a temporary topic name
|
protected void |
waitForDeliverySync()
Wait for sessions to finish the current deliveridispatching
|
protected void |
wakeUpLocalConsumers()
Wake up all children consumers
(Used by LocalConnection only)
|
protected String id
protected String clientID
protected boolean started
protected boolean closed
protected IntegerIDProvider idProvider
protected ReadWriteLock externalAccessLock
public AbstractConnection(String clientID)
public String getId()
public String getClientID() throws javax.jms.JMSException
getClientID in interface javax.jms.Connectionjavax.jms.JMSExceptionpublic javax.jms.ConnectionMetaData getMetaData()
getMetaData in interface javax.jms.Connectionpublic void setClientID(String clientID) throws javax.jms.JMSException
setClientID in interface javax.jms.Connectionjavax.jms.JMSExceptionpublic javax.jms.ExceptionListener getExceptionListener()
getExceptionListener in interface javax.jms.Connectionpublic void setExceptionListener(javax.jms.ExceptionListener listener)
throws javax.jms.JMSException
setExceptionListener in interface javax.jms.Connectionjavax.jms.JMSExceptionpublic final void exceptionOccured(javax.jms.JMSException exception)
public final void registerTemporaryQueue(String queueName)
public final void unregisterTemporaryQueue(String queueName)
public final boolean isRegisteredTemporaryQueue(String queueName)
public final void registerTemporaryTopic(String topicName)
public final void unregisterTemporaryTopic(String topicName)
public final boolean isRegisteredTemporaryTopic(String topicName)
public abstract void deleteTemporaryQueue(String queueName) throws javax.jms.JMSException
javax.jms.JMSExceptionpublic abstract void deleteTemporaryTopic(String topicName) throws javax.jms.JMSException
javax.jms.JMSExceptionpublic final void close()
close in interface javax.jms.Connectionprotected void onConnectionClose()
protected void onConnectionClosed()
protected final void wakeUpLocalConsumers()
protected final void waitForDeliverySync()
public final AbstractSession lookupRegisteredSession(IntegerID sessionId)
protected final void registerSession(AbstractSession sessionToAdd)
public final void unregisterSession(AbstractSession sessionToRemove)
protected final void checkNotClosed()
throws javax.jms.JMSException
javax.jms.JMSExceptionpublic javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Destination destination,
String messageSelector,
javax.jms.ServerSessionPool sessionPool,
int maxMessages)
throws javax.jms.JMSException
createConnectionConsumer in interface javax.jms.Connectionjavax.jms.JMSExceptionpublic javax.jms.ConnectionConsumer createDurableConnectionConsumer(javax.jms.Topic topic,
String subscriptionName,
String messageSelector,
javax.jms.ServerSessionPool sessionPool,
int maxMessages)
throws javax.jms.JMSException
createDurableConnectionConsumer in interface javax.jms.Connectionjavax.jms.JMSExceptionprotected void finalize()
throws Throwable
public boolean isStarted()
public int getSessionsCount()
public int getConsumersCount()
public int getProducersCount()
public void getEntitiesDescription(StringBuilder sb)
Copyright © 2021. All rights reserved.