public class AmqpSession extends AmqpAbstractResource<JmsSessionInfo,org.apache.qpid.proton.engine.Session> implements AmqpResourceParent
closeRequest, closeTimeoutTask| Constructor and Description |
|---|
AmqpSession(AmqpConnection connection,
JmsSessionInfo info,
org.apache.qpid.proton.engine.Session session) |
| Modifier and Type | Method and Description |
|---|---|
void |
acknowledge(ProviderConstants.ACK_TYPE ackType)
Perform an acknowledge of all delivered messages for all consumers active in this
Session.
|
void |
addChildResource(AmqpResource resource)
Adds the given resource as a child of this resource so that it's
lifetime becomes managed by that of its parent.
|
void |
begin(JmsTransactionId txId,
AsyncResult request)
Begins a new Transaction using the given Transaction Id as the identifier.
|
void |
commit(JmsTransactionInfo transactionInfo,
JmsTransactionInfo nextTransactionInfo,
AsyncResult request)
Commit the currently running Transaction.
|
void |
createConsumer(JmsConsumerInfo consumerInfo,
AsyncResult request) |
void |
createProducer(JmsProducerInfo producerInfo,
AsyncResult request) |
AmqpConnection |
getConnection() |
AmqpConsumer |
getConsumer(JmsConsumerInfo consumerInfo) |
AmqpProducer |
getProducer(JmsProducerInfo producerInfo) |
AmqpProvider |
getProvider() |
JmsSessionId |
getSessionId() |
AmqpTransactionContext |
getTransactionContext() |
void |
handleResourceClosure(AmqpProvider provider,
ProviderException error) |
boolean |
isTransactionFailed() |
void |
recover()
Perform re-send of all delivered but not yet acknowledged messages for all consumers
active in this Session.
|
void |
removeChildResource(AmqpResource resource)
Removes the given resource from the registered child resources
managed by this one.
|
void |
reportError(ProviderException error)
Call to send an error that occurs outside of the normal asynchronous processing
of a session resource such as a remote close etc.
|
void |
rollback(JmsTransactionInfo transactionInfo,
JmsTransactionInfo nextTransactionInfo,
AsyncResult request)
Roll back the currently running Transaction
|
ScheduledFuture<?> |
schedule(Runnable task,
long delay)
Allows a session resource to schedule a task for future execution.
|
String |
toString() |
close, closeOrDetachEndpoint, closeResource, getEndpoint, getLocalState, getParent, getRemoteState, getResourceInfo, isAwaitingClose, isClosed, isOpen, processDeliveryUpdates, processFlowUpdates, processRemoteClose, processRemoteDetach, processRemoteOpenpublic AmqpSession(AmqpConnection connection, JmsSessionInfo info, org.apache.qpid.proton.engine.Session session)
public void acknowledge(ProviderConstants.ACK_TYPE ackType)
ackType - controls the acknowledgement that is applied to each message.public void recover()
throws Exception
Exception - if an error occurs while performing the recover.public void createProducer(JmsProducerInfo producerInfo, AsyncResult request)
public AmqpProducer getProducer(JmsProducerInfo producerInfo)
public void createConsumer(JmsConsumerInfo consumerInfo, AsyncResult request)
public AmqpConsumer getConsumer(JmsConsumerInfo consumerInfo)
public AmqpTransactionContext getTransactionContext()
public void begin(JmsTransactionId txId, AsyncResult request) throws Exception
txId - The JMS Framework's assigned Transaction Id for the new TX.request - The request that will be signaled on completion of this operation.Exception - if an error occurs while performing the operation.public void commit(JmsTransactionInfo transactionInfo, JmsTransactionInfo nextTransactionInfo, AsyncResult request) throws Exception
transactionInfo - the JmsTransactionInfo describing the transaction being committed.nextTransactionInfo - the JmsTransactionInfo describing the transaction that should be started immediately.request - The request that will be signaled on completion of this operation.Exception - if an error occurs while performing the operation.public void rollback(JmsTransactionInfo transactionInfo, JmsTransactionInfo nextTransactionInfo, AsyncResult request) throws Exception
transactionInfo - the JmsTransactionInfo describing the transaction being rolled back.nextTransactionInfo - the JmsTransactionInfo describing the transaction that should be started immediately.request - The request that will be signaled on completion of this operation.Exception - if an error occurs while performing the operation.public ScheduledFuture<?> schedule(Runnable task, long delay)
task - The Runnable task to be executed after the given delay.delay - The delay in milliseconds to schedule the given task for execution.public void addChildResource(AmqpResource resource)
AmqpResourceParentaddChildResource in interface AmqpResourceParentresource - The AmqpResource that is a child of this one.public void removeChildResource(AmqpResource resource)
AmqpResourceParentremoveChildResource in interface AmqpResourceParentresource - The AmqpResource that is no longer a child of this one.public void handleResourceClosure(AmqpProvider provider, ProviderException error)
handleResourceClosure in class AmqpAbstractResource<JmsSessionInfo,org.apache.qpid.proton.engine.Session>public void reportError(ProviderException error)
error - The error to forward on to the Provider error event handler.public AmqpProvider getProvider()
getProvider in interface AmqpResourceParentpublic AmqpConnection getConnection()
public JmsSessionId getSessionId()
public boolean isTransactionFailed()
Copyright © 2013–2019 The Apache Software Foundation. All rights reserved.