public class AMQChannel<T extends AMQProtocolSession<T>> extends Object implements AMQSessionModel<AMQChannel<T>,T>, AsyncAutoCommitTransaction.FutureRecorder
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_PREFETCH |
| Constructor and Description |
|---|
AMQChannel(T session,
int channelId,
MessageStore messageStore) |
| Modifier and Type | Method and Description |
|---|---|
void |
acknowledgeMessage(long deliveryTag,
boolean multiple)
Acknowledge one or more messages.
|
void |
addConsumerListener(ConsumerListener listener) |
void |
addDeleteTask(Action<? super AMQChannel<T>> task) |
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) |
void |
close()
Called from the protocol session to close this channel and clean up.
|
void |
close(org.apache.qpid.protocol.AMQConstant cause,
String message) |
void |
commit() |
void |
commit(Runnable immediateAction,
boolean async) |
int |
compareTo(AMQChannel o) |
org.apache.qpid.framing.AMQShortString |
consumeFromSource(org.apache.qpid.framing.AMQShortString tag,
MessageSource source,
boolean acks,
org.apache.qpid.framing.FieldTable filters,
boolean exclusive,
boolean noLocal)
Subscribe to a queue.
|
void |
deadLetter(long deliveryTag) |
String |
debugIdentity() |
boolean |
getBlocking() |
int |
getChannelId() |
ClientDeliveryMethod |
getClientDeliveryMethod() |
String |
getClientID() |
T |
getConnectionModel() |
Object |
getConnectionReference() |
int |
getConsumerCount() |
Collection<Consumer<?>> |
getConsumers() |
FlowCreditManager |
getCreditManager() |
AMQQueue |
getDefaultQueue() |
UUID |
getId() |
LogSubject |
getLogSubject() |
MessageStore |
getMessageStore() |
Session<?> |
getModelObject() |
int |
getNextConsumerTag() |
long |
getNextDeliveryTag() |
AMQProtocolSession |
getProtocolSession() |
RecordDeliveryMethod |
getRecordDeliveryMethod() |
Subject |
getSubject() |
ConsumerImpl |
getSubscription(org.apache.qpid.framing.AMQShortString tag) |
long |
getTransactionStartTime() |
long |
getTransactionUpdateTime() |
Long |
getTxnCommits() |
Long |
getTxnCount() |
Long |
getTxnRejects() |
Long |
getTxnStart() |
int |
getUnacknowledgedMessageCount() |
UnacknowledgedMessageMap |
getUnacknowledgedMessageMap()
Used only for testing purposes.
|
VirtualHostImpl |
getVirtualHost() |
boolean |
isClosing() |
boolean |
isDeliveredTooManyTimes(long deliveryTag) |
boolean |
isMaxDeliveryCountEnabled(long deliveryTag) |
boolean |
isSuspended() |
boolean |
isTransactional() |
void |
publishContentBody(org.apache.qpid.framing.ContentBody contentBody) |
void |
publishContentHeader(org.apache.qpid.framing.ContentHeaderBody contentHeaderBody) |
void |
receivedComplete() |
void |
recordFuture(StoreFuture future,
ServerTransaction.Action action) |
void |
removeConsumerListener(ConsumerListener listener) |
void |
removeDeleteTask(Action<? super AMQChannel<T>> task) |
void |
requeue()
Called to attempt re-delivery all outstanding unacknowledged messages on the channel.
|
void |
requeue(long deliveryTag)
Requeue a single message
|
void |
resend()
Called to resend all outstanding unacknowledged messages to this same channel.
|
void |
rollback() |
void |
rollback(Runnable postRollbackTask) |
void |
setCredit(long prefetchSize,
int prefetchCount) |
void |
setDefaultQueue(AMQQueue queue) |
void |
setLocalTransactional()
Sets this channel to be part of a local transaction
|
void |
setModelObject(Session<?> session) |
void |
setPublishFrame(org.apache.qpid.framing.abstraction.MessagePublishInfo info,
MessageDestination e) |
void |
setSuspended(boolean suspended)
Called from the ChannelFlowHandler to suspend this Channel
|
void |
sync() |
String |
toString() |
void |
unblock() |
void |
unblock(AMQQueue queue) |
boolean |
unsubscribeConsumer(org.apache.qpid.framing.AMQShortString consumerTag)
Unsubscribe a consumer from a queue.
|
public static final int DEFAULT_PREFETCH
public AMQChannel(T session, int channelId, MessageStore messageStore) throws org.apache.qpid.AMQException
org.apache.qpid.AMQExceptionpublic void setLocalTransactional()
public boolean isTransactional()
public void receivedComplete()
public Long getTxnCommits()
getTxnCommits in interface AMQSessionModel<AMQChannel<T extends AMQProtocolSession<T>>,T extends AMQProtocolSession<T>>public Long getTxnRejects()
getTxnRejects in interface AMQSessionModel<AMQChannel<T extends AMQProtocolSession<T>>,T extends AMQProtocolSession<T>>public Long getTxnCount()
getTxnCount in interface AMQSessionModel<AMQChannel<T extends AMQProtocolSession<T>>,T extends AMQProtocolSession<T>>public Long getTxnStart()
getTxnStart in interface AMQSessionModel<AMQChannel<T extends AMQProtocolSession<T>>,T extends AMQProtocolSession<T>>public int getChannelId()
getChannelId in interface AMQSessionModel<AMQChannel<T extends AMQProtocolSession<T>>,T extends AMQProtocolSession<T>>public void setPublishFrame(org.apache.qpid.framing.abstraction.MessagePublishInfo info,
MessageDestination e)
public void publishContentHeader(org.apache.qpid.framing.ContentHeaderBody contentHeaderBody)
throws org.apache.qpid.AMQException
org.apache.qpid.AMQExceptionpublic void publishContentBody(org.apache.qpid.framing.ContentBody contentBody)
throws org.apache.qpid.AMQException
org.apache.qpid.AMQExceptionpublic long getNextDeliveryTag()
public int getNextConsumerTag()
public ConsumerImpl getSubscription(org.apache.qpid.framing.AMQShortString tag)
public org.apache.qpid.framing.AMQShortString consumeFromSource(org.apache.qpid.framing.AMQShortString tag,
MessageSource source,
boolean acks,
org.apache.qpid.framing.FieldTable filters,
boolean exclusive,
boolean noLocal)
throws org.apache.qpid.AMQException,
MessageSource.ExistingConsumerPreventsExclusive,
MessageSource.ExistingExclusiveConsumer,
AMQInvalidArgumentException,
MessageSource.ConsumerAccessRefused
tag - the tag chosen by the client (if null, server will generate one)source - the queue to subscribe toacks - Are acks enabled for this subscriberfilters - Filters to apply to this subscriberexclusive - Flag requesting exclusive access to the queueorg.apache.qpid.AMQException - if something goes wrongMessageSource.ExistingConsumerPreventsExclusiveMessageSource.ExistingExclusiveConsumerAMQInvalidArgumentExceptionMessageSource.ConsumerAccessRefusedpublic boolean unsubscribeConsumer(org.apache.qpid.framing.AMQShortString consumerTag)
consumerTag - public void close()
close in interface AMQSessionModel<AMQChannel<T extends AMQProtocolSession<T>>,T extends AMQProtocolSession<T>>public void close(org.apache.qpid.protocol.AMQConstant cause,
String message)
close in interface AMQSessionModel<AMQChannel<T extends AMQProtocolSession<T>>,T extends AMQProtocolSession<T>>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()
public void requeue(long deliveryTag)
deliveryTag - The message to requeuepublic boolean isMaxDeliveryCountEnabled(long deliveryTag)
public boolean isDeliveredTooManyTimes(long deliveryTag)
public void resend()
throws org.apache.qpid.AMQException
org.apache.qpid.AMQException - When something goes wrong.public void acknowledgeMessage(long deliveryTag,
boolean multiple)
throws org.apache.qpid.AMQException
deliveryTag - the last delivery tagmultiple - if true will acknowledge all messages up to an including the delivery tag. if false only
acknowledges the single message specified by the delivery tagorg.apache.qpid.AMQException - if the delivery tag is unknown (e.g. not outstanding) on this channelpublic UnacknowledgedMessageMap getUnacknowledgedMessageMap()
public void setSuspended(boolean suspended)
suspended - boolean, should this Channel be suspendedpublic boolean isSuspended()
public void commit()
throws org.apache.qpid.AMQException
org.apache.qpid.AMQExceptionpublic void commit(Runnable immediateAction, boolean async) throws org.apache.qpid.AMQException
org.apache.qpid.AMQExceptionpublic void rollback()
throws org.apache.qpid.AMQException
org.apache.qpid.AMQExceptionpublic void rollback(Runnable postRollbackTask) throws org.apache.qpid.AMQException
org.apache.qpid.AMQExceptionpublic void setDefaultQueue(AMQQueue queue)
public AMQQueue getDefaultQueue()
public boolean isClosing()
public AMQProtocolSession getProtocolSession()
public FlowCreditManager getCreditManager()
public void setCredit(long prefetchSize,
int prefetchCount)
public MessageStore getMessageStore()
public ClientDeliveryMethod getClientDeliveryMethod()
public RecordDeliveryMethod getRecordDeliveryMethod()
public UUID getId()
getId in interface AMQSessionModel<AMQChannel<T extends AMQProtocolSession<T>>,T extends AMQProtocolSession<T>>public T getConnectionModel()
getConnectionModel in interface AMQSessionModel<AMQChannel<T extends AMQProtocolSession<T>>,T extends AMQProtocolSession<T>>public String getClientID()
getClientID in interface AMQSessionModel<AMQChannel<T extends AMQProtocolSession<T>>,T extends AMQProtocolSession<T>>public LogSubject getLogSubject()
getLogSubject in interface AMQSessionModel<AMQChannel<T extends AMQProtocolSession<T>>,T extends AMQProtocolSession<T>>public int compareTo(AMQChannel o)
compareTo in interface Comparable<AMQChannel<T extends AMQProtocolSession<T>>>public void addDeleteTask(Action<? super AMQChannel<T>> task)
addDeleteTask in interface Deletable<AMQChannel<T extends AMQProtocolSession<T>>>public void removeDeleteTask(Action<? super AMQChannel<T>> task)
removeDeleteTask in interface Deletable<AMQChannel<T extends AMQProtocolSession<T>>>public Subject getSubject()
public void block()
block in interface AMQSessionModel<AMQChannel<T extends AMQProtocolSession<T>>,T extends AMQProtocolSession<T>>public void unblock()
unblock in interface AMQSessionModel<AMQChannel<T extends AMQProtocolSession<T>>,T extends AMQProtocolSession<T>>public void block(AMQQueue queue)
block in interface AMQSessionModel<AMQChannel<T extends AMQProtocolSession<T>>,T extends AMQProtocolSession<T>>public void unblock(AMQQueue queue)
unblock in interface AMQSessionModel<AMQChannel<T extends AMQProtocolSession<T>>,T extends AMQProtocolSession<T>>public Object getConnectionReference()
getConnectionReference in interface AMQSessionModel<AMQChannel<T extends AMQProtocolSession<T>>,T extends AMQProtocolSession<T>>public int getUnacknowledgedMessageCount()
getUnacknowledgedMessageCount in interface AMQSessionModel<AMQChannel<T extends AMQProtocolSession<T>>,T extends AMQProtocolSession<T>>public boolean getBlocking()
getBlocking in interface AMQSessionModel<AMQChannel<T extends AMQProtocolSession<T>>,T extends AMQProtocolSession<T>>public VirtualHostImpl getVirtualHost()
public void checkTransactionStatus(long openWarn,
long openClose,
long idleWarn,
long idleClose)
checkTransactionStatus in interface AMQSessionModel<AMQChannel<T extends AMQProtocolSession<T>>,T extends AMQProtocolSession<T>>public void deadLetter(long deliveryTag)
throws org.apache.qpid.AMQException
org.apache.qpid.AMQExceptionpublic void recordFuture(StoreFuture future, ServerTransaction.Action action)
recordFuture in interface AsyncAutoCommitTransaction.FutureRecorderpublic void sync()
public int getConsumerCount()
getConsumerCount in interface AMQSessionModel<AMQChannel<T extends AMQProtocolSession<T>>,T extends AMQProtocolSession<T>>public Collection<Consumer<?>> getConsumers()
getConsumers in interface AMQSessionModel<AMQChannel<T extends AMQProtocolSession<T>>,T extends AMQProtocolSession<T>>public void addConsumerListener(ConsumerListener listener)
addConsumerListener in interface AMQSessionModel<AMQChannel<T extends AMQProtocolSession<T>>,T extends AMQProtocolSession<T>>public void removeConsumerListener(ConsumerListener listener)
removeConsumerListener in interface AMQSessionModel<AMQChannel<T extends AMQProtocolSession<T>>,T extends AMQProtocolSession<T>>public void setModelObject(Session<?> session)
setModelObject in interface AMQSessionModel<AMQChannel<T extends AMQProtocolSession<T>>,T extends AMQProtocolSession<T>>public Session<?> getModelObject()
getModelObject in interface AMQSessionModel<AMQChannel<T extends AMQProtocolSession<T>>,T extends AMQProtocolSession<T>>public long getTransactionStartTime()
getTransactionStartTime in interface AMQSessionModel<AMQChannel<T extends AMQProtocolSession<T>>,T extends AMQProtocolSession<T>>public long getTransactionUpdateTime()
getTransactionUpdateTime in interface AMQSessionModel<AMQChannel<T extends AMQProtocolSession<T>>,T extends AMQProtocolSession<T>>Copyright © 2006–2014 The Apache Software Foundation. All rights reserved.