public class AMQChannel extends Object implements AMQSessionModel<AMQChannel>, AsyncAutoCommitTransaction.FutureRecorder, ServerChannelMethodProcessor
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_PREFETCH |
| Constructor and Description |
|---|
AMQChannel(AMQPConnection_0_8 connection,
int channelId,
MessageStore messageStore) |
| Modifier and Type | Method and Description |
|---|---|
void |
addConsumerListener(ConsumerListener listener) |
void |
addDeleteTask(Action<? super AMQChannel> task) |
void |
addTicker(Ticker ticker) |
void |
addUnacknowledgedMessage(MessageInstance entry,
long deliveryTag,
ConsumerImpl consumer)
Add a message to the channel-based list of unacknowledged messages
|
void |
block() |
void |
block(AMQQueue queue) |
void |
checkTransactionStatus(long openWarn,
long openClose,
long idleWarn,
long idleClose)
This method is called from the housekeeping thread to check the status of
transactions on this session and react appropriately.
|
void |
close() |
void |
close(AMQConstant cause,
String message) |
void |
commit(Runnable immediateAction,
boolean async) |
int |
compareTo(AMQSessionModel o) |
AMQShortString |
consumeFromSource(AMQShortString tag,
Collection<MessageSource> sources,
boolean acks,
FieldTable arguments,
boolean exclusive,
boolean noLocal)
Subscribe to a queue.
|
String |
debugIdentity() |
void |
ensureConsumersNoticedStateChange() |
AccessControlContext |
getAccessControllerContext() |
AMQPConnection<?> |
getAMQPConnection() |
boolean |
getBlocking() |
int |
getChannelId() |
ClientDeliveryMethod |
getClientDeliveryMethod() |
String |
getClientID() |
AMQPConnection_0_8 |
getConnection() |
Object |
getConnectionReference() |
int |
getConsumerCount() |
Collection<Consumer<?>> |
getConsumers() |
UUID |
getId() |
LogSubject |
getLogSubject() |
long |
getMaxUncommittedInMemorySize() |
MessageStore |
getMessageStore() |
Session<?> |
getModelObject() |
int |
getNextConsumerTag() |
long |
getNextDeliveryTag() |
RecordDeliveryMethod |
getRecordDeliveryMethod() |
Subject |
getSubject() |
ConsumerTarget |
getSubscription(AMQShortString tag) |
long |
getTransactionStartTime()
Return the time the current transaction started.
|
long |
getTransactionUpdateTime()
Return the time of the last activity on the current transaction.
|
Long |
getTxnCommits() |
Long |
getTxnCount() |
Long |
getTxnRejects() |
Long |
getTxnStart() |
int |
getUnacknowledgedMessageCount() |
UnacknowledgedMessageMap |
getUnacknowledgedMessageMap()
Used only for testing purposes.
|
VirtualHostImpl |
getVirtualHost() |
boolean |
hasCurrentMessage() |
boolean |
ignoreAllButCloseOk() |
boolean |
isClosing() |
boolean |
isDeliveredTooManyTimes(long deliveryTag) |
boolean |
isMaxDeliveryCountEnabled(long deliveryTag) |
boolean |
isSuspended() |
boolean |
isTransactional() |
void |
notifyConsumerTargetCurrentStates() |
boolean |
processPending() |
void |
publishContentBody(ContentBody contentBody) |
void |
publishContentHeader(ContentHeaderBody contentHeaderBody) |
void |
receiveAccessRequest(AMQShortString realm,
boolean exclusive,
boolean passive,
boolean active,
boolean write,
boolean read) |
void |
receiveBasicAck(long deliveryTag,
boolean multiple) |
void |
receiveBasicCancel(AMQShortString consumerTag,
boolean nowait) |
void |
receiveBasicConsume(AMQShortString queue,
AMQShortString consumerTag,
boolean noLocal,
boolean noAck,
boolean exclusive,
boolean nowait,
FieldTable arguments) |
void |
receiveBasicGet(AMQShortString queueName,
boolean noAck) |
void |
receiveBasicNack(long deliveryTag,
boolean multiple,
boolean requeue) |
void |
receiveBasicPublish(AMQShortString exchangeName,
AMQShortString routingKey,
boolean mandatory,
boolean immediate) |
void |
receiveBasicQos(long prefetchSize,
int prefetchCount,
boolean global) |
void |
receiveBasicRecover(boolean requeue,
boolean sync) |
void |
receiveBasicReject(long deliveryTag,
boolean requeue) |
void |
receiveChannelClose(int replyCode,
AMQShortString replyText,
int classId,
int methodId) |
void |
receiveChannelCloseOk() |
void |
receiveChannelFlow(boolean active) |
void |
receiveChannelFlowOk(boolean active) |
void |
receiveConfirmSelect(boolean nowait) |
void |
receivedComplete() |
void |
receiveExchangeBound(AMQShortString exchangeName,
AMQShortString routingKey,
AMQShortString queueName) |
void |
receiveExchangeDeclare(AMQShortString exchangeName,
AMQShortString type,
boolean passive,
boolean durable,
boolean autoDelete,
boolean internal,
boolean nowait,
FieldTable arguments) |
void |
receiveExchangeDelete(AMQShortString exchangeStr,
boolean ifUnused,
boolean nowait) |
void |
receiveMessageContent(QpidByteBuffer data) |
void |
receiveMessageHeader(BasicContentHeaderProperties properties,
long bodySize) |
void |
receiveQueueBind(AMQShortString queueName,
AMQShortString exchange,
AMQShortString routingKey,
boolean nowait,
FieldTable argumentsTable) |
void |
receiveQueueDeclare(AMQShortString queueStr,
boolean passive,
boolean durable,
boolean exclusive,
boolean autoDelete,
boolean nowait,
FieldTable arguments) |
void |
receiveQueueDelete(AMQShortString queueName,
boolean ifUnused,
boolean ifEmpty,
boolean nowait) |
void |
receiveQueuePurge(AMQShortString queueName,
boolean nowait) |
void |
receiveQueueUnbind(AMQShortString queueName,
AMQShortString exchange,
AMQShortString bindingKey,
FieldTable arguments) |
void |
receiveTxCommit() |
void |
receiveTxRollback() |
void |
receiveTxSelect() |
void |
recordFuture(com.google.common.util.concurrent.ListenableFuture<Void> future,
ServerTransaction.Action action) |
void |
removeConsumerListener(ConsumerListener listener) |
void |
removeDeleteTask(Action<? super AMQChannel> task) |
void |
removeTicker(Ticker ticker) |
void |
requeue(long deliveryTag)
Requeue a single message
|
void |
setCredit(long prefetchSize,
int prefetchCount) |
void |
setLocalTransactional()
Sets this channel to be part of a local transaction
|
void |
setModelObject(Session<?> session) |
void |
setPublishFrame(MessagePublishInfo info,
MessageDestination e) |
void |
setSuspended(boolean suspended)
Called from the ChannelFlowHandler to suspend this Channel
|
void |
sync() |
String |
toString() |
void |
transportStateChanged() |
void |
unblock() |
void |
unblock(AMQQueue queue) |
boolean |
unsubscribeConsumer(AMQShortString consumerTag)
Unsubscribe a consumer from a queue.
|
public static final int DEFAULT_PREFETCH
public AMQChannel(AMQPConnection_0_8 connection, int channelId, MessageStore messageStore)
public AccessControlContext getAccessControllerContext()
public void setLocalTransactional()
public boolean isTransactional()
public void receivedComplete()
public Long getTxnCommits()
getTxnCommits in interface AMQSessionModel<AMQChannel>public Long getTxnRejects()
getTxnRejects in interface AMQSessionModel<AMQChannel>public Long getTxnCount()
getTxnCount in interface AMQSessionModel<AMQChannel>public Long getTxnStart()
getTxnStart in interface AMQSessionModel<AMQChannel>public int getChannelId()
getChannelId in interface AMQSessionModel<AMQChannel>public void setPublishFrame(MessagePublishInfo info, MessageDestination e)
public void publishContentHeader(ContentHeaderBody contentHeaderBody)
public void publishContentBody(ContentBody contentBody)
public long getNextDeliveryTag()
public int getNextConsumerTag()
public ConsumerTarget getSubscription(AMQShortString tag)
public AMQShortString consumeFromSource(AMQShortString tag, Collection<MessageSource> sources, boolean acks, FieldTable arguments, boolean exclusive, boolean noLocal) throws MessageSource.ExistingConsumerPreventsExclusive, MessageSource.ExistingExclusiveConsumer, AMQInvalidArgumentException, MessageSource.ConsumerAccessRefused, ConsumerTagInUseException
tag - the tag chosen by the client (if null, server will generate one)sources - the queues to subscribe toacks - Are acks enabled for this subscriberarguments - Filters to apply to this subscriberexclusive - Flag requesting exclusive access to the queueMessageSource.ExistingConsumerPreventsExclusiveMessageSource.ExistingExclusiveConsumerAMQInvalidArgumentExceptionMessageSource.ConsumerAccessRefusedConsumerTagInUseExceptionpublic boolean unsubscribeConsumer(AMQShortString consumerTag)
consumerTag - public void close()
close in interface AMQSessionModel<AMQChannel>public void close(AMQConstant cause, String message)
close in interface AMQSessionModel<AMQChannel>public void addUnacknowledgedMessage(MessageInstance entry, long deliveryTag, ConsumerImpl consumer)
entry - the record of the message on the queue that was delivereddeliveryTag - the delivery tag used when delivering the message (see protocol spec for description of the
delivery tag)consumer - The consumer that is to acknowledge this message.public String debugIdentity()
public void requeue(long deliveryTag)
deliveryTag - The message to requeuepublic boolean isMaxDeliveryCountEnabled(long deliveryTag)
public boolean isDeliveredTooManyTimes(long deliveryTag)
public UnacknowledgedMessageMap getUnacknowledgedMessageMap()
public void setSuspended(boolean suspended)
suspended - boolean, should this Channel be suspendedpublic boolean isSuspended()
public void commit(Runnable immediateAction, boolean async)
public boolean isClosing()
public AMQPConnection_0_8 getConnection()
public void setCredit(long prefetchSize,
int prefetchCount)
public MessageStore getMessageStore()
public ClientDeliveryMethod getClientDeliveryMethod()
public RecordDeliveryMethod getRecordDeliveryMethod()
public UUID getId()
getId in interface AMQSessionModel<AMQChannel>public AMQPConnection<?> getAMQPConnection()
getAMQPConnection in interface AMQSessionModel<AMQChannel>public String getClientID()
getClientID in interface AMQSessionModel<AMQChannel>public LogSubject getLogSubject()
getLogSubject in interface AMQSessionModel<AMQChannel>public int compareTo(AMQSessionModel o)
compareTo in interface Comparable<AMQSessionModel>public void addDeleteTask(Action<? super AMQChannel> task)
addDeleteTask in interface Deletable<AMQChannel>public void removeDeleteTask(Action<? super AMQChannel> task)
removeDeleteTask in interface Deletable<AMQChannel>public Subject getSubject()
public boolean hasCurrentMessage()
public long getMaxUncommittedInMemorySize()
public void block()
block in interface AMQSessionModel<AMQChannel>public void unblock()
unblock in interface AMQSessionModel<AMQChannel>public void block(AMQQueue queue)
block in interface AMQSessionModel<AMQChannel>public void unblock(AMQQueue queue)
unblock in interface AMQSessionModel<AMQChannel>public void transportStateChanged()
transportStateChanged in interface AMQSessionModel<AMQChannel>public Object getConnectionReference()
getConnectionReference in interface AMQSessionModel<AMQChannel>public int getUnacknowledgedMessageCount()
getUnacknowledgedMessageCount in interface AMQSessionModel<AMQChannel>public boolean getBlocking()
getBlocking in interface AMQSessionModel<AMQChannel>public VirtualHostImpl getVirtualHost()
public void checkTransactionStatus(long openWarn,
long openClose,
long idleWarn,
long idleClose)
AMQSessionModelcheckTransactionStatus in interface AMQSessionModel<AMQChannel>openWarn - time in milliseconds before alerting on open transactionopenClose - time in milliseconds before closing connection with open transactionidleWarn - time in milliseconds before alerting on idle transactionidleClose - time in milliseconds before closing connection with idle transactionpublic void recordFuture(com.google.common.util.concurrent.ListenableFuture<Void> future, ServerTransaction.Action action)
recordFuture in interface AsyncAutoCommitTransaction.FutureRecorderpublic void sync()
public int getConsumerCount()
getConsumerCount in interface AMQSessionModel<AMQChannel>public Collection<Consumer<?>> getConsumers()
getConsumers in interface AMQSessionModel<AMQChannel>public void addConsumerListener(ConsumerListener listener)
addConsumerListener in interface AMQSessionModel<AMQChannel>public void removeConsumerListener(ConsumerListener listener)
removeConsumerListener in interface AMQSessionModel<AMQChannel>public void setModelObject(Session<?> session)
setModelObject in interface AMQSessionModel<AMQChannel>public Session<?> getModelObject()
getModelObject in interface AMQSessionModel<AMQChannel>public long getTransactionStartTime()
AMQSessionModelgetTransactionStartTime in interface AMQSessionModel<AMQChannel>public long getTransactionUpdateTime()
AMQSessionModelgetTransactionUpdateTime in interface AMQSessionModel<AMQChannel>public void receiveAccessRequest(AMQShortString realm, boolean exclusive, boolean passive, boolean active, boolean write, boolean read)
receiveAccessRequest in interface ServerChannelMethodProcessorpublic void receiveBasicAck(long deliveryTag,
boolean multiple)
receiveBasicAck in interface ChannelMethodProcessorreceiveBasicAck in interface ServerChannelMethodProcessorpublic void receiveBasicCancel(AMQShortString consumerTag, boolean nowait)
receiveBasicCancel in interface ServerChannelMethodProcessorpublic void receiveBasicConsume(AMQShortString queue, AMQShortString consumerTag, boolean noLocal, boolean noAck, boolean exclusive, boolean nowait, FieldTable arguments)
receiveBasicConsume in interface ServerChannelMethodProcessorpublic void receiveBasicGet(AMQShortString queueName, boolean noAck)
receiveBasicGet in interface ServerChannelMethodProcessorpublic void receiveBasicPublish(AMQShortString exchangeName, AMQShortString routingKey, boolean mandatory, boolean immediate)
receiveBasicPublish in interface ServerChannelMethodProcessorpublic void receiveBasicQos(long prefetchSize,
int prefetchCount,
boolean global)
receiveBasicQos in interface ServerChannelMethodProcessorpublic void receiveBasicRecover(boolean requeue,
boolean sync)
receiveBasicRecover in interface ServerChannelMethodProcessorpublic void receiveBasicReject(long deliveryTag,
boolean requeue)
receiveBasicReject in interface ServerChannelMethodProcessorpublic void receiveChannelClose(int replyCode,
AMQShortString replyText,
int classId,
int methodId)
receiveChannelClose in interface ChannelMethodProcessorpublic void receiveChannelCloseOk()
receiveChannelCloseOk in interface ChannelMethodProcessorpublic void receiveMessageContent(QpidByteBuffer data)
receiveMessageContent in interface ChannelMethodProcessorpublic void receiveMessageHeader(BasicContentHeaderProperties properties, long bodySize)
receiveMessageHeader in interface ChannelMethodProcessorpublic boolean ignoreAllButCloseOk()
ignoreAllButCloseOk in interface ChannelMethodProcessorpublic void receiveBasicNack(long deliveryTag,
boolean multiple,
boolean requeue)
receiveBasicNack in interface ChannelMethodProcessorpublic void receiveChannelFlow(boolean active)
receiveChannelFlow in interface ChannelMethodProcessorpublic void receiveChannelFlowOk(boolean active)
receiveChannelFlowOk in interface ChannelMethodProcessorpublic void receiveExchangeBound(AMQShortString exchangeName, AMQShortString routingKey, AMQShortString queueName)
receiveExchangeBound in interface ServerChannelMethodProcessorpublic void receiveExchangeDeclare(AMQShortString exchangeName, AMQShortString type, boolean passive, boolean durable, boolean autoDelete, boolean internal, boolean nowait, FieldTable arguments)
receiveExchangeDeclare in interface ServerChannelMethodProcessorpublic void receiveExchangeDelete(AMQShortString exchangeStr, boolean ifUnused, boolean nowait)
receiveExchangeDelete in interface ServerChannelMethodProcessorpublic void receiveQueueBind(AMQShortString queueName, AMQShortString exchange, AMQShortString routingKey, boolean nowait, FieldTable argumentsTable)
receiveQueueBind in interface ServerChannelMethodProcessorpublic void receiveQueueDeclare(AMQShortString queueStr, boolean passive, boolean durable, boolean exclusive, boolean autoDelete, boolean nowait, FieldTable arguments)
receiveQueueDeclare in interface ServerChannelMethodProcessorpublic void receiveQueueDelete(AMQShortString queueName, boolean ifUnused, boolean ifEmpty, boolean nowait)
receiveQueueDelete in interface ServerChannelMethodProcessorpublic void receiveQueuePurge(AMQShortString queueName, boolean nowait)
receiveQueuePurge in interface ServerChannelMethodProcessorpublic void receiveQueueUnbind(AMQShortString queueName, AMQShortString exchange, AMQShortString bindingKey, FieldTable arguments)
receiveQueueUnbind in interface ServerChannelMethodProcessorpublic void receiveTxSelect()
receiveTxSelect in interface ServerChannelMethodProcessorpublic void receiveTxCommit()
receiveTxCommit in interface ServerChannelMethodProcessorpublic void receiveTxRollback()
receiveTxRollback in interface ServerChannelMethodProcessorpublic void receiveConfirmSelect(boolean nowait)
receiveConfirmSelect in interface ServerChannelMethodProcessorpublic boolean processPending()
processPending in interface AMQSessionModel<AMQChannel>public void addTicker(Ticker ticker)
addTicker in interface AMQSessionModel<AMQChannel>public void removeTicker(Ticker ticker)
removeTicker in interface AMQSessionModel<AMQChannel>public void notifyConsumerTargetCurrentStates()
notifyConsumerTargetCurrentStates in interface AMQSessionModel<AMQChannel>public void ensureConsumersNoticedStateChange()
ensureConsumersNoticedStateChange in interface AMQSessionModel<AMQChannel>Copyright © 2006–2016 The Apache Software Foundation. All rights reserved.