org.apache.qpid.client
Class AMQSession_0_8
java.lang.Object
org.apache.qpid.client.Closeable
org.apache.qpid.client.AMQSession<BasicMessageConsumer_0_8,BasicMessageProducer_0_8>
org.apache.qpid.client.AMQSession_0_8
- All Implemented Interfaces:
- Runnable, QueueSession, Session, TopicSession
public final class AMQSession_0_8
- extends AMQSession<BasicMessageConsumer_0_8,BasicMessageProducer_0_8>
Fields inherited from class org.apache.qpid.client.AMQSession |
_acknowledgeMode, _channelId, _connection, _consumers, _deliveredMessageTags, _dispatcher, _dispatcherThread, _firstDispatcher, _immediatePrefetch, _messageFactoryRegistry, _queue, _reverseSubscriptionMap, _strictAMQP, _strictAMQPFATAL, _subscriberAccess, _subscriberDetails, _subscriptions, _thisSession, _transacted, _unacknowledgedMessageTags, DECLARE_EXCHANGES, DECLARE_QUEUES, DEFAULT_FLOW_CONTROL_WAIT_FAILURE, DEFAULT_IMMEDIATE, DEFAULT_MANDATORY, DEFAULT_WAIT_ON_SEND, FLOW_CONTROL_WAIT_FAILURE, FLOW_CONTROL_WAIT_PERIOD, IMMEDIATE_PREFETCH, IMMEDIATE_PREFETCH_DEFAULT, STRICT_AMQP, STRICT_AMQP_DEFAULT, STRICT_AMQP_FATAL, STRICT_AMQP_FATAL_DEFAULT, USE_AMQP_ENCODED_MAP_MESSAGE |
Constructor Summary |
AMQSession_0_8(AMQConnection con,
int channelId,
boolean transacted,
int acknowledgeMode,
int defaultPrefetchHigh,
int defaultPrefetchLow)
Creates a new session on a connection with the default message factory factory. |
AMQSession_0_8(AMQConnection con,
int channelId,
boolean transacted,
int acknowledgeMode,
MessageFactoryRegistry messageFactoryRegistry,
int defaultPrefetchHighMark,
int defaultPrefetchLowMark)
Creates a new session on a connection. |
Method Summary |
void |
acknowledgeMessage(long deliveryTag,
boolean multiple)
Acknowledge one or many messages. |
BasicMessageConsumer_0_8 |
createMessageConsumer(AMQDestination destination,
int prefetchHigh,
int prefetchLow,
boolean noLocal,
boolean exclusive,
String messageSelector,
org.apache.qpid.framing.FieldTable arguments,
boolean noConsume,
boolean autoClose)
|
BasicMessageProducer_0_8 |
createMessageProducer(Destination destination,
boolean mandatory,
boolean immediate,
boolean waitUntilSent,
long producerId)
|
protected void |
flushAcknowledgments()
|
AMQMessageDelegateFactory |
getMessageDelegateFactory()
|
void |
handleAddressBasedDestination(AMQDestination dest,
boolean isConsumer,
boolean noWait)
|
boolean |
isQueueBound(AMQDestination destination)
|
boolean |
isQueueBound(org.apache.qpid.framing.AMQShortString exchangeName,
org.apache.qpid.framing.AMQShortString queueName,
org.apache.qpid.framing.AMQShortString routingKey)
Tests whether or not the specified queue is bound to the specified exchange under a particular routing key. |
boolean |
isQueueBound(String exchangeName,
String queueName,
String bindingKey,
Map<String,Object> args)
|
void |
messageReceived(UnprocessedMessage message)
Invoked by the MINA IO thread (indirectly) when a message is received from the transport. |
void |
rejectMessage(long deliveryTag,
boolean requeue)
|
void |
releaseForRollback()
|
protected Long |
requestQueueDepth(AMQDestination amqd)
|
void |
sendClose(long timeout)
|
void |
sendCommit()
|
void |
sendConsume(BasicMessageConsumer_0_8 consumer,
org.apache.qpid.framing.AMQShortString queueName,
AMQProtocolHandler protocolHandler,
boolean nowait,
String messageSelector,
int tag)
|
void |
sendCreateQueue(org.apache.qpid.framing.AMQShortString name,
boolean autoDelete,
boolean durable,
boolean exclusive,
Map<String,Object> arguments)
|
void |
sendExchangeDeclare(org.apache.qpid.framing.AMQShortString name,
org.apache.qpid.framing.AMQShortString type,
AMQProtocolHandler protocolHandler,
boolean nowait)
|
void |
sendQueueBind(org.apache.qpid.framing.AMQShortString queueName,
org.apache.qpid.framing.AMQShortString routingKey,
org.apache.qpid.framing.FieldTable arguments,
org.apache.qpid.framing.AMQShortString exchangeName,
AMQDestination dest,
boolean nowait)
|
void |
sendQueueDeclare(AMQDestination amqd,
AMQProtocolHandler protocolHandler,
boolean nowait)
|
void |
sendQueueDelete(org.apache.qpid.framing.AMQShortString queueName)
|
void |
sendRecover()
|
void |
sendRollback()
|
void |
sendSuspendChannel(boolean suspend)
|
void |
setPrefetchLimits(int messagePrefetch,
long sizePrefetch)
|
void |
sync()
|
protected boolean |
tagLE(long tag1,
long tag2)
|
protected boolean |
updateRollbackMark(long currentMark,
long deliveryTag)
|
Methods inherited from class org.apache.qpid.client.AMQSession |
acknowledge, addBindingKey, addDeliveredMessage, addUnacknowledgedMessage, bindQueue, bindQueue, checkFlowControl, checkNotClosed, checkTransacted, checkValidTopic, checkValidTopic, close, close, closed, commit, confirmConsumerCancelled, createBrowser, createBrowser, createBrowserConsumer, createBytesMessage, createConsumer, createConsumer, createConsumer, createConsumer, createConsumer, createConsumer, createConsumer, createConsumerImpl, createDurableSubscriber, createDurableSubscriber, createExclusiveConsumer, createExclusiveConsumer, createMapMessage, createMessage, createObjectMessage, createObjectMessage, createProducer, createProducer, createProducer, createProducer, createPublisher, createQueue, createQueue, createQueue, createQueueReceiver, createQueueReceiver, createReceiver, createReceiver, createSender, createStreamMessage, createSubscriber, createSubscriber, createTemporaryQueue, createTemporaryTopic, createTextMessage, createTextMessage, createTopic, declareAndBind, declareExchange, declareQueue, declareQueue, deleteQueue, deregisterConsumer, deregisterProducer, dispatch, failoverPrep, getAcknowledgeMode, getAMQConnection, getChannelId, getDefaultPrefetch, getDefaultPrefetchHigh, getDefaultPrefetchLow, getDefaultQueueExchangeName, getDefaultTopicExchangeName, getFailoverMutex, getMessageDeliveryLock, getMessageListener, getMethodRegistry, getProtocolHandler, getProtocolMajorVersion, getProtocolMinorVersion, getQueueDepth, getTemporaryQueueExchangeName, getTemporaryTopicExchangeName, getTicket, getTransacted, hasConsumer, hasFailedOver, hasMessageListeners, isClosed, isClosing, isDirty, isInRecovery, isQueueBound, isStarted, isStrictAMQP, isSuspended, markClean, markClosed, markDirty, prefetch, recover, rejectMessage, rejectMessage, resubscribe, rollback, run, setFlowControl, setHasMessageListeners, setInRecovery, setMessageListener, setTicket, start, startDispatcherIfNecessary, startDispatcherIfNecessary, stop, suspendChannel, syncDispatchQueue, unsubscribe |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AMQSession_0_8
AMQSession_0_8(AMQConnection con,
int channelId,
boolean transacted,
int acknowledgeMode,
MessageFactoryRegistry messageFactoryRegistry,
int defaultPrefetchHighMark,
int defaultPrefetchLowMark)
- Creates a new session on a connection.
- Parameters:
con
- The connection on which to create the session.channelId
- The unique identifier for the session.transacted
- Indicates whether or not the session is transactional.acknowledgeMode
- The acknoledgement mode for the session.messageFactoryRegistry
- The message factory factory for the session.defaultPrefetchHighMark
- The maximum number of messages to prefetched before suspending the session.defaultPrefetchLowMark
- The number of prefetched messages at which to resume the session.
AMQSession_0_8
AMQSession_0_8(AMQConnection con,
int channelId,
boolean transacted,
int acknowledgeMode,
int defaultPrefetchHigh,
int defaultPrefetchLow)
- Creates a new session on a connection with the default message factory factory.
- Parameters:
con
- The connection on which to create the session.channelId
- The unique identifier for the session.transacted
- Indicates whether or not the session is transactional.acknowledgeMode
- The acknoledgement mode for the session.defaultPrefetchHigh
- The maximum number of messages to prefetched before suspending the session.defaultPrefetchLow
- The number of prefetched messages at which to resume the session.
acknowledgeMessage
public void acknowledgeMessage(long deliveryTag,
boolean multiple)
- Description copied from class:
AMQSession
- Acknowledge one or many messages.
- Specified by:
acknowledgeMessage
in class AMQSession<BasicMessageConsumer_0_8,BasicMessageProducer_0_8>
- Parameters:
deliveryTag
- The tag of the last message to be acknowledged.multiple
- true to acknowledge all messages up to and including the one specified by the
delivery tag, false to just acknowledge that message.
sendQueueBind
public void sendQueueBind(org.apache.qpid.framing.AMQShortString queueName,
org.apache.qpid.framing.AMQShortString routingKey,
org.apache.qpid.framing.FieldTable arguments,
org.apache.qpid.framing.AMQShortString exchangeName,
AMQDestination dest,
boolean nowait)
throws org.apache.qpid.AMQException,
FailoverException
- Specified by:
sendQueueBind
in class AMQSession<BasicMessageConsumer_0_8,BasicMessageProducer_0_8>
- Throws:
org.apache.qpid.AMQException
FailoverException
sendClose
public void sendClose(long timeout)
throws org.apache.qpid.AMQException,
FailoverException
- Specified by:
sendClose
in class AMQSession<BasicMessageConsumer_0_8,BasicMessageProducer_0_8>
- Throws:
org.apache.qpid.AMQException
FailoverException
sendCommit
public void sendCommit()
throws org.apache.qpid.AMQException,
FailoverException
- Specified by:
sendCommit
in class AMQSession<BasicMessageConsumer_0_8,BasicMessageProducer_0_8>
- Throws:
org.apache.qpid.AMQException
FailoverException
sendCreateQueue
public void sendCreateQueue(org.apache.qpid.framing.AMQShortString name,
boolean autoDelete,
boolean durable,
boolean exclusive,
Map<String,Object> arguments)
throws org.apache.qpid.AMQException,
FailoverException
- Specified by:
sendCreateQueue
in class AMQSession<BasicMessageConsumer_0_8,BasicMessageProducer_0_8>
- Throws:
org.apache.qpid.AMQException
FailoverException
sendRecover
public void sendRecover()
throws org.apache.qpid.AMQException,
FailoverException
- Specified by:
sendRecover
in class AMQSession<BasicMessageConsumer_0_8,BasicMessageProducer_0_8>
- Throws:
org.apache.qpid.AMQException
FailoverException
releaseForRollback
public void releaseForRollback()
- Specified by:
releaseForRollback
in class AMQSession<BasicMessageConsumer_0_8,BasicMessageProducer_0_8>
rejectMessage
public void rejectMessage(long deliveryTag,
boolean requeue)
- Specified by:
rejectMessage
in class AMQSession<BasicMessageConsumer_0_8,BasicMessageProducer_0_8>
isQueueBound
public boolean isQueueBound(AMQDestination destination)
throws JMSException
- Specified by:
isQueueBound
in class AMQSession<BasicMessageConsumer_0_8,BasicMessageProducer_0_8>
- Throws:
JMSException
isQueueBound
public boolean isQueueBound(org.apache.qpid.framing.AMQShortString exchangeName,
org.apache.qpid.framing.AMQShortString queueName,
org.apache.qpid.framing.AMQShortString routingKey)
throws JMSException
- Description copied from class:
AMQSession
- Tests whether or not the specified queue is bound to the specified exchange under a particular routing key.
Note that this operation automatically retries in the event of fail-over.
- Specified by:
isQueueBound
in class AMQSession<BasicMessageConsumer_0_8,BasicMessageProducer_0_8>
- Parameters:
exchangeName
- The exchange name to test for binding against.queueName
- The queue name to check if bound.routingKey
- The routing key to check if the queue is bound under.
- Returns:
- true if the queue is bound to the exchange and routing key, false if not.
- Throws:
JMSException
- If the query fails for any reason.
sendConsume
public void sendConsume(BasicMessageConsumer_0_8 consumer,
org.apache.qpid.framing.AMQShortString queueName,
AMQProtocolHandler protocolHandler,
boolean nowait,
String messageSelector,
int tag)
throws org.apache.qpid.AMQException,
FailoverException
- Specified by:
sendConsume
in class AMQSession<BasicMessageConsumer_0_8,BasicMessageProducer_0_8>
- Throws:
org.apache.qpid.AMQException
FailoverException
sendExchangeDeclare
public void sendExchangeDeclare(org.apache.qpid.framing.AMQShortString name,
org.apache.qpid.framing.AMQShortString type,
AMQProtocolHandler protocolHandler,
boolean nowait)
throws org.apache.qpid.AMQException,
FailoverException
- Specified by:
sendExchangeDeclare
in class AMQSession<BasicMessageConsumer_0_8,BasicMessageProducer_0_8>
- Throws:
org.apache.qpid.AMQException
FailoverException
sendQueueDeclare
public void sendQueueDeclare(AMQDestination amqd,
AMQProtocolHandler protocolHandler,
boolean nowait)
throws org.apache.qpid.AMQException,
FailoverException
- Specified by:
sendQueueDeclare
in class AMQSession<BasicMessageConsumer_0_8,BasicMessageProducer_0_8>
- Throws:
org.apache.qpid.AMQException
FailoverException
sendQueueDelete
public void sendQueueDelete(org.apache.qpid.framing.AMQShortString queueName)
throws org.apache.qpid.AMQException,
FailoverException
- Specified by:
sendQueueDelete
in class AMQSession<BasicMessageConsumer_0_8,BasicMessageProducer_0_8>
- Throws:
org.apache.qpid.AMQException
FailoverException
sendSuspendChannel
public void sendSuspendChannel(boolean suspend)
throws org.apache.qpid.AMQException,
FailoverException
- Specified by:
sendSuspendChannel
in class AMQSession<BasicMessageConsumer_0_8,BasicMessageProducer_0_8>
- Throws:
org.apache.qpid.AMQException
FailoverException
createMessageConsumer
public BasicMessageConsumer_0_8 createMessageConsumer(AMQDestination destination,
int prefetchHigh,
int prefetchLow,
boolean noLocal,
boolean exclusive,
String messageSelector,
org.apache.qpid.framing.FieldTable arguments,
boolean noConsume,
boolean autoClose)
throws JMSException
- Specified by:
createMessageConsumer
in class AMQSession<BasicMessageConsumer_0_8,BasicMessageProducer_0_8>
- Throws:
JMSException
createMessageProducer
public BasicMessageProducer_0_8 createMessageProducer(Destination destination,
boolean mandatory,
boolean immediate,
boolean waitUntilSent,
long producerId)
- Specified by:
createMessageProducer
in class AMQSession<BasicMessageConsumer_0_8,BasicMessageProducer_0_8>
messageReceived
public void messageReceived(UnprocessedMessage message)
- Description copied from class:
AMQSession
- Invoked by the MINA IO thread (indirectly) when a message is received from the transport. Puts the message onto
the queue read by the dispatcher.
- Overrides:
messageReceived
in class AMQSession<BasicMessageConsumer_0_8,BasicMessageProducer_0_8>
- Parameters:
message
- the message that has been received
sendRollback
public void sendRollback()
throws org.apache.qpid.AMQException,
FailoverException
- Specified by:
sendRollback
in class AMQSession<BasicMessageConsumer_0_8,BasicMessageProducer_0_8>
- Throws:
org.apache.qpid.AMQException
FailoverException
setPrefetchLimits
public void setPrefetchLimits(int messagePrefetch,
long sizePrefetch)
throws org.apache.qpid.AMQException
- Throws:
org.apache.qpid.AMQException
requestQueueDepth
protected Long requestQueueDepth(AMQDestination amqd)
throws org.apache.qpid.AMQException,
FailoverException
- Specified by:
requestQueueDepth
in class AMQSession<BasicMessageConsumer_0_8,BasicMessageProducer_0_8>
- Throws:
org.apache.qpid.AMQException
FailoverException
tagLE
protected final boolean tagLE(long tag1,
long tag2)
- Specified by:
tagLE
in class AMQSession<BasicMessageConsumer_0_8,BasicMessageProducer_0_8>
updateRollbackMark
protected final boolean updateRollbackMark(long currentMark,
long deliveryTag)
- Specified by:
updateRollbackMark
in class AMQSession<BasicMessageConsumer_0_8,BasicMessageProducer_0_8>
getMessageDelegateFactory
public AMQMessageDelegateFactory getMessageDelegateFactory()
- Specified by:
getMessageDelegateFactory
in class AMQSession<BasicMessageConsumer_0_8,BasicMessageProducer_0_8>
sync
public void sync()
throws org.apache.qpid.AMQException
- Specified by:
sync
in class AMQSession<BasicMessageConsumer_0_8,BasicMessageProducer_0_8>
- Throws:
org.apache.qpid.AMQException
handleAddressBasedDestination
public void handleAddressBasedDestination(AMQDestination dest,
boolean isConsumer,
boolean noWait)
throws org.apache.qpid.AMQException
- Specified by:
handleAddressBasedDestination
in class AMQSession<BasicMessageConsumer_0_8,BasicMessageProducer_0_8>
- Throws:
org.apache.qpid.AMQException
flushAcknowledgments
protected void flushAcknowledgments()
- Specified by:
flushAcknowledgments
in class AMQSession<BasicMessageConsumer_0_8,BasicMessageProducer_0_8>
isQueueBound
public boolean isQueueBound(String exchangeName,
String queueName,
String bindingKey,
Map<String,Object> args)
throws JMSException
- Specified by:
isQueueBound
in class AMQSession<BasicMessageConsumer_0_8,BasicMessageProducer_0_8>
- Throws:
JMSException
Licensed to the Apache Software Foundation