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,
AsyncResult request)
Commit the currently running Transaction.
|
boolean |
containsSubscription(String subscriptionName)
Query the Session to see if there are any registered consumer instances that have
a durable subscription with the given subscription name.
|
void |
createConsumer(JmsConsumerInfo consumerInfo,
AsyncResult request) |
void |
createProducer(JmsProducerInfo producerInfo,
AsyncResult request) |
AmqpConnection |
getConnection() |
AmqpConsumer |
getConsumer(JmsConsumerId consumerId) |
AmqpConsumer |
getConsumer(JmsConsumerInfo consumerInfo) |
AmqpProducer |
getProducer(JmsProducerId producerId) |
AmqpProducer |
getProducer(JmsProducerInfo producerInfo) |
AmqpProvider |
getProvider() |
JmsSessionId |
getSessionId() |
AmqpTransactionContext |
getTransactionContext() |
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(Exception 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,
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, getEndpoint, getLocalState, getParent, getRemoteState, getResourceInfo, isAwaitingClose, isClosed, isOpen, processDeliveryUpdates, processFlowUpdates, processRemoteClose, processRemoteDetach, processRemoteOpen, remotelyClosed, resourceClosed
public 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 AmqpProducer getProducer(JmsProducerId producerId)
public void createConsumer(JmsConsumerInfo consumerInfo, AsyncResult request)
public AmqpConsumer getConsumer(JmsConsumerInfo consumerInfo)
public AmqpConsumer getConsumer(JmsConsumerId consumerId)
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, AsyncResult request) throws Exception
transactionInfo
- the JmsTransactionInfo describing the transaction being committed.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, AsyncResult request) throws Exception
transactionInfo
- the JmsTransactionInfo describing the transaction being rolled back.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)
AmqpResourceParent
addChildResource
in interface AmqpResourceParent
resource
- The AmqpResource that is a child of this one.public void removeChildResource(AmqpResource resource)
AmqpResourceParent
removeChildResource
in interface AmqpResourceParent
resource
- The AmqpResource that is no longer a child of this one.public boolean containsSubscription(String subscriptionName)
subscriptionName
- the name of the subscription being searched for.public void reportError(Exception error)
error
- The error to forward on to the Provider error event handler.public AmqpProvider getProvider()
getProvider
in interface AmqpResourceParent
public AmqpConnection getConnection()
public JmsSessionId getSessionId()
public boolean isTransactionFailed()
Copyright © 2013–2016 The Apache Software Foundation. All rights reserved.