Methods Summary |
---|
private org.jboss.resource.adapter.jms.inflow.JmsServerSession$TransactionDemarcationStrategy | createTransactionDemarcation()
return new DemarcationStrategyFactory().getStrategy();
|
public javax.jms.Session | getSession()
return session;
|
public void | onMessage(javax.jms.Message message)
try
{
endpoint.beforeDelivery(JmsActivation.ONMESSAGE);
try
{
if (dlqHandler == null || dlqHandler.handleRedeliveredMessage(message) == false)
{
MessageListener listener = (MessageListener) endpoint;
listener.onMessage(message);
}
}
finally
{
endpoint.afterDelivery();
if (dlqHandler != null)
dlqHandler.messageDelivered(message);
}
}
catch (Throwable t)
{
log.error("Unexpected error delivering message " + message, t);
if (txnStrategy != null)
txnStrategy.error();
}
|
public void | release()
|
public void | run()
try
{
txnStrategy = createTransactionDemarcation();
}
catch (Throwable t)
{
log.error("Error creating transaction demarcation. Cannot continue.");
return;
}
try
{
session.run();
}
catch (Throwable t)
{
if (txnStrategy != null)
txnStrategy.error();
}
finally
{
if (txnStrategy != null)
txnStrategy.end();
txnStrategy = null;
}
|
public void | setup()Setup the session
JmsActivation activation = pool.getActivation();
JmsActivationSpec spec = activation.getActivationSpec();
dlqHandler = activation.getDLQHandler();
Connection connection = activation.getConnection();
// Create the session
if (connection instanceof XAConnection && activation.isDeliveryTransacted())
{
xaSession = ((XAConnection) connection).createXASession();
session = xaSession.getSession();
}
else
{
transacted = spec.isSessionTransacted();
acknowledge = spec.getAcknowledgeModeInt();
session = connection.createSession(transacted, acknowledge);
}
// Get the endpoint
MessageEndpointFactory endpointFactory = activation.getMessageEndpointFactory();
XAResource xaResource = null;
if (activation.isDeliveryTransacted() && xaSession != null)
xaResource = xaSession.getXAResource();
endpoint = endpointFactory.createEndpoint(xaResource);
// Set the message listener
session.setMessageListener(this);
|
public void | start()
JmsActivation activation = pool.getActivation();
WorkManager workManager = activation.getWorkManager();
try
{
workManager.scheduleWork(this, 0, null, this);
}
catch (WorkException e)
{
log.error("Unable to schedule work", e);
throw new JMSException("Unable to schedule work: " + e.toString());
}
|
public void | teardown()Stop the session
try
{
if (endpoint != null)
endpoint.release();
}
catch (Throwable t)
{
log.debug("Error releasing endpoint " + endpoint, t);
}
try
{
if (xaSession != null)
xaSession.close();
}
catch (Throwable t)
{
log.debug("Error releasing xaSession " + xaSession, t);
}
try
{
if (session != null)
session.close();
}
catch (Throwable t)
{
log.debug("Error releasing session " + session, t);
}
|
public void | workAccepted(javax.resource.spi.work.WorkEvent e)
|
public void | workCompleted(javax.resource.spi.work.WorkEvent e)
pool.returnServerSession(this);
|
public void | workRejected(javax.resource.spi.work.WorkEvent e)
pool.returnServerSession(this);
|
public void | workStarted(javax.resource.spi.work.WorkEvent e)
|