|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.qpid.client.Closeable
org.apache.qpid.client.AMQSession<C,P>
public abstract class AMQSession<C extends BasicMessageConsumer,P extends BasicMessageProducer>
Responsibilities | Collaborations |
---|---|
Nested Class Summary | |
---|---|
static interface |
AMQSession.Dispatchable
|
(package private) class |
AMQSession.Dispatcher
Responsible for decoding a message fragment and passing it to the appropriate message consumer. |
static class |
AMQSession.IdToConsumerMap<C extends BasicMessageConsumer>
|
Field Summary | |
---|---|
protected int |
_acknowledgeMode
Holds the sessions acknowledgement mode. |
protected int |
_channelId
Holds this session unique identifier, used to distinguish it from other sessions. |
protected AMQConnection |
_connection
The connection to which this session belongs. |
protected AMQSession.IdToConsumerMap<C> |
_consumers
Maps from identifying tags to message consumers, in order to pass dispatch incoming messages to the right consumer. |
protected ConcurrentLinkedQueue<Long> |
_deliveredMessageTags
All the delivered message tags |
protected AMQSession.Dispatcher |
_dispatcher
Holds the dispatcher thread for this session. |
protected Thread |
_dispatcherThread
|
protected AtomicBoolean |
_firstDispatcher
Used to ensure that onlt the first call to start the dispatcher can unsuspend the channel. |
protected boolean |
_immediatePrefetch
Used to indicate that the session should start pre-fetching messages as soon as it is started. |
protected MessageFactoryRegistry |
_messageFactoryRegistry
Holds the message factory factory for this session. |
protected FlowControllingBlockingQueue |
_queue
Used to hold incoming messages. |
protected ConcurrentHashMap<C,String> |
_reverseSubscriptionMap
Holds a mapping from message consumers to their identifying names, so that their subscriptions may be looked up in the _subscriptions map. |
protected boolean |
_strictAMQP
Indicates that warnings should be generated on violations of the strict AMQP. |
protected boolean |
_strictAMQPFATAL
Indicates that runtime exceptions should be generated on vilations of the strict AMQP. |
protected Lock |
_subscriberAccess
|
protected Lock |
_subscriberDetails
Locks to keep access to subscriber details atomic. |
protected ConcurrentHashMap<String,TopicSubscriberAdaptor<C>> |
_subscriptions
Used to reference durable subscribers so that requests for unsubscribe can be handled correctly. |
(package private) AMQSession<C,P> |
_thisSession
|
protected boolean |
_transacted
Used to indicate whether or not this is a transactional session. |
protected ConcurrentLinkedQueue<Long> |
_unacknowledgedMessageTags
All the not yet acknowledged message tags |
protected boolean |
DECLARE_EXCHANGES
|
protected boolean |
DECLARE_QUEUES
|
static long |
DEFAULT_FLOW_CONTROL_WAIT_FAILURE
The period to wait while flow controlled before declaring a failure |
protected boolean |
DEFAULT_IMMEDIATE
The default value for immediate flag used by producers created by this session is false. |
protected boolean |
DEFAULT_MANDATORY
The default value for mandatory flag used by producers created by this session is true. |
protected boolean |
DEFAULT_WAIT_ON_SEND
|
protected long |
FLOW_CONTROL_WAIT_FAILURE
|
protected long |
FLOW_CONTROL_WAIT_PERIOD
The period to wait while flow controlled before sending a log message confirming that the session is still waiting on flow control being revoked |
static String |
IMMEDIATE_PREFETCH
System property to enable immediate message prefetching. |
static String |
IMMEDIATE_PREFETCH_DEFAULT
Immediate message prefetch default. |
static String |
STRICT_AMQP
System property to enable strict AMQP compliance. |
static String |
STRICT_AMQP_DEFAULT
Strict AMQP default setting. |
static String |
STRICT_AMQP_FATAL
System property to enable failure if strict AMQP compliance is violated. |
static String |
STRICT_AMQP_FATAL_DEFAULT
Strickt AMQP failure default. |
protected boolean |
USE_AMQP_ENCODED_MAP_MESSAGE
|
Fields inherited from class org.apache.qpid.client.Closeable |
---|
_closed, _closing |
Fields inherited from interface org.apache.qpid.jms.Session |
---|
NO_ACKNOWLEDGE, PRE_ACKNOWLEDGE |
Fields inherited from interface javax.jms.Session |
---|
AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, SESSION_TRANSACTED |
Constructor Summary | |
---|---|
(package private) |
AMQSession(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. |
protected |
AMQSession(AMQConnection con,
int channelId,
boolean transacted,
int acknowledgeMode,
MessageFactoryRegistry messageFactoryRegistry,
int defaultPrefetchHighMark,
int defaultPrefetchLowMark)
Creates a new session on a connection. |
Method Summary | |
---|---|
void |
acknowledge()
Acknowledges all unacknowledged messages on the session, for all message consumers on the session. |
abstract void |
acknowledgeMessage(long deliveryTag,
boolean multiple)
Acknowledge one or many messages. |
void |
addBindingKey(C consumer,
AMQDestination amqd,
String routingKey)
|
protected void |
addDeliveredMessage(long id)
|
protected void |
addUnacknowledgedMessage(long id)
|
void |
bindQueue(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 destination)
Binds the named queue, with the specified routing key, to the named exchange. |
void |
bindQueue(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 destination,
boolean nowait)
|
void |
checkFlowControl()
|
void |
checkNotClosed()
Checks if this is closed, and raises a JMSException if it is. |
protected void |
checkTransacted()
|
protected AMQTopic |
checkValidTopic(Topic topic)
|
protected AMQTopic |
checkValidTopic(Topic topic,
boolean durable)
|
void |
close()
Closes the session with no timeout. |
void |
close(long timeout)
Closes the session. |
void |
closed(Throwable e)
Called when the server initiates the closure of the session unilaterally. |
void |
commit()
Commits all messages done in this transaction and releases any locks currently held. |
void |
confirmConsumerCancelled(int consumerTag)
|
QueueBrowser |
createBrowser(Queue queue)
|
QueueBrowser |
createBrowser(Queue queue,
String messageSelector)
|
MessageConsumer |
createBrowserConsumer(Destination destination,
String messageSelector,
boolean noLocal)
|
BytesMessage |
createBytesMessage()
|
MessageConsumer |
createConsumer(Destination destination)
|
MessageConsumer |
createConsumer(Destination destination,
int prefetch,
boolean noLocal,
boolean exclusive,
String selector)
|
MessageConsumer |
createConsumer(Destination destination,
int prefetch,
boolean noLocal,
boolean exclusive,
String selector,
org.apache.qpid.framing.FieldTable rawSelector)
|
MessageConsumer |
createConsumer(Destination destination,
int prefetchHigh,
int prefetchLow,
boolean noLocal,
boolean exclusive,
String selector)
|
MessageConsumer |
createConsumer(Destination destination,
int prefetchHigh,
int prefetchLow,
boolean noLocal,
boolean exclusive,
String selector,
org.apache.qpid.framing.FieldTable rawSelector)
|
MessageConsumer |
createConsumer(Destination destination,
String messageSelector)
|
MessageConsumer |
createConsumer(Destination destination,
String messageSelector,
boolean noLocal)
|
protected C |
createConsumerImpl(Destination destination,
int prefetchHigh,
int prefetchLow,
boolean noLocal,
boolean exclusive,
String selector,
org.apache.qpid.framing.FieldTable rawSelector,
boolean noConsume,
boolean autoClose)
|
TopicSubscriber |
createDurableSubscriber(Topic topic,
String name)
|
TopicSubscriber |
createDurableSubscriber(Topic topic,
String name,
String selector,
boolean noLocal)
|
C |
createExclusiveConsumer(Destination destination)
|
MessageConsumer |
createExclusiveConsumer(Destination destination,
String messageSelector,
boolean noLocal)
|
MapMessage |
createMapMessage()
|
Message |
createMessage()
|
abstract C |
createMessageConsumer(AMQDestination destination,
int prefetchHigh,
int prefetchLow,
boolean noLocal,
boolean exclusive,
String selector,
org.apache.qpid.framing.FieldTable arguments,
boolean noConsume,
boolean autoClose)
|
abstract P |
createMessageProducer(Destination destination,
boolean mandatory,
boolean immediate,
boolean waitUntilSent,
long producerId)
|
ObjectMessage |
createObjectMessage()
|
ObjectMessage |
createObjectMessage(Serializable object)
|
P |
createProducer(Destination destination)
|
P |
createProducer(Destination destination,
boolean immediate)
Create a producer |
P |
createProducer(Destination destination,
boolean mandatory,
boolean immediate)
Create a producer |
P |
createProducer(Destination destination,
boolean mandatory,
boolean immediate,
boolean waitUntilSent)
|
TopicPublisher |
createPublisher(Topic topic)
|
void |
createQueue(org.apache.qpid.framing.AMQShortString name,
boolean autoDelete,
boolean durable,
boolean exclusive)
Declares the named queue. |
void |
createQueue(org.apache.qpid.framing.AMQShortString name,
boolean autoDelete,
boolean durable,
boolean exclusive,
Map<String,Object> arguments)
Declares the named queue. |
Queue |
createQueue(String queueName)
|
QueueReceiver |
createQueueReceiver(Destination destination)
Creates a QueueReceiver |
QueueReceiver |
createQueueReceiver(Destination destination,
String messageSelector)
Creates a QueueReceiver using a message selector |
QueueReceiver |
createReceiver(Queue queue)
Creates a QueueReceiver wrapping a MessageConsumer |
QueueReceiver |
createReceiver(Queue queue,
String messageSelector)
Creates a QueueReceiver wrapping a MessageConsumer using a message selector |
QueueSender |
createSender(Queue queue)
|
StreamMessage |
createStreamMessage()
|
TopicSubscriber |
createSubscriber(Topic topic)
Creates a non-durable subscriber |
TopicSubscriber |
createSubscriber(Topic topic,
String messageSelector,
boolean noLocal)
Creates a non-durable subscriber with a message selector |
TemporaryQueue |
createTemporaryQueue()
|
TemporaryTopic |
createTemporaryTopic()
|
TextMessage |
createTextMessage()
|
TextMessage |
createTextMessage(String text)
|
Topic |
createTopic(String topicName)
|
void |
declareAndBind(AMQDestination amqd)
|
void |
declareExchange(org.apache.qpid.framing.AMQShortString name,
org.apache.qpid.framing.AMQShortString type,
boolean nowait)
|
protected org.apache.qpid.framing.AMQShortString |
declareQueue(AMQDestination amqd,
AMQProtocolHandler protocolHandler,
boolean noLocal)
Declares a queue for a JMS destination. |
protected org.apache.qpid.framing.AMQShortString |
declareQueue(AMQDestination amqd,
AMQProtocolHandler protocolHandler,
boolean noLocal,
boolean nowait)
|
protected void |
deleteQueue(org.apache.qpid.framing.AMQShortString queueName)
Undeclares the specified queue. |
(package private) void |
deregisterConsumer(C consumer)
Called by the MessageConsumer when closing, to deregister the consumer from the map from consumerTag to consumer instance. |
(package private) void |
deregisterProducer(long producerId)
|
void |
dispatch(UnprocessedMessage message)
|
(package private) void |
failoverPrep()
|
protected abstract void |
flushAcknowledgments()
|
int |
getAcknowledgeMode()
|
AMQConnection |
getAMQConnection()
|
int |
getChannelId()
|
int |
getDefaultPrefetch()
|
int |
getDefaultPrefetchHigh()
|
int |
getDefaultPrefetchLow()
|
org.apache.qpid.framing.AMQShortString |
getDefaultQueueExchangeName()
|
org.apache.qpid.framing.AMQShortString |
getDefaultTopicExchangeName()
|
protected Object |
getFailoverMutex()
|
abstract AMQMessageDelegateFactory |
getMessageDelegateFactory()
|
(package private) Object |
getMessageDeliveryLock()
|
MessageListener |
getMessageListener()
|
org.apache.qpid.framing.MethodRegistry |
getMethodRegistry()
|
protected AMQProtocolHandler |
getProtocolHandler()
|
byte |
getProtocolMajorVersion()
|
byte |
getProtocolMinorVersion()
|
long |
getQueueDepth(AMQDestination amqd)
Returns the number of messages currently queued for the given destination. |
org.apache.qpid.framing.AMQShortString |
getTemporaryQueueExchangeName()
|
org.apache.qpid.framing.AMQShortString |
getTemporaryTopicExchangeName()
|
int |
getTicket()
|
boolean |
getTransacted()
|
abstract void |
handleAddressBasedDestination(AMQDestination dest,
boolean isConsumer,
boolean noWait)
|
boolean |
hasConsumer(Destination destination)
|
boolean |
hasFailedOver()
Check to see if failover has occured since the last call to markClean(commit or rollback). |
protected boolean |
hasMessageListeners()
|
boolean |
isClosed()
Checks if the Session and its parent connection are closed |
boolean |
isClosing()
Checks if the Session and its parent connection are capable of performing closing operations |
boolean |
isDirty()
Check to see if any message have been sent in this transaction and have not been commited. |
(package private) boolean |
isInRecovery()
|
abstract boolean |
isQueueBound(AMQDestination destination)
|
(package private) boolean |
isQueueBound(org.apache.qpid.framing.AMQShortString exchangeName,
org.apache.qpid.framing.AMQShortString queueName)
|
abstract 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. |
abstract boolean |
isQueueBound(String exchangeName,
String queueName,
String bindingKey,
Map<String,Object> args)
|
(package private) boolean |
isStarted()
|
boolean |
isStrictAMQP()
|
boolean |
isSuspended()
|
void |
markClean()
Signifies that the session has no pending sends to commit. |
(package private) void |
markClosed()
Called to mark the session as being closed. |
void |
markDirty()
Signifies that the session has pending sends to commit. |
void |
messageReceived(UnprocessedMessage message)
Invoked by the MINA IO thread (indirectly) when a message is received from the transport. |
boolean |
prefetch()
Indicates whether this session consumers pre-fetche messages |
void |
recover()
Stops message delivery in this session, and restarts message delivery with the oldest unacknowledged message. |
void |
rejectMessage(AbstractJMSMessage message,
boolean requeue)
|
abstract void |
rejectMessage(long deliveryTag,
boolean requeue)
|
void |
rejectMessage(UnprocessedMessage message,
boolean requeue)
|
abstract void |
releaseForRollback()
|
protected abstract Long |
requestQueueDepth(AMQDestination amqd)
|
(package private) void |
resubscribe()
Resubscribes all producers and consumers. |
void |
rollback()
Commits all messages done in this transaction and releases any locks currently held. |
void |
run()
|
abstract void |
sendClose(long timeout)
|
abstract void |
sendCommit()
|
abstract void |
sendConsume(C consumer,
org.apache.qpid.framing.AMQShortString queueName,
AMQProtocolHandler protocolHandler,
boolean nowait,
String messageSelector,
int tag)
|
abstract void |
sendCreateQueue(org.apache.qpid.framing.AMQShortString name,
boolean autoDelete,
boolean durable,
boolean exclusive,
Map<String,Object> arguments)
|
abstract void |
sendExchangeDeclare(org.apache.qpid.framing.AMQShortString name,
org.apache.qpid.framing.AMQShortString type,
AMQProtocolHandler protocolHandler,
boolean nowait)
|
abstract 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 destination,
boolean nowait)
|
abstract void |
sendQueueDeclare(AMQDestination amqd,
AMQProtocolHandler protocolHandler,
boolean nowait)
|
abstract void |
sendQueueDelete(org.apache.qpid.framing.AMQShortString queueName)
|
protected abstract void |
sendRecover()
|
abstract void |
sendRollback()
|
abstract void |
sendSuspendChannel(boolean suspend)
|
void |
setFlowControl(boolean active)
|
(package private) void |
setHasMessageListeners()
|
(package private) void |
setInRecovery(boolean inRecovery)
|
void |
setMessageListener(MessageListener listener)
|
void |
setTicket(int ticket)
|
(package private) void |
start()
Starts the session, which ensures that it is not suspended and that its event dispatcher is running. |
(package private) void |
startDispatcherIfNecessary()
|
(package private) void |
startDispatcherIfNecessary(boolean initiallyStopped)
|
(package private) void |
stop()
|
protected void |
suspendChannel(boolean suspend)
Suspends or unsuspends this session. |
abstract void |
sync()
|
(package private) void |
syncDispatchQueue()
|
protected abstract boolean |
tagLE(long tag1,
long tag2)
|
void |
unsubscribe(String name)
|
protected abstract boolean |
updateRollbackMark(long current,
long deliveryTag)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
final AMQSession<C extends BasicMessageConsumer,P extends BasicMessageProducer> _thisSession
protected final boolean DEFAULT_IMMEDIATE
protected final boolean DEFAULT_MANDATORY
protected final boolean DEFAULT_WAIT_ON_SEND
protected final long FLOW_CONTROL_WAIT_PERIOD
public static final long DEFAULT_FLOW_CONTROL_WAIT_FAILURE
protected final long FLOW_CONTROL_WAIT_FAILURE
protected final boolean DECLARE_QUEUES
protected final boolean DECLARE_EXCHANGES
protected final boolean USE_AMQP_ENCODED_MAP_MESSAGE
public static final String STRICT_AMQP
public static final String STRICT_AMQP_DEFAULT
public static final String STRICT_AMQP_FATAL
public static final String STRICT_AMQP_FATAL_DEFAULT
public static final String IMMEDIATE_PREFETCH
public static final String IMMEDIATE_PREFETCH_DEFAULT
protected AMQConnection _connection
protected boolean _transacted
protected final int _acknowledgeMode
protected int _channelId
protected final ConcurrentHashMap<String,TopicSubscriberAdaptor<C extends BasicMessageConsumer>> _subscriptions
protected final ConcurrentHashMap<C extends BasicMessageConsumer,String> _reverseSubscriptionMap
_subscriptions
map.
protected final Lock _subscriberDetails
Added for QPID2418
protected final Lock _subscriberAccess
protected final FlowControllingBlockingQueue _queue
FlowControllingBlockingQueue
implements Queue.protected ConcurrentLinkedQueue<Long> _unacknowledgedMessageTags
protected ConcurrentLinkedQueue<Long> _deliveredMessageTags
protected AMQSession.Dispatcher _dispatcher
protected Thread _dispatcherThread
protected MessageFactoryRegistry _messageFactoryRegistry
protected final AMQSession.IdToConsumerMap<C extends BasicMessageConsumer> _consumers
protected final AtomicBoolean _firstDispatcher
protected final boolean _immediatePrefetch
protected final boolean _strictAMQP
protected final boolean _strictAMQPFATAL
Constructor Detail |
---|
protected AMQSession(AMQConnection con, int channelId, boolean transacted, int acknowledgeMode, MessageFactoryRegistry messageFactoryRegistry, int defaultPrefetchHighMark, int defaultPrefetchLowMark)
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(AMQConnection con, int channelId, boolean transacted, int acknowledgeMode, int defaultPrefetchHigh, int defaultPrefetchLow)
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.Method Detail |
---|
public void close() throws JMSException
close
in interface Session
close
in class Closeable
JMSException
- If the JMS provider fails to close the session due to some internal error.public void checkNotClosed() throws JMSException
Closeable
checkNotClosed
in class Closeable
JMSException
- If this is closed.public BytesMessage createBytesMessage() throws JMSException
createBytesMessage
in interface Session
JMSException
public void acknowledge() throws IllegalStateException
IllegalStateException
- If the session is closed.public abstract void acknowledgeMessage(long deliveryTag, boolean multiple)
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.public org.apache.qpid.framing.MethodRegistry getMethodRegistry()
public void bindQueue(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 destination) throws org.apache.qpid.AMQException
queueName
- The name of the queue to bind.routingKey
- The routing key to bind the queue with.arguments
- Additional arguments.exchangeName
- The exchange to bind the queue on.
org.apache.qpid.AMQException
- If the queue cannot be bound for any reason.public void bindQueue(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 destination, boolean nowait) throws org.apache.qpid.AMQException
org.apache.qpid.AMQException
public void addBindingKey(C consumer, AMQDestination amqd, String routingKey) throws org.apache.qpid.AMQException
org.apache.qpid.AMQException
public abstract 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 destination, boolean nowait) throws org.apache.qpid.AMQException, FailoverException
org.apache.qpid.AMQException
FailoverException
public void close(long timeout) throws JMSException
timeout
- The timeout in milliseconds to wait for the session close acknoledgement from the broker.
JMSException
- If the JMS provider fails to close the session due to some internal error.public abstract void sendClose(long timeout) throws org.apache.qpid.AMQException, FailoverException
org.apache.qpid.AMQException
FailoverException
public void closed(Throwable e) throws JMSException
e
- the exception that caused this session to be closed. Null causes the
JMSException
public void commit() throws JMSException
commit
in interface Session
JMSException
- If the JMS provider fails to commit the transaction due to some internal error. This does
not mean that the commit is known to have failed, merely that it is not known whether it
failed or not.public abstract void sendCommit() throws org.apache.qpid.AMQException, FailoverException
org.apache.qpid.AMQException
FailoverException
public void confirmConsumerCancelled(int consumerTag)
public QueueBrowser createBrowser(Queue queue) throws JMSException
createBrowser
in interface QueueSession
createBrowser
in interface Session
JMSException
public QueueBrowser createBrowser(Queue queue, String messageSelector) throws JMSException
createBrowser
in interface QueueSession
createBrowser
in interface Session
JMSException
public MessageConsumer createBrowserConsumer(Destination destination, String messageSelector, boolean noLocal) throws JMSException
JMSException
public MessageConsumer createConsumer(Destination destination) throws JMSException
createConsumer
in interface Session
JMSException
public C createExclusiveConsumer(Destination destination) throws JMSException
JMSException
public MessageConsumer createConsumer(Destination destination, String messageSelector) throws JMSException
createConsumer
in interface Session
JMSException
public MessageConsumer createConsumer(Destination destination, String messageSelector, boolean noLocal) throws JMSException
createConsumer
in interface Session
JMSException
public MessageConsumer createExclusiveConsumer(Destination destination, String messageSelector, boolean noLocal) throws JMSException
JMSException
public MessageConsumer createConsumer(Destination destination, int prefetch, boolean noLocal, boolean exclusive, String selector) throws JMSException
JMSException
public MessageConsumer createConsumer(Destination destination, int prefetchHigh, int prefetchLow, boolean noLocal, boolean exclusive, String selector) throws JMSException
JMSException
public MessageConsumer createConsumer(Destination destination, int prefetch, boolean noLocal, boolean exclusive, String selector, org.apache.qpid.framing.FieldTable rawSelector) throws JMSException
JMSException
public MessageConsumer createConsumer(Destination destination, int prefetchHigh, int prefetchLow, boolean noLocal, boolean exclusive, String selector, org.apache.qpid.framing.FieldTable rawSelector) throws JMSException
JMSException
public TopicSubscriber createDurableSubscriber(Topic topic, String name) throws JMSException
createDurableSubscriber
in interface Session
createDurableSubscriber
in interface TopicSession
JMSException
public TopicSubscriber createDurableSubscriber(Topic topic, String name, String selector, boolean noLocal) throws JMSException
createDurableSubscriber
in interface Session
createDurableSubscriber
in interface TopicSession
JMSException
public MapMessage createMapMessage() throws JMSException
createMapMessage
in interface Session
JMSException
public Message createMessage() throws JMSException
createMessage
in interface Session
JMSException
public ObjectMessage createObjectMessage() throws JMSException
createObjectMessage
in interface Session
JMSException
public ObjectMessage createObjectMessage(Serializable object) throws JMSException
createObjectMessage
in interface Session
JMSException
public P createProducer(Destination destination) throws JMSException
createProducer
in interface Session
JMSException
public P createProducer(Destination destination, boolean immediate) throws JMSException
Session
immediate
- the value of the immediate flag used by default on the producer
JMSException
public P createProducer(Destination destination, boolean mandatory, boolean immediate) throws JMSException
Session
mandatory
- the value of the mandatory flag used by default on the producerimmediate
- the value of the immediate flag used by default on the producer
JMSException
public P createProducer(Destination destination, boolean mandatory, boolean immediate, boolean waitUntilSent) throws JMSException
JMSException
public TopicPublisher createPublisher(Topic topic) throws JMSException
createPublisher
in interface TopicSession
JMSException
public Queue createQueue(String queueName) throws JMSException
createQueue
in interface QueueSession
createQueue
in interface Session
JMSException
public void createQueue(org.apache.qpid.framing.AMQShortString name, boolean autoDelete, boolean durable, boolean exclusive) throws org.apache.qpid.AMQException
name
- The name of the queue to declare.autoDelete
- durable
- Flag to indicate that the queue is durable.exclusive
- Flag to indicate that the queue is exclusive to this client.
org.apache.qpid.AMQException
- If the queue cannot be declared for any reason.public void createQueue(org.apache.qpid.framing.AMQShortString name, boolean autoDelete, boolean durable, boolean exclusive, Map<String,Object> arguments) throws org.apache.qpid.AMQException
name
- The name of the queue to declare.autoDelete
- durable
- Flag to indicate that the queue is durable.exclusive
- Flag to indicate that the queue is exclusive to this client.arguments
- Arguments used to set special properties of the queue
org.apache.qpid.AMQException
- If the queue cannot be declared for any reason.public abstract void sendCreateQueue(org.apache.qpid.framing.AMQShortString name, boolean autoDelete, boolean durable, boolean exclusive, Map<String,Object> arguments) throws org.apache.qpid.AMQException, FailoverException
org.apache.qpid.AMQException
FailoverException
public QueueReceiver createQueueReceiver(Destination destination) throws JMSException
destination
-
JMSException
public QueueReceiver createQueueReceiver(Destination destination, String messageSelector) throws JMSException
destination
- messageSelector
-
JMSException
public QueueReceiver createReceiver(Queue queue) throws JMSException
createReceiver
in interface QueueSession
queue
-
JMSException
public QueueReceiver createReceiver(Queue queue, String messageSelector) throws JMSException
createReceiver
in interface QueueSession
queue
- messageSelector
-
JMSException
public QueueSender createSender(Queue queue) throws JMSException
createSender
in interface QueueSession
JMSException
public StreamMessage createStreamMessage() throws JMSException
createStreamMessage
in interface Session
JMSException
public TopicSubscriber createSubscriber(Topic topic) throws JMSException
createSubscriber
in interface TopicSession
topic
-
JMSException
public TopicSubscriber createSubscriber(Topic topic, String messageSelector, boolean noLocal) throws JMSException
createSubscriber
in interface TopicSession
topic
- messageSelector
- noLocal
-
JMSException
public TemporaryQueue createTemporaryQueue() throws JMSException
createTemporaryQueue
in interface QueueSession
createTemporaryQueue
in interface Session
JMSException
public TemporaryTopic createTemporaryTopic() throws JMSException
createTemporaryTopic
in interface Session
createTemporaryTopic
in interface TopicSession
JMSException
public TextMessage createTextMessage() throws JMSException
createTextMessage
in interface Session
JMSException
protected Object getFailoverMutex()
public TextMessage createTextMessage(String text) throws JMSException
createTextMessage
in interface Session
JMSException
public Topic createTopic(String topicName) throws JMSException
createTopic
in interface Session
createTopic
in interface TopicSession
JMSException
public void declareExchange(org.apache.qpid.framing.AMQShortString name, org.apache.qpid.framing.AMQShortString type, boolean nowait) throws org.apache.qpid.AMQException
org.apache.qpid.AMQException
public abstract void sync() throws org.apache.qpid.AMQException
org.apache.qpid.AMQException
public int getAcknowledgeMode() throws JMSException
getAcknowledgeMode
in interface Session
JMSException
public AMQConnection getAMQConnection()
public int getChannelId()
public int getDefaultPrefetch()
public int getDefaultPrefetchHigh()
public int getDefaultPrefetchLow()
public org.apache.qpid.framing.AMQShortString getDefaultQueueExchangeName()
public org.apache.qpid.framing.AMQShortString getDefaultTopicExchangeName()
public MessageListener getMessageListener() throws JMSException
getMessageListener
in interface Session
JMSException
public org.apache.qpid.framing.AMQShortString getTemporaryQueueExchangeName()
public org.apache.qpid.framing.AMQShortString getTemporaryTopicExchangeName()
public int getTicket()
public boolean getTransacted() throws JMSException
getTransacted
in interface Session
JMSException
public boolean hasConsumer(Destination destination)
public boolean isStrictAMQP()
public boolean isSuspended()
protected void addUnacknowledgedMessage(long id)
protected void addDeliveredMessage(long id)
public void messageReceived(UnprocessedMessage message)
message
- the message that has been receivedpublic void declareAndBind(AMQDestination amqd) throws org.apache.qpid.AMQException
org.apache.qpid.AMQException
public void recover() throws JMSException
recover
in interface Session
JMSException
- If the JMS provider fails to stop and restart message delivery due to some internal error.
Not that this does not necessarily mean that the recovery has failed, but simply that it is
not possible to tell if it has or not.protected abstract void sendRecover() throws org.apache.qpid.AMQException, FailoverException
org.apache.qpid.AMQException
FailoverException
protected abstract void flushAcknowledgments()
public void rejectMessage(UnprocessedMessage message, boolean requeue)
public void rejectMessage(AbstractJMSMessage message, boolean requeue)
public abstract void rejectMessage(long deliveryTag, boolean requeue)
public void rollback() throws JMSException
rollback
in interface Session
JMSException
- If the JMS provider fails to rollback the transaction due to some internal error. This does
not mean that the rollback is known to have failed, merely that it is not known whether it
failed or not.public abstract void releaseForRollback()
public abstract void sendRollback() throws org.apache.qpid.AMQException, FailoverException
org.apache.qpid.AMQException
FailoverException
public void run()
run
in interface Runnable
run
in interface Session
public void setMessageListener(MessageListener listener) throws JMSException
setMessageListener
in interface Session
JMSException
public void unsubscribe(String name) throws JMSException
unsubscribe
in interface Session
unsubscribe
in interface TopicSession
JMSException
unsubscribe(String, boolean)
protected C createConsumerImpl(Destination destination, int prefetchHigh, int prefetchLow, boolean noLocal, boolean exclusive, String selector, org.apache.qpid.framing.FieldTable rawSelector, boolean noConsume, boolean autoClose) throws JMSException
JMSException
public abstract C createMessageConsumer(AMQDestination destination, int prefetchHigh, int prefetchLow, boolean noLocal, boolean exclusive, String selector, org.apache.qpid.framing.FieldTable arguments, boolean noConsume, boolean autoClose) throws JMSException
JMSException
void deregisterConsumer(C consumer)
consumer
- the consumvoid deregisterProducer(long producerId)
boolean isInRecovery()
boolean isQueueBound(org.apache.qpid.framing.AMQShortString exchangeName, org.apache.qpid.framing.AMQShortString queueName) throws JMSException
JMSException
public abstract boolean isQueueBound(org.apache.qpid.framing.AMQShortString exchangeName, org.apache.qpid.framing.AMQShortString queueName, org.apache.qpid.framing.AMQShortString routingKey) throws JMSException
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.
JMSException
- If the query fails for any reason.public abstract boolean isQueueBound(AMQDestination destination) throws JMSException
JMSException
public abstract boolean isQueueBound(String exchangeName, String queueName, String bindingKey, Map<String,Object> args) throws JMSException
JMSException
void markClosed()
void failoverPrep()
void syncDispatchQueue()
void resubscribe() throws org.apache.qpid.AMQException
org.apache.qpid.AMQException
void setHasMessageListeners()
void setInRecovery(boolean inRecovery)
boolean isStarted()
void start() throws org.apache.qpid.AMQException
org.apache.qpid.AMQException
- If the session cannot be started for any reason.void startDispatcherIfNecessary()
void startDispatcherIfNecessary(boolean initiallyStopped)
void stop() throws org.apache.qpid.AMQException
org.apache.qpid.AMQException
protected void checkTransacted() throws JMSException
JMSException
protected AMQTopic checkValidTopic(Topic topic, boolean durable) throws JMSException
JMSException
protected AMQTopic checkValidTopic(Topic topic) throws JMSException
JMSException
public abstract void sendConsume(C consumer, org.apache.qpid.framing.AMQShortString queueName, AMQProtocolHandler protocolHandler, boolean nowait, String messageSelector, int tag) throws org.apache.qpid.AMQException, FailoverException
org.apache.qpid.AMQException
FailoverException
public abstract P createMessageProducer(Destination destination, boolean mandatory, boolean immediate, boolean waitUntilSent, long producerId)
public long getQueueDepth(AMQDestination amqd) throws org.apache.qpid.AMQException
amqd
- The destination to be checked
org.apache.qpid.AMQException
- If the queue cannot be declared for any reason.protected abstract Long requestQueueDepth(AMQDestination amqd) throws org.apache.qpid.AMQException, FailoverException
org.apache.qpid.AMQException
FailoverException
public abstract void sendExchangeDeclare(org.apache.qpid.framing.AMQShortString name, org.apache.qpid.framing.AMQShortString type, AMQProtocolHandler protocolHandler, boolean nowait) throws org.apache.qpid.AMQException, FailoverException
org.apache.qpid.AMQException
FailoverException
protected org.apache.qpid.framing.AMQShortString declareQueue(AMQDestination amqd, AMQProtocolHandler protocolHandler, boolean noLocal) throws org.apache.qpid.AMQException
amqd
- The destination to declare as a queue.protocolHandler
- The protocol handler to communicate through.
org.apache.qpid.AMQException
- If the queue cannot be declared for any reason.protected org.apache.qpid.framing.AMQShortString declareQueue(AMQDestination amqd, AMQProtocolHandler protocolHandler, boolean noLocal, boolean nowait) throws org.apache.qpid.AMQException
org.apache.qpid.AMQException
public abstract void sendQueueDeclare(AMQDestination amqd, AMQProtocolHandler protocolHandler, boolean nowait) throws org.apache.qpid.AMQException, FailoverException
org.apache.qpid.AMQException
FailoverException
protected void deleteQueue(org.apache.qpid.framing.AMQShortString queueName) throws JMSException
queueName
- The name of the queue to delete.
JMSException
- If the queue could not be deleted for any reason.public abstract void sendQueueDelete(org.apache.qpid.framing.AMQShortString queueName) throws org.apache.qpid.AMQException, FailoverException
org.apache.qpid.AMQException
FailoverException
protected AMQProtocolHandler getProtocolHandler()
public byte getProtocolMajorVersion()
public byte getProtocolMinorVersion()
protected boolean hasMessageListeners()
public abstract void handleAddressBasedDestination(AMQDestination dest, boolean isConsumer, boolean noWait) throws org.apache.qpid.AMQException
org.apache.qpid.AMQException
protected void suspendChannel(boolean suspend) throws org.apache.qpid.AMQException
suspend
- true indicates that the session should be suspended, false indicates that it
should be unsuspended.
org.apache.qpid.AMQException
- If the session cannot be suspended for any reason.public abstract void sendSuspendChannel(boolean suspend) throws org.apache.qpid.AMQException, FailoverException
org.apache.qpid.AMQException
FailoverException
Object getMessageDeliveryLock()
public boolean prefetch()
public void markDirty()
public void markClean()
public boolean hasFailedOver()
public boolean isDirty()
public void setTicket(int ticket)
public void setFlowControl(boolean active)
public void checkFlowControl() throws InterruptedException, JMSException
InterruptedException
JMSException
public void dispatch(UnprocessedMessage message)
protected abstract boolean tagLE(long tag1, long tag2)
protected abstract boolean updateRollbackMark(long current, long deliveryTag)
public abstract AMQMessageDelegateFactory getMessageDelegateFactory()
public boolean isClosed()
isClosed
in class Closeable
public boolean isClosing()
isClosing
in class Closeable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |