Class LocalConnection
- java.lang.Object
-
- net.timewalker.ffmq4.common.connection.AbstractConnection
-
- net.timewalker.ffmq4.local.connection.LocalConnection
-
- All Implemented Interfaces:
javax.jms.Connection
- Direct Known Subclasses:
LocalQueueConnection,LocalTopicConnection
public class LocalConnection extends AbstractConnection
Local implementation of a JMS
Connection
-
-
Field Summary
Fields Modifier and Type Field Description protected FFMQEngineengine-
Fields inherited from class net.timewalker.ffmq4.common.connection.AbstractConnection
clientID, closed, externalAccessLock, id, idProvider, started
-
-
Constructor Summary
Constructors Constructor Description LocalConnection(FFMQEngine engine, SecurityContext securityContext, String clientID)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckPermission(String resource, String action)Check if the connection has the required credentials to use the given resourcevoidcheckPermission(javax.jms.Destination destination, String action)Check if the connection has the required credentials to use the given destinationjavax.jms.SessioncreateSession(boolean transacted, int acknowledgeMode)javax.jms.SessioncreateSession(IntegerID sessionId, boolean transacted, int acknowledgeMode)voiddeleteTemporaryQueue(String queueName)Delete a temporary queuevoiddeleteTemporaryTopic(String topicName)Delete a temporary topicSecurityContextgetSecurityContext()Get the connection security contextbooleanisSecurityEnabled()Check if there is a security context enabled for this connectionprotected voidonConnectionClose()voidsetClientID(String clientID)voidstart()voidstop()-
Methods inherited from class net.timewalker.ffmq4.common.connection.AbstractConnection
checkNotClosed, close, createConnectionConsumer, createDurableConnectionConsumer, exceptionOccured, finalize, getClientID, getConsumersCount, getEntitiesDescription, getExceptionListener, getId, getMetaData, getProducersCount, getSessionsCount, isRegisteredTemporaryQueue, isRegisteredTemporaryTopic, isStarted, lookupRegisteredSession, onConnectionClosed, registerSession, registerTemporaryQueue, registerTemporaryTopic, setExceptionListener, toString, unregisterSession, unregisterTemporaryQueue, unregisterTemporaryTopic, waitForDeliverySync, wakeUpLocalConsumers
-
-
-
-
Field Detail
-
engine
protected FFMQEngine engine
-
-
Constructor Detail
-
LocalConnection
public LocalConnection(FFMQEngine engine, SecurityContext securityContext, String clientID)
Constructor
-
-
Method Detail
-
setClientID
public final void setClientID(String clientID) throws javax.jms.JMSException
- Specified by:
setClientIDin interfacejavax.jms.Connection- Overrides:
setClientIDin classAbstractConnection- Throws:
javax.jms.JMSException
-
createSession
public final javax.jms.Session createSession(boolean transacted, int acknowledgeMode) throws javax.jms.JMSException- Throws:
javax.jms.JMSException
-
createSession
public final javax.jms.Session createSession(IntegerID sessionId, boolean transacted, int acknowledgeMode) throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
-
start
public final void start() throws javax.jms.JMSException- Throws:
javax.jms.JMSException
-
stop
public final void stop() throws javax.jms.JMSException- Throws:
javax.jms.JMSException
-
deleteTemporaryQueue
public final void deleteTemporaryQueue(String queueName) throws javax.jms.JMSException
Description copied from class:AbstractConnectionDelete a temporary queue- Specified by:
deleteTemporaryQueuein classAbstractConnection- Throws:
javax.jms.JMSException
-
deleteTemporaryTopic
public final void deleteTemporaryTopic(String topicName) throws javax.jms.JMSException
Description copied from class:AbstractConnectionDelete a temporary topic- Specified by:
deleteTemporaryTopicin classAbstractConnection- Throws:
javax.jms.JMSException
-
checkPermission
public final void checkPermission(javax.jms.Destination destination, String action) throws javax.jms.JMSExceptionCheck if the connection has the required credentials to use the given destination- Throws:
javax.jms.JMSException
-
isSecurityEnabled
public final boolean isSecurityEnabled()
Check if there is a security context enabled for this connection- Returns:
- true if security is enabled
-
checkPermission
public final void checkPermission(String resource, String action) throws javax.jms.JMSException
Check if the connection has the required credentials to use the given resource- Throws:
javax.jms.JMSException
-
getSecurityContext
public final SecurityContext getSecurityContext()
Get the connection security context- Returns:
- the connection security context or null if security is disabled
-
onConnectionClose
protected void onConnectionClose()
- Overrides:
onConnectionClosein classAbstractConnection
-
-