Class JmsActivation
- java.lang.Object
-
- org.jboss.resource.adapter.jms.inflow.JmsActivation
-
- All Implemented Interfaces:
javax.jms.ExceptionListener
public class JmsActivation extends Object implements javax.jms.ExceptionListener
A generic jms Activation.- Author:
- Adrian Brock, Jesper Pedersen, Justin Bertram
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.jms.ConnectionconnectionThe connectionprotected AtomicBooleandeliveryActiveWhether delivery is activeprotected javax.jms.DestinationdestinationThe destinationprotected javax.resource.spi.endpoint.MessageEndpointFactoryendpointFactoryThe message endpoint factoryprotected booleanisDeliveryTransactedIs the delivery transactedprotected booleanisTopicThe destination typestatic MethodONMESSAGEThe onMessage methodprotected JmsServerSessionPoolpoolThe server session poolprotected JmsResourceAdapterraThe resource adapterprotected JmsActivationSpecspecThe activation specprotected TransactionManagertmThe TransactionManager
-
Constructor Summary
Constructors Constructor Description JmsActivation(JmsResourceAdapter ra, javax.resource.spi.endpoint.MessageEndpointFactory endpointFactory, JmsActivationSpec spec)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ContextconvertStringToContext(String jndiParameters)static StringdefaultToString(Object object)JmsActivationSpecgetActivationSpec()javax.jms.ConnectiongetConnection()javax.jms.DestinationgetDestination()javax.resource.spi.endpoint.MessageEndpointFactorygetMessageEndpointFactory()TransactionManagergetTransactionManager()javax.resource.spi.work.WorkManagergetWorkManager()voidhandleFailure(Throwable failure)Handles any failure by trying to reconnectbooleanisDeliveryTransacted()booleanisTopic()voidonException(javax.jms.JMSException exception)protected voidsetupDestination(Context ctx)Setup the Destinationprotected voidsetupSessionPool()Setup the server session poolvoidstart()Start the activationvoidstop()Stop the activationprotected voidteardown()Teardown the activationprotected voidteardownConnection()Teardown the connectionprotected voidteardownDestination()Teardown the destinationprotected voidteardownSessionPool()Teardown the server session poolStringtoString()
-
-
-
Field Detail
-
ONMESSAGE
public static final Method ONMESSAGE
The onMessage method
-
ra
protected JmsResourceAdapter ra
The resource adapter
-
spec
protected JmsActivationSpec spec
The activation spec
-
endpointFactory
protected javax.resource.spi.endpoint.MessageEndpointFactory endpointFactory
The message endpoint factory
-
deliveryActive
protected AtomicBoolean deliveryActive
Whether delivery is active
-
destination
protected javax.jms.Destination destination
The destination
-
isTopic
protected boolean isTopic
The destination type
-
connection
protected javax.jms.Connection connection
The connection
-
pool
protected JmsServerSessionPool pool
The server session pool
-
isDeliveryTransacted
protected boolean isDeliveryTransacted
Is the delivery transacted
-
tm
protected TransactionManager tm
The TransactionManager
-
-
Constructor Detail
-
JmsActivation
public JmsActivation(JmsResourceAdapter ra, javax.resource.spi.endpoint.MessageEndpointFactory endpointFactory, JmsActivationSpec spec) throws javax.resource.ResourceException
- Throws:
javax.resource.ResourceException
-
-
Method Detail
-
getActivationSpec
public JmsActivationSpec getActivationSpec()
- Returns:
- the activation spec
-
getMessageEndpointFactory
public javax.resource.spi.endpoint.MessageEndpointFactory getMessageEndpointFactory()
- Returns:
- the message endpoint factory
-
isDeliveryTransacted
public boolean isDeliveryTransacted()
- Returns:
- whether delivery is transacted
-
getWorkManager
public javax.resource.spi.work.WorkManager getWorkManager()
- Returns:
- the work manager
-
getTransactionManager
public TransactionManager getTransactionManager()
-
getConnection
public javax.jms.Connection getConnection()
- Returns:
- the connection
-
getDestination
public javax.jms.Destination getDestination()
- Returns:
- the destination
-
isTopic
public boolean isTopic()
- Returns:
- the destination type
-
start
public void start() throws javax.resource.ResourceExceptionStart the activation- Throws:
javax.resource.ResourceException- for any error
-
stop
public void stop()
Stop the activation
-
handleFailure
public void handleFailure(Throwable failure)
Handles any failure by trying to reconnect- Parameters:
failure- the reason for the failure
-
onException
public void onException(javax.jms.JMSException exception)
- Specified by:
onExceptionin interfacejavax.jms.ExceptionListener
-
convertStringToContext
public static Context convertStringToContext(String jndiParameters) throws NamingException
- Throws:
NamingException
-
teardown
protected void teardown()
Teardown the activation
-
setupDestination
protected void setupDestination(Context ctx) throws Exception
Setup the Destination- Parameters:
ctx- the naming context- Throws:
Exception- for any error
-
teardownDestination
protected void teardownDestination()
Teardown the destination
-
teardownConnection
protected void teardownConnection()
Teardown the connection
-
setupSessionPool
protected void setupSessionPool() throws ExceptionSetup the server session pool- Throws:
Exception- for any error
-
teardownSessionPool
protected void teardownSessionPool()
Teardown the server session pool
-
-