public class Queue extends Object implements QueueMBean, Externalizable
Modifier and Type | Class and Description |
---|---|
private static class |
Queue.Subscription |
private static class |
Queue.SubscriptionKey |
Modifier and Type | Field and Description |
---|---|
private boolean |
autodelete |
private List<String> |
boundExchanges |
private Map<Queue.SubscriptionKey,Queue.Subscription> |
consumers |
private boolean |
durable |
private boolean |
exclusive |
static long |
FIRST_DELIVERY |
static org.objectweb.util.monolog.api.Logger |
logger |
private long |
msgCounter |
private String |
name |
private static String |
PREFIX_BOUND_EXCHANGE |
private static String |
PREFIX_MSG |
static String |
PREFIX_QUEUE |
private String |
prefixBE |
private String |
prefixMsg |
private long |
proxyId |
private static long |
serialVersionUID
define serialVersionUID for interoperability
|
private short |
serverId |
private SortedSet<Message> |
toAck |
private SortedSet<Message> |
toDeliver |
Constructor and Description |
---|
Queue() |
Queue(String name,
boolean durable,
boolean autodelete,
boolean exclusive,
short serverId,
long proxyId) |
Modifier and Type | Method and Description |
---|---|
void |
ackMessages(List<Long> idsToAck) |
void |
addBoundExchange(String exchange,
short serverId,
long proxyId) |
void |
cancel(String consumerTag,
int channelNumber,
short serverId,
long proxyId) |
void |
cleanConsumers(short sid) |
int |
clear(short serverId,
long proxyId) |
void |
consume(DeliveryListener proxy,
int channelId,
String consumerTag,
boolean exclusiveConsumer,
boolean noAck,
boolean noLocal,
short serverId,
long proxyId) |
private void |
deleteAllMessage(Set<Message> messages) |
private void |
deleteBoundExchange(String exchangeName) |
private void |
deleteMessage(long msgId) |
void |
deleteQueue(String queueName,
short serverId,
long proxyId) |
List<String> |
getBoundExchanges() |
int |
getConsumerCount() |
List<Deliver> |
getDeliveries(String consumerTag,
int channelId,
int maxMessage,
short serverId,
long proxyId) |
long |
getHandledMessageCount() |
AMQP.Queue.DeclareOk |
getInfo(short serverId,
long proxyId) |
String |
getName() |
int |
getToAckMessageCount() |
int |
getToDeliverMessageCount() |
boolean |
isAutodelete() |
boolean |
isDurable() |
boolean |
isExclusive() |
static Queue |
loadQueue(String name) |
void |
publish(Message msg,
boolean immediate,
short serverId,
long proxyId) |
void |
readExternal(ObjectInput in) |
Message |
receive(boolean noAck,
short serverId,
long proxyId) |
void |
recoverMessages(List<Long> idsToRecover) |
void |
removeBoundExchange(String exchangeName) |
void |
removeBoundExchange(String exchangeName,
short serverId,
long proxyId) |
private void |
saveBoundExchange(String exchange) |
private void |
saveMessage(Message msg) |
private void |
saveQueue(Queue queue) |
void |
writeExternal(ObjectOutput out) |
private static final long serialVersionUID
public static final org.objectweb.util.monolog.api.Logger logger
public static final long FIRST_DELIVERY
private String name
private boolean durable
private boolean autodelete
private boolean exclusive
private short serverId
private long proxyId
private long msgCounter
private Map<Queue.SubscriptionKey,Queue.Subscription> consumers
public static final String PREFIX_QUEUE
private static final String PREFIX_MSG
private static final String PREFIX_BOUND_EXCHANGE
private String prefixMsg
private String prefixBE
public Queue()
public Queue(String name, boolean durable, boolean autodelete, boolean exclusive, short serverId, long proxyId) throws TransactionException
TransactionException
public Message receive(boolean noAck, short serverId, long proxyId) throws ResourceLockedException, TransactionException
public void consume(DeliveryListener proxy, int channelId, String consumerTag, boolean exclusiveConsumer, boolean noAck, boolean noLocal, short serverId, long proxyId) throws AccessRefusedException, ResourceLockedException
public List<Deliver> getDeliveries(String consumerTag, int channelId, int maxMessage, short serverId, long proxyId)
public void publish(Message msg, boolean immediate, short serverId, long proxyId) throws NoConsumersException, TransactionException
public void cancel(String consumerTag, int channelNumber, short serverId, long proxyId) throws ResourceLockedException
ResourceLockedException
public void cleanConsumers(short sid)
public int clear(short serverId, long proxyId) throws ResourceLockedException, TransactionException
public void recoverMessages(List<Long> idsToRecover) throws TransactionException
TransactionException
public AMQP.Queue.DeclareOk getInfo(short serverId, long proxyId) throws ResourceLockedException
ResourceLockedException
public String getName()
getName
in interface QueueMBean
public int getConsumerCount()
getConsumerCount
in interface QueueMBean
public boolean isAutodelete()
isAutodelete
in interface QueueMBean
public int getToDeliverMessageCount()
getToDeliverMessageCount
in interface QueueMBean
public int getToAckMessageCount()
getToAckMessageCount
in interface QueueMBean
public long getHandledMessageCount()
getHandledMessageCount
in interface QueueMBean
public List<String> getBoundExchanges()
getBoundExchanges
in interface QueueMBean
public boolean isDurable()
isDurable
in interface QueueMBean
public boolean isExclusive()
isExclusive
in interface QueueMBean
public void addBoundExchange(String exchange, short serverId, long proxyId) throws TransactionException, ResourceLockedException
public void removeBoundExchange(String exchangeName)
public void removeBoundExchange(String exchangeName, short serverId, long proxyId) throws ResourceLockedException
ResourceLockedException
public void deleteQueue(String queueName, short serverId, long proxyId) throws ResourceLockedException, TransactionException
public static Queue loadQueue(String name) throws IOException, ClassNotFoundException, TransactionException
private void saveQueue(Queue queue) throws TransactionException
TransactionException
private void saveBoundExchange(String exchange) throws TransactionException
TransactionException
private void deleteBoundExchange(String exchangeName)
private void saveMessage(Message msg) throws TransactionException
TransactionException
private void deleteMessage(long msgId)
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
out
- IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
in
- IOException
ClassNotFoundException
Copyright © 2013 ScalAgent D.T.. All Rights Reserved.