public abstract class Destination extends AdministeredObject implements Destination, DestinationMBean
javax.jms.Destination
interface and provides
JORAM specific administration and monitoring methods.
A Destination is a JMS administered object that encapsulates a Joram's specific address. It is created by an administrator and later used by JMS clients. Normally the JMS clients find administered objects by looking them up in a JNDI namespace.
Joram MOM Model
Server side, a destination is a component receiving messages from producers and answering to consuming requests from consumers. A destination might either be a “queue” or a “topic”:
A destination provides methods to add and remove Interceptors, an interceptor is an object handling each message sent to the destination. Interceptors can read and also modify the messages. This enables filtering, transformation or content enrichment, for example adding a property into the message. Also Interceptors can stop the Interceptor chain by simply returning false to their intercept method invocation, in this case the transmission of the message is stopped.
Modifier and Type | Field and Description |
---|---|
static String |
ACQUISITION_QUEUE
Constant defining the implementation class for a Queue allowing to collect data from
external sources.
|
static String |
ACQUISITION_TOPIC
Constant defining the implementation class for a Topic allowing to collect data from
external sources.
|
protected String |
adminName
Symbolic name given by the administrator.
|
protected String |
agentId
Identifier of the agent destination.
|
static String |
ALIAS_QUEUE |
static String |
CLUSTER_QUEUE
Constant defining the implementation class for a clustered Queue.
|
static String |
DEAD_MQUEUE
Deprecated.
Since Joram 5.2.2 the DeadMQueue is a simple Queue.
|
static String |
DISTRIBUTION_QUEUE
Constant defining the implementation class for a Queue allowing to forward data to
external targets.
|
static String |
DISTRIBUTION_TOPIC
Constant defining the implementation class for a Queue allowing to forward data to
external targets.
|
static String |
FTP_QUEUE
Constant defining the implementation class for a Queue allowing to forward data with
Ftp.
|
protected String |
JMXBeanName |
static org.objectweb.util.monolog.api.Logger |
logger |
static String |
QUEUE
Constant defining the implementation class for a classic Queue.
|
static byte |
QUEUE_TYPE
Constant defining the type of a queue destination.
|
static String |
SCHEDULER_QUEUE
Constant defining the implementation class for a scheduled Queue.
|
private static long |
serialVersionUID
Define serialVersionUID for interoperability.
|
static byte |
TEMPORARY
Constant defining the type of a temporary destination (OR'ed with queue or topic type
depending of the real type of the destination).
|
static String |
TOPIC
Constant defining the implementation class for a classic Topic.
|
static byte |
TOPIC_TYPE
Constant defining the type of a topic destination.
|
private byte |
type
Type of the destination: Queue or Topic, Temporary or not.
|
(package private) AdminItf |
wrapper
Administration wrapper used to perform administration stuff.
|
Modifier | Constructor and Description |
---|---|
|
Destination() |
protected |
Destination(byte type) |
protected |
Destination(String id,
byte type) |
Modifier and Type | Method and Description |
---|---|
void |
addInterceptor(String interceptor,
Properties properties)
Administration method add interceptor.
|
void |
addInterceptors(String interceptors)
Administration method add interceptors.
|
void |
addReader(String proxyId)
Administration method setting a given user as a reader on this destination.
|
void |
addWriter(String proxyId)
Administration method setting a given user as a writer on this destination.
|
void |
check()
Check the destination identifier.
|
static void |
checkId(String id)
Check the specified destination identifier.
|
void |
delete()
Administration method removing this destination from the platform.
|
protected void |
doCreate(int serverId,
String name,
String className,
Properties props,
Destination dest,
byte type)
Administration method creating or retrieving a destination with a given name on a
given server, and returning its identifier.
|
(package private) AdminReply |
doRequest(AdminRequest request)
Method actually sending an
AdminRequest instance to
the platform and getting an AdminReply instance. |
boolean |
equals(Object obj)
Returns
true if the parameter object is a Joram destination
wrapping the same Joram's Destination. |
void |
fromReference(Reference ref)
Restores the administered object from a naming reference.
|
String |
getAdminName()
Returns the symbolic administration name of the destination.
|
Queue |
getDMQ()
Monitoring method returning the dead message queue of this destination,
null if not set.
|
String |
getDMQId()
Monitoring method returning the dead message queue id of this destination,
null if not set.
|
String |
getInterceptors()
Administration method to get interceptors list.
|
static String |
getJMXBeanName(String base,
Destination dest) |
String |
getName()
Returns the internal name of the destination.
|
List |
getReaderList()
Monitoring method returning the list of all users that have a reading
permission on this destination, or an empty list if no specific readers
are set.
|
List |
getReaders()
Monitoring method returning the list of all users that have a reading
permission on this destination, or an empty list if no specific readers
are set.
|
Hashtable |
getStatistic()
Deprecated.
|
Hashtable |
getStatistics()
Returns values of all valid JMX attributes about the destination.
|
Hashtable |
getStatistics(String attributes)
Returns values of specified JMX attributes about the destination.
|
byte |
getType()
Returns the type of the destination: queue or topic, temporary or not.
|
protected AdminItf |
getWrapper()
Returns the administration wrapper to use.
|
List |
getWriterList()
Monitoring method returning the list of all users that have a writing
permission on this destination, or an empty list if no specific writers
are set.
|
List |
getWriters()
Monitoring method returning the list of all users that have a writing
permission on this destination, or an empty list if no specific writers
are set.
|
int |
hashCode() |
boolean |
isFreelyReadable()
Monitoring method returning
true if this destination
provides free READ access. |
boolean |
isFreelyWriteable()
Monitoring method returning
true if this destination
provides free WRITE access. |
boolean |
isQueue()
Returns
true if the destination is a queue. |
boolean |
isTopic()
Returns
true if the destination is a topic. |
static Destination |
newInstance(String id,
String name,
byte type) |
String |
registerMBean(String base) |
void |
removeInterceptors(String interceptors)
Administration method to remove interceptors.
|
void |
removeReader(String proxyId)
Administration method unsetting a given user as a reader on this destination.
|
void |
removeWriter(String proxyId)
Administration method unsetting a given user as a writer on this destination.
|
void |
replaceInterceptor(String newInterceptor,
String oldInterceptor)
Administration method to replace interceptor.
|
void |
replaceInterceptor(String newInterceptor,
String oldInterceptor,
Properties properties)
Administration method to replace interceptor.
|
void |
scale(int op,
String param)
Administration method for scaling operations.
|
void |
setDMQ(Queue dmq)
Administration method setting or unsetting a dead message queue for this
destination.
|
void |
setDMQId(String dmqId)
Administration method setting or unsetting a dead message queue for this
destination.
|
void |
setFreelyReadable(boolean readable)
Administration method (un)setting free reading access to this destination.
|
void |
setFreelyWriteable(boolean writeable)
Administration method (un)setting free writing access to this destination.
|
void |
setFreeReading()
Administration method setting free reading access to this destination.
|
void |
setFreeWriting()
Administration method setting free writing access to this destination.
|
AdminReply |
setProperties(Properties prop)
Administration method to set properties.
|
void |
setReader(User user)
Administration method setting a given user as a reader on this destination.
|
void |
setWrapper(AdminItf wrapper)
Sets the administration wrapper to use.
|
void |
setWriter(User user)
Administration method setting a given user as a writer on this destination.
|
void |
toReference(Reference ref)
Sets the naming reference of a connection factory.
|
String |
toXml(int indent,
int serverId)
Format the destination properties in a XML format, the result can be used
in an XML configuration script.
|
void |
unregisterMBean() |
void |
unsetFreeReading()
Administration method unsetting free reading access to this destination.
|
void |
unsetFreeWriting()
Administration method unsetting free writing access to this destination.
|
void |
unsetReader(User user)
Administration method unsetting a given user as a reader on this destination.
|
void |
unsetWriter(User user)
Administration method unsetting a given user as a writer on this destination.
|
getReference
private static final long serialVersionUID
public static org.objectweb.util.monolog.api.Logger logger
protected String agentId
public static final byte TOPIC_TYPE
public static final byte QUEUE_TYPE
public static final byte TEMPORARY
private byte type
getType()
protected String adminName
AdminItf wrapper
It is defined through AdminModule element, it is closed at the end of the script. if it is not defined the wrapper set at creation is used, if none the static AdminModule connection is used.
public static final String QUEUE
public static final String TOPIC
public static final String DEAD_MQUEUE
public static final String CLUSTER_QUEUE
public static final String SCHEDULER_QUEUE
public static final String ACQUISITION_QUEUE
public static final String DISTRIBUTION_QUEUE
public static final String ACQUISITION_TOPIC
public static final String DISTRIBUTION_TOPIC
public static final String ALIAS_QUEUE
public static final String FTP_QUEUE
protected transient String JMXBeanName
public Destination()
protected Destination(byte type)
protected Destination(String id, byte type)
public String getName()
getName
in interface DestinationMBean
public static final void checkId(String id) throws InvalidDestinationException
Exception
- if an invalid destination identifier is specified.InvalidDestinationException
public void check() throws InvalidDestinationException
InvalidDestinationException
- if the destination identifier is invalid.public byte getType()
public final String getAdminName()
getAdminName
in interface DestinationMBean
public boolean equals(Object obj)
true
if the parameter object is a Joram destination
wrapping the same Joram's Destination.protected final AdminItf getWrapper() throws ConnectException
ConnectException
- if no wrapper is defined.public void setWrapper(AdminItf wrapper)
wrapper
- The wrapper to use or null to unset.final AdminReply doRequest(AdminRequest request) throws AdminException, ConnectException
AdminRequest
instance to
the platform and getting an AdminReply
instance.request
- the administration request to sendConnectException
- If the connection to the platform fails.AdminException
- If the platform's reply is invalid, or if
the request failed.public String toXml(int indent, int serverId) throws ConnectException, AdminException
indent
- use this indent for prefixing XML representation.serverId
- server id hosting the destination objectConnectException
- if the server is unreachableAdminException
- if an error occurspublic boolean isQueue()
true
if the destination is a queue.isQueue
in interface DestinationMBean
public boolean isTopic()
true
if the destination is a topic.isTopic
in interface DestinationMBean
protected void doCreate(int serverId, String name, String className, Properties props, Destination dest, byte type) 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
destination.name
- The destination name.className
- Name of the MOM destination class.props
- The configuration properties of the destination.dest
- The proxy object of the destination.type
- The type of the destination: queue, topic, temporary or not.ConnectException
- If the administration connection is closed or broken.AdminException
- If the request fails.public void delete() throws ConnectException, AdminException, JMSException
delete
in interface DestinationMBean
AdminException
- Never thrown.ConnectException
- If the administration connection is closed or broken.JMSException
- Never thrown.public static String getJMXBeanName(String base, Destination dest)
public void unregisterMBean()
public void setFreeReading() throws ConnectException, AdminException
The request fails if this destination is deleted server side.
ConnectException
- If the administration connection is closed or broken.AdminException
- If the request fails.public void setFreeWriting() throws ConnectException, AdminException
The request fails if this destination is deleted server side.
ConnectException
- If the administration connection is closed or broken.AdminException
- If the request fails.public void unsetFreeReading() throws ConnectException, AdminException
The request fails if this destination is deleted server side.
ConnectException
- If the administration connection is closed or broken.AdminException
- If the request fails.public void unsetFreeWriting() throws ConnectException, AdminException
The request fails if this destination is deleted server side.
ConnectException
- If the administration connection is closed or broken.AdminException
- If the request fails.public void setReader(User user) throws ConnectException, AdminException
The request fails if this destination is deleted server side.
user
- User to be set as a reader.ConnectException
- If the administration connection is closed or broken.AdminException
- If the request fails.public void addReader(String proxyId) throws ConnectException, AdminException
This method should be only used by the JMX MBean.
addReader
in interface DestinationMBean
proxyId
- The unique identification of the user's proxy.ConnectException
- If the administration connection is closed or broken.AdminException
- If the request fails.DestinationMBean.addReader(java.lang.String)
public void setWriter(User user) throws ConnectException, AdminException
The request fails if this destination is deleted server side.
user
- User to be set as a writer.ConnectException
- If the administration connection is closed or broken.AdminException
- If the request fails.public void addWriter(String proxyId) throws ConnectException, AdminException
This method should be only used by the JMX MBean.
addWriter
in interface DestinationMBean
proxyId
- The unique identification of the user's proxy.ConnectException
- If the administration connection is closed or broken.AdminException
- If the request fails.DestinationMBean.addWriter(java.lang.String)
public void unsetReader(User user) throws ConnectException, AdminException
The request fails if this destination is deleted server side.
user
- Reader to be unset.ConnectException
- If the administration connection is closed or broken.AdminException
- If the request fails.public void removeReader(String proxyId) throws ConnectException, AdminException
This method should be only used by the JMX MBean.
removeReader
in interface DestinationMBean
proxyId
- The unique identification of the user's proxy.ConnectException
- If the administration connection is closed or broken.AdminException
- If the request fails.DestinationMBean.removeReader(java.lang.String)
public void unsetWriter(User user) throws ConnectException, AdminException
The request fails if this destination is deleted server side.
user
- Writer to be unset.ConnectException
- If the administration connection is closed or broken.AdminException
- If the request fails.public void removeWriter(String proxyId) throws ConnectException, AdminException
This method should be only used by the JMX MBean.
removeWriter
in interface DestinationMBean
proxyId
- The unique identification of the user's proxy.ConnectException
- If the administration connection is closed or broken.AdminException
- If the request fails.DestinationMBean.removeWriter(java.lang.String)
public List getReaders() throws ConnectException, AdminException
The request fails if the destination is deleted server side.
ConnectException
- If the administration connection is closed or broken.AdminException
- If the request fails.public List getReaderList() throws ConnectException, AdminException
This method should be only used by the JMX MBean.
getReaderList
in interface DestinationMBean
ConnectException
- If the administration connection is closed or broken.AdminException
- If the request fails.DestinationMBean.getReaderList()
public List getWriters() throws ConnectException, AdminException
The request fails if the destination is deleted server side.
ConnectException
- If the administration connection is closed or broken.AdminException
- If the request fails.public List getWriterList() throws ConnectException, AdminException
This method should be only used by the JMX MBean.
getWriterList
in interface DestinationMBean
ConnectException
- If the administration connection is closed or broken.AdminException
- If the request fails.DestinationMBean.getWriterList()
public boolean isFreelyReadable() throws ConnectException, AdminException
true
if this destination
provides free READ access.
The request fails if the destination is deleted server side.
isFreelyReadable
in interface DestinationMBean
ConnectException
- If the administration connection is closed or broken.AdminException
- If the request fails.public void setFreelyReadable(boolean readable) throws ConnectException, AdminException
This method should be only used by the JMX MBean.
setFreelyReadable
in interface DestinationMBean
readable
- if true set the free reading access else disable.ConnectException
- If the administration connection is closed or broken.AdminException
- If the request fails.DestinationMBean.setFreelyReadable(boolean)
public boolean isFreelyWriteable() throws ConnectException, AdminException
true
if this destination
provides free WRITE access.
The request fails if the destination is deleted server side.
isFreelyWriteable
in interface DestinationMBean
ConnectException
- If the administration connection is closed or broken.AdminException
- If the request fails.public void setFreelyWriteable(boolean writeable) throws ConnectException, AdminException
This method should be only used by the JMX MBean.
setFreelyWriteable
in interface DestinationMBean
writeable
- if true set the free writing access else disable.ConnectException
- If the administration connection is closed or broken.AdminException
- If the request fails.DestinationMBean.setFreelyWriteable(boolean)
public Queue getDMQ() throws ConnectException, AdminException
The request fails if the destination is deleted server side.
ConnectException
- If the administration connection is closed or broken.AdminException
- If the request fails.public String getDMQId() throws ConnectException, AdminException
The request fails if the destination is deleted server side.
getDMQId
in interface DestinationMBean
ConnectException
- If the administration connection is closed or broken.AdminException
- If the request fails.public void setDMQ(Queue dmq) throws ConnectException, AdminException, InvalidDestinationException
The request fails if this destination is deleted server side.
dmq
- The dead message queue to be set (null
for
unsetting current DMQ).IllegalArgumentException
- If the DMQ is not a valid
JORAM destination.ConnectException
- If the administration connection is closed or broken.AdminException
- If the request fails.InvalidDestinationException
- If the specified destination is invalid.public void setDMQId(String dmqId) throws ConnectException, AdminException, InvalidDestinationException
The request fails if this destination is deleted server side.
setDMQId
in interface DestinationMBean
dmqId
- The dead message queue Id to be set (null
for
unsetting current DMQ).IllegalArgumentException
- If the DMQ is not a valid
JORAM destination.ConnectException
- If the administration connection is closed or broken.AdminException
- If the request fails.InvalidDestinationException
- If the specified destination is invalid.public static Destination newInstance(String id, String name, byte type) throws AdminException
AdminException
public Hashtable getStatistic() throws ConnectException, AdminException
getStatistic
in interface DestinationMBean
ConnectException
AdminException
DestinationMBean.getStatistic()
public Hashtable getStatistics() throws ConnectException, AdminException
getStatistics
in interface DestinationMBean
ConnectException
AdminException
DestinationMBean.getStatistics()
public Hashtable getStatistics(String attributes) throws ConnectException, AdminException
a
- comma separated list of requested JMX attribute names.ConnectException
AdminException
DestinationMBean.getStatistics()
public void toReference(Reference ref) throws NamingException
toReference
in class AdministeredObject
NamingException
public void fromReference(Reference ref) throws NamingException
fromReference
in class AdministeredObject
NamingException
public void addInterceptors(String interceptors) throws ConnectException, AdminException
addInterceptors
in interface DestinationMBean
interceptors
- list of string className interceptor (separate with ",")ConnectException
- If the administration connection is closed or broken.AdminException
- If the request fails.public String getInterceptors() throws ConnectException, AdminException
getInterceptors
in interface DestinationMBean
ConnectException
- If the administration connection is closed or broken.AdminException
- If the request fails.public void removeInterceptors(String interceptors) throws ConnectException, AdminException
removeInterceptors
in interface DestinationMBean
interceptors
- list of string className interceptor (separate with ",")ConnectException
- If the administration connection is closed or broken.AdminException
- If the request fails.public void replaceInterceptor(String newInterceptor, String oldInterceptor) throws ConnectException, AdminException
newInterceptor
- the new className interceptor.oldInterceptor
- the old className interceptor.ConnectException
- If the administration connection is closed or broken.AdminException
- If the request fails.public void addInterceptor(String interceptor, Properties properties) throws ConnectException, AdminException
interceptor
- the className interceptorproperties
- the properties of this interceptorConnectException
- If the administration connection is closed or broken.AdminException
- If the request fails.public void replaceInterceptor(String newInterceptor, String oldInterceptor, Properties properties) throws ConnectException, AdminException
newInterceptor
- the new className interceptor.oldInterceptor
- the old className interceptor.properties
- the properties of the new interceptorConnectException
- If the administration connection is closed or broken.AdminException
- If the request fails.public AdminReply setProperties(Properties prop) throws ConnectException, AdminException
prop
- the properties to update.ConnectException
- If the administration connection is closed or broken.AdminException
- If the request fails.public void scale(int op, String param) throws ConnectException, AdminException
op
- scaling operation: scale up, scale down or balance.param
- parameter of the scaling operation.ConnectException
AdminException
Copyright © 2016 ScalAgent D.T.. All Rights Reserved.