public class Queue extends Destination implements javax.jms.Queue, QueueMBean
javax.jms.Queue
interface.
This is a proxy object a client uses to specify the destination of messages it is sending and the source of messages it receives.
The Queue class is a factory for Joram's Queue destination through the create static methods, the Queue object provides Joram specific administration and monitoring methods.
Modifier and Type | Field and Description |
---|---|
static String |
REDELIVERY_DELAY |
private static long |
serialVersionUID
define serialVersionUID for interoperability
|
ACQUISITION_QUEUE, ACQUISITION_TOPIC, adminName, agentId, ALIAS_QUEUE, CLUSTER_QUEUE, DEAD_MQUEUE, DISTRIBUTION_QUEUE, DISTRIBUTION_TOPIC, FTP_QUEUE, JMXBeanName, logger, QUEUE, QUEUE_TYPE, SCHEDULER_QUEUE, TEMPORARY, TOPIC, TOPIC_TYPE, wrapper
Modifier | Constructor and Description |
---|---|
|
Queue() |
|
Queue(String name) |
protected |
Queue(String name,
byte type) |
Modifier and Type | Method and Description |
---|---|
void |
addClusteredQueue(Queue addedQueue)
Adds a queue into the cluster this queue belongs to.
|
void |
addRemoteDestination(Queue remote)
Adds a destination to an alias queue's destinations' list.
|
void |
addRemoteDestination(String destId)
Adds a destination to an alias queue's destinations' list.
|
void |
clear() |
static Queue |
create()
Administration method creating and deploying a queue on the local server.
|
static Queue |
create(int serverId)
Administration method creating and deploying a queue on a given server.
|
static Queue |
create(int serverId,
Properties prop)
Administration method creating and deploying a queue on a given server.
|
static Queue |
create(int serverId,
String name)
Administration method creating and deploying (or retrieving) a queue on a given
server with a given name.
|
static Queue |
create(int serverId,
String className,
Properties prop)
Administration method creating and deploying a queue on a given server.
|
static Queue |
create(int serverId,
String name,
String className,
Properties prop)
Administration method creating and deploying (or retrieving) a queue on a
given server.
|
static Queue |
create(String name)
Administration method creating and deploying (or retrieving) a queue on the
local server.
|
static Queue |
createQueue(String agentId,
String name) |
void |
deleteMessage(String msgId) |
void |
delRemoteDestination(Queue remote)
Removes a destination from an alias queue's destinations' list.
|
void |
delRemoteDestination(String destId)
Removes a destination from an alias queue's destinations' list.
|
int |
getDeliveredMessages()
Monitoring method returning the number of delivered messages since the queue's creation.
|
javax.jms.Message |
getMessage(String msgId)
Returns a copy of the message.
|
String |
getMessageDigest(String msgId) |
Properties |
getMessageHeader(String msgId) |
String[] |
getMessageIds()
Returns the identifiers of all messages in this queue.
|
Properties |
getMessageProperties(String msgId) |
int |
getNbMaxMsg()
Monitoring method returning the nbMaxMsg of this queue, -1 if no limit.
|
int |
getPendingMessages()
Monitoring method returning the number of pending messages on this queue.
|
int |
getPendingRequests()
Monitoring method returning the number of pending requests on this queue.
|
String[] |
getQueueClusterElements()
Returns the reference of the queues that belong to the cluster.
|
String |
getQueueName()
API method.
|
int |
getThreshold()
Monitoring method returning the threshold of this queue, -1 if not set.
|
javax.jms.Message |
readMessage(String msgId)
Deprecated.
Since Joram 5.2 use getMessage.
|
void |
registerAsDefaultDMQ()
Sets the current queue as the default DMQ for the local server.
|
void |
registerAsDefaultDMQ(int serverId)
Sets the current queue as the default DMQ for the given server.
|
void |
removeClusteredQueue(Queue removedQueue)
Deprecated.
|
void |
removeFromCluster()
Removes this queue from the cluster it belongs to.
|
void |
sendDestinationsWeights(int[] weights)
Set weights for each remote destination of this alias queue.
|
void |
setNbMaxMsg(int nbMaxMsg)
Administration method setting nbMaxMsg for this queue.
|
void |
setRedeliveryDelay(int redeliveryDelay)
Set redeliveryDelay attribute.
|
void |
setSyncExceptionOnFull(boolean syncExceptionOnFull)
Administration method setting syncExceptionOnFull for this queue.
|
void |
setThreshold(int threshold)
Administration method setting or unsetting the threshold for this queue.
|
String |
toString()
Returns a String image of the queue.
|
addInterceptor, addInterceptors, addReader, addWriter, check, checkId, delete, doCreate, doRequest, equals, fromReference, getAdminName, getDMQ, getDMQId, getInterceptors, getJMXBeanName, getName, getReaderList, getReaders, getStatistic, getStatistics, getStatistics, getType, getWrapper, getWriterList, getWriters, hashCode, isFreelyReadable, isFreelyWriteable, isQueue, isTopic, newInstance, registerMBean, removeInterceptors, removeReader, removeWriter, replaceInterceptor, replaceInterceptor, scale, setDMQ, setDMQId, setFreelyReadable, setFreelyWriteable, setFreeReading, setFreeWriting, setProperties, setReader, setWrapper, setWriter, toReference, toXml, unregisterMBean, unsetFreeReading, unsetFreeWriting, unsetReader, unsetWriter
getReference
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addInterceptors, addReader, addWriter, delete, getAdminName, getDMQId, getInterceptors, getName, getReaderList, getStatistic, getStatistics, getWriterList, isFreelyReadable, isFreelyWriteable, isQueue, isTopic, removeInterceptors, removeReader, removeWriter, setDMQId, setFreelyReadable, setFreelyWriteable
private static final long serialVersionUID
public static final String REDELIVERY_DELAY
public Queue()
public Queue(String name)
protected Queue(String name, byte type)
public String toString()
public String getQueueName() throws javax.jms.JMSException
getQueueName
in interface javax.jms.Queue
javax.jms.JMSException
- Actually never thrown.public static Queue create() throws ConnectException, AdminException
The request fails if the destination deployment fails server side.
Be careful this method use the static AdminModule connection.
ConnectException
- If the admin connection is closed or broken.AdminException
- If the request fails.public static Queue create(int serverId) throws ConnectException, AdminException
The request fails if the target server does not belong to the platform, or if the destination deployment fails server side.
Be careful this method use the static AdminModule connection.
serverId
- The identifier of the server where deploying the queue.ConnectException
- If the admin connection is closed or broken.AdminException
- If the request fails.public static Queue create(String name) throws ConnectException, AdminException
The request fails if the destination deployment fails server side.
Be careful this method use the static AdminModule connection.
name
- The queue name.ConnectException
- If the admin connection is closed or broken.AdminException
- If the request fails.public static Queue create(int serverId, String name) throws ConnectException, AdminException
The request fails if the target server does not belong to the platform, or if the destination deployment fails server side.
Be careful this method use the static AdminModule connection.
serverId
- The identifier of the server where deploying the queue.name
- The queue name.ConnectException
- If the admin connection is closed or broken.AdminException
- If the request fails.public static Queue create(int serverId, Properties prop) throws ConnectException, AdminException
The request fails if the target server does not belong to the platform, or if the destination deployment fails server side.
Be careful this method use the static AdminModule connection.
serverId
- The identifier of the server where deploying the queue.prop
- The queue properties.ConnectException
- If the admin connection is closed or broken.AdminException
- If the request fails.public static Queue create(int serverId, String className, Properties prop) throws ConnectException, AdminException
The request fails if the target server does not belong to the platform, or if the destination deployment fails server side.
Be careful this method use the static AdminModule connection.
serverId
- The identifier of the server where deploying the queue.className
- The queue class name.prop
- The queue properties.ConnectException
- If the admin connection is closed or broken.AdminException
- If the request fails.public static Queue create(int serverId, String name, String className, Properties prop) throws ConnectException, AdminException
The request fails if the target server does not belong to the platform, or if the destination deployment fails server side.
Be careful this method use the static AdminModule connection.
serverId
- The identifier of the server where deploying the queue.name
- The name of the queue.className
- The MOM's queue class name.prop
- The queue properties.ConnectException
- If the admin connection is closed or broken.AdminException
- If the request fails.public void setThreshold(int threshold) throws ConnectException, AdminException
The request fails if the queue is deleted server side.
setThreshold
in interface QueueMBean
threshold
- The threshold value to be set (-1 for unsetting
previous value).ConnectException
- If the admin connection is closed or broken.AdminException
- If the request fails.public int getThreshold() throws ConnectException, AdminException
The request fails if the queue is deleted server side.
getThreshold
in interface QueueMBean
ConnectException
- If the admin connection is closed or broken.AdminException
- If the request fails.public void setNbMaxMsg(int nbMaxMsg) throws ConnectException, AdminException
The request fails if the queue is deleted server side.
setNbMaxMsg
in interface QueueMBean
nbMaxMsg
- nb Max of Message (-1 no limit).ConnectException
- If the admin connection is closed or broken.AdminException
- If the request fails.public int getNbMaxMsg() throws ConnectException, AdminException
The request fails if the queue is deleted server side.
getNbMaxMsg
in interface QueueMBean
ConnectException
- If the admin connection is closed or broken.AdminException
- If the request fails.public void setSyncExceptionOnFull(boolean syncExceptionOnFull) throws ConnectException, AdminException
The request fails if the queue is deleted server side.
syncExceptionOnFull
- true, throws an exception on sending message on full destination.ConnectException
- If the admin connection is closed or broken.AdminException
- If the request fails.public int getPendingMessages() throws ConnectException, AdminException
The request fails if the queue is deleted server side.
getPendingMessages
in interface QueueMBean
ConnectException
- If the admin connection is closed or broken.AdminException
- If the request fails.public int getPendingRequests() throws ConnectException, AdminException
The request fails if the queue is deleted server side.
getPendingRequests
in interface QueueMBean
ConnectException
- If the admin connection is closed or broken.AdminException
- If the request fails.public int getDeliveredMessages() throws ConnectException, AdminException
The request fails if the queue is deleted server side.
ConnectException
- If the admin connection is closed or broken.AdminException
- If the request fails.public String[] getMessageIds() throws AdminException, ConnectException
getMessageIds
in interface QueueMBean
AdminException
ConnectException
QueueMBean.getMessageIds()
public javax.jms.Message getMessage(String msgId) throws AdminException, ConnectException, javax.jms.JMSException
msgId
- The identifier of the message.AdminException
ConnectException
javax.jms.JMSException
public javax.jms.Message readMessage(String msgId) throws AdminException, ConnectException, javax.jms.JMSException
msgId
- The identifier of the message.AdminException
ConnectException
javax.jms.JMSException
public String getMessageDigest(String msgId) throws AdminException, ConnectException, javax.jms.JMSException
getMessageDigest
in interface QueueMBean
AdminException
ConnectException
javax.jms.JMSException
public Properties getMessageHeader(String msgId) throws AdminException, ConnectException, javax.jms.JMSException
getMessageHeader
in interface QueueMBean
AdminException
ConnectException
javax.jms.JMSException
public Properties getMessageProperties(String msgId) throws AdminException, ConnectException, javax.jms.JMSException
getMessageProperties
in interface QueueMBean
AdminException
ConnectException
javax.jms.JMSException
public void deleteMessage(String msgId) throws AdminException, ConnectException
deleteMessage
in interface QueueMBean
AdminException
ConnectException
public void clear() throws AdminException, ConnectException
clear
in interface QueueMBean
AdminException
ConnectException
public void addClusteredQueue(Queue addedQueue) throws ConnectException, AdminException
The request fails if one or both of the queues are deleted, or can't belong to a cluster.
addedQueue
- queue added to the clusterConnectException
- If the admin connection is closed or broken.AdminException
- If the request fails.public void removeClusteredQueue(Queue removedQueue) throws ConnectException, AdminException
The request fails if the queue does not exist or is not part of any cluster.
removedQueue
- queue removed from the clusterConnectException
- If the admin connection is closed or broken.AdminException
- If the request fails.public void removeFromCluster() throws ConnectException, AdminException
The request fails if the queue does not exist or is not part of any cluster.
ConnectException
- If the admin connection is closed or broken.AdminException
- If the request fails.public String[] getQueueClusterElements() throws ConnectException, AdminException
ConnectException
- If the admin connection is closed or broken.AdminException
- If the request fails.public void registerAsDefaultDMQ() throws ConnectException, AdminException
registerAsDefaultDMQ
in interface QueueMBean
ConnectException
- If the connection fails.AdminException
- Never thrown.public void registerAsDefaultDMQ(int serverId) throws ConnectException, AdminException
The request fails if the target server does not belong to the platform.
registerAsDefaultDMQ
in interface QueueMBean
serverId
- The identifier of the server.ConnectException
- If the connection fails.AdminException
- If the request fails.public void addRemoteDestination(String destId) throws ConnectException, AdminException
destId
- The internal name of remote destinationConnectException
AdminException
public void addRemoteDestination(Queue remote) throws ConnectException, AdminException
remote
- The remote queue to addConnectException
AdminException
public void delRemoteDestination(String destId) throws ConnectException, AdminException
destId
- The internal name of remote destinationConnectException
AdminException
public void delRemoteDestination(Queue remote) throws ConnectException, AdminException
destId
- The remote queue to removeConnectException
AdminException
public void sendDestinationsWeights(int[] weights) throws ConnectException, AdminException
weights
- ConnectException
AdminException
public void setRedeliveryDelay(int redeliveryDelay) throws ConnectException, AdminException
redeliveryDelay
- The delay use to wait before re-delivering messages after a deny.ConnectException
AdminException
Copyright © 2018 ScalAgent D.T.. All Rights Reserved.