Joram 5.2.6

org.objectweb.joram.client.jms
Class Destination

java.lang.Object
  extended by org.objectweb.joram.client.jms.admin.AdministeredObject
      extended by org.objectweb.joram.client.jms.Destination
All Implemented Interfaces:
fr.dyade.aaa.jndi2.soap.SoapObjectItf, java.io.Serializable, javax.jms.Destination, javax.naming.Referenceable, DestinationMBean
Direct Known Subclasses:
ClusterDestination, Queue, Topic

public abstract class Destination
extends AdministeredObject
implements javax.jms.Destination, DestinationMBean

Implements the javax.jms.Destination interface and provides JORAM specific administration and monitoring methods.

See Also:
Serialized Form

Field Summary
protected  java.lang.String adminName
          Name given by the administrator.
protected  java.lang.String agentId
          Identifier of the agent destination.
static java.lang.String BRIDGE_QUEUE
           
static java.lang.String BRIDGE_TOPIC
           
static java.lang.String CLUSTER_QUEUE
           
static java.lang.String COLLECTOR_QUEUE
           
static java.lang.String COLLECTOR_TOPIC
           
static java.lang.String DEAD_MQUEUE
           
protected  java.lang.String JMXBeanName
           
static org.objectweb.util.monolog.api.Logger logger
           
static java.lang.String MAIL_QUEUE
           
static java.lang.String MAIL_TOPIC
           
static java.lang.String QUEUE
           
static byte QUEUE_TYPE
          Constant defining the type of a queue destination.
static java.lang.String SCHEDULER_QUEUE
           
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 java.lang.String TOPIC
           
static byte TOPIC_TYPE
          Constant defining the type of a topic destination.
protected  byte type
          Type of the destination: Queue or Topic, Temporary or not.
 
Constructor Summary
  Destination()
           
protected Destination(byte type)
           
protected Destination(java.lang.String id, byte type)
           
 
Method Summary
 void addReader(java.lang.String proxyId)
          Administration method setting a given user as a reader on this destination.
 void addWriter(java.lang.String proxyId)
          Administration method setting a given user as a writer on this destination.
 void check()
          Check the destination identifier.
static void checkId(java.lang.String id)
          Check the specified destination identifier.
 java.util.Hashtable code()
          Codes a Destination as a Hashtable for travelling through the SOAP protocol.
 void decode(java.util.Hashtable h)
           
 void delete()
          Administration method removing this destination from the platform.
protected static void doCreate(int serverId, java.lang.String name, java.lang.String className, java.util.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.
 AdminReply doRequest(AdminRequest request)
          Method actually sending an AdminRequest instance to the platform and getting an AdminReply instance.
 boolean equals(java.lang.Object obj)
          Returns true if the parameter object is a Joram destination wrapping the same agent identifier.
 void fromReference(javax.naming.Reference ref)
          Restores the administered object from a naming reference.
 java.lang.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.
 java.lang.String getDMQId()
          Monitoring method returning the dead message queue id of this destination, null if not set.
static java.lang.String getJMXBeanName(java.lang.String base, Destination dest)
           
 java.lang.String getName()
          Returns the internal name of the destination.
 java.util.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.
 java.util.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.
 java.util.Hashtable getStatistic()
          Deprecated.  
 java.util.Hashtable getStatistics()
          Return a set of statistic values from the destination.
protected  byte getType()
          Returns the type of the destination: queue or topic, temporary or not.
protected  AdminWrapper getWrapper()
          Returns the administration wrapper to use.
 java.util.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.
 java.util.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.
 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(java.lang.String id, java.lang.String name, byte type)
           
 java.lang.String registerMBean(java.lang.String base)
           
 void removeReader(java.lang.String proxyId)
          Administration method unsetting a given user as a reader on this destination.
 void removeWriter(java.lang.String proxyId)
          Administration method unsetting a given user as a writer on this destination.
 void setDMQ(Queue dmq)
          Administration method setting or unsetting a dead message queue for this destination.
 void setDMQId(java.lang.String dmqId)
          Administration method setting or unsetting a dead message queue for this destination.
 void setFreelyReadable(boolean b)
          Administration method (un)setting free reading access to this destination.
 void setFreelyWriteable(boolean b)
          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.
 void setReader(User user)
          Administration method setting a given user as a reader on this destination.
 void setWrapper(AdminWrapper 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(javax.naming.Reference ref)
          Sets the naming reference of a connection factory.
 java.lang.String toXml(int indent, int serverId)
          Format the destination properties in a XML format
 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.
 
Methods inherited from class org.objectweb.joram.client.jms.admin.AdministeredObject
getReference
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

public static org.objectweb.util.monolog.api.Logger logger

agentId

protected java.lang.String agentId
Identifier of the agent destination.


adminName

protected java.lang.String adminName
Name given by the administrator.


TOPIC_TYPE

public static final byte TOPIC_TYPE
Constant defining the type of a topic destination.

See Also:
getType(), DestinationConstants.TOPIC_TYPE, Constant Field Values

QUEUE_TYPE

public static final byte QUEUE_TYPE
Constant defining the type of a queue destination.

See Also:
getType(), DestinationConstants.QUEUE_TYPE, Constant Field Values

TEMPORARY

public static final 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).

See Also:
getType(), DestinationConstants.TEMPORARY, Constant Field Values

type

protected byte type
Type of the destination: Queue or Topic, Temporary or not.

See Also:
getType()

QUEUE

public static final java.lang.String QUEUE
See Also:
Constant Field Values

TOPIC

public static final java.lang.String TOPIC
See Also:
Constant Field Values

DEAD_MQUEUE

public static final java.lang.String DEAD_MQUEUE
See Also:
Constant Field Values

CLUSTER_QUEUE

public static final java.lang.String CLUSTER_QUEUE
See Also:
Constant Field Values

BRIDGE_QUEUE

public static final java.lang.String BRIDGE_QUEUE
See Also:
Constant Field Values

BRIDGE_TOPIC

public static final java.lang.String BRIDGE_TOPIC
See Also:
Constant Field Values

MAIL_QUEUE

public static final java.lang.String MAIL_QUEUE
See Also:
Constant Field Values

MAIL_TOPIC

public static final java.lang.String MAIL_TOPIC
See Also:
Constant Field Values

SCHEDULER_QUEUE

public static final java.lang.String SCHEDULER_QUEUE
See Also:
Constant Field Values

COLLECTOR_QUEUE

public static final java.lang.String COLLECTOR_QUEUE
See Also:
Constant Field Values

COLLECTOR_TOPIC

public static final java.lang.String COLLECTOR_TOPIC
See Also:
Constant Field Values

JMXBeanName

protected transient java.lang.String JMXBeanName
Constructor Detail

Destination

public Destination()

Destination

protected Destination(byte type)

Destination

protected Destination(java.lang.String id,
                      byte type)
Method Detail

getName

public java.lang.String getName()
Returns the internal name of the destination. This unique name is chosen internally by the MOM.

Specified by:
getName in interface DestinationMBean
Returns:
the internal name of the destination.

getAdminName

public final java.lang.String getAdminName()
Returns the symbolic administration name of the destination. This symbolic name is given by the user at creation.

Specified by:
getAdminName in interface DestinationMBean
Returns:
the symbolic name of the destination if any.

getType

protected final byte getType()
Returns the type of the destination: queue or topic, temporary or not.


check

public void check()
           throws javax.jms.InvalidDestinationException
Check the destination identifier.

Throws:
javax.jms.InvalidDestinationException - if the destination identifier is invalid.

checkId

public static void checkId(java.lang.String id)
                    throws javax.jms.InvalidDestinationException
Check the specified destination identifier.

Throws:
javax.jms.InvalidDestinationException - if an invalid destination identifier is specified.

equals

public boolean equals(java.lang.Object obj)
Returns true if the parameter object is a Joram destination wrapping the same agent identifier.

Overrides:
equals in class java.lang.Object

getWrapper

protected final AdminWrapper getWrapper()
                                 throws java.net.ConnectException
Returns the administration wrapper to use.

Returns:
The wrapper to use.
Throws:
java.net.ConnectException - if no wrapper is defined.

setWrapper

public void setWrapper(AdminWrapper wrapper)
Sets the administration wrapper to use. If not set the AdminModule static connection is used by default.

Parameters:
wrapper - The wrapper to use or null to unset.

doRequest

public final AdminReply doRequest(AdminRequest request)
                           throws AdminException,
                                  java.net.ConnectException
Method actually sending an AdminRequest instance to the platform and getting an AdminReply instance.

Parameters:
request - the administration request to send
Returns:
the reply message
Throws:
java.net.ConnectException - If the connection to the platform fails.
AdminException - If the platform's reply is invalid, or if the request failed.

toXml

public java.lang.String toXml(int indent,
                              int serverId)
                       throws java.net.ConnectException,
                              AdminException
Format the destination properties in a XML format

Parameters:
indent - use this indent for prefixing XML representation.
serverId - server id hosting the destination object
Returns:
returns a XML view of the queue (administration format)
Throws:
java.net.ConnectException - if the server is unreachable
AdminException - if an error occurs

isQueue

public boolean isQueue()
Returns true if the destination is a queue.

Specified by:
isQueue in interface DestinationMBean

isTopic

public boolean isTopic()
Returns true if the destination is a topic.

Specified by:
isTopic in interface DestinationMBean

doCreate

protected static void doCreate(int serverId,
                               java.lang.String name,
                               java.lang.String className,
                               java.util.Properties props,
                               Destination dest,
                               byte type)
                        throws java.net.ConnectException,
                               AdminException
Administration method creating or retrieving a destination with a given name on a given server, and returning its identifier.

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.

Parameters:
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.
Throws:
java.net.ConnectException - If the administration connection is closed or broken.
AdminException - If the request fails.

delete

public void delete()
            throws java.net.ConnectException,
                   AdminException,
                   javax.jms.JMSException
Administration method removing this destination from the platform.

Specified by:
delete in interface DestinationMBean
Throws:
AdminException - Never thrown.
java.net.ConnectException - If the administration connection is closed or broken.
javax.jms.JMSException - Never thrown.

getJMXBeanName

public static java.lang.String getJMXBeanName(java.lang.String base,
                                              Destination dest)

registerMBean

public java.lang.String registerMBean(java.lang.String base)

unregisterMBean

public void unregisterMBean()

setFreeReading

public void setFreeReading()
                    throws java.net.ConnectException,
                           AdminException
Administration method setting free reading access to this destination.

The request fails if this destination is deleted server side.

Throws:
java.net.ConnectException - If the administration connection is closed or broken.
AdminException - If the request fails.

setFreeWriting

public void setFreeWriting()
                    throws java.net.ConnectException,
                           AdminException
Administration method setting free writing access to this destination.

The request fails if this destination is deleted server side.

Throws:
java.net.ConnectException - If the administration connection is closed or broken.
AdminException - If the request fails.

unsetFreeReading

public void unsetFreeReading()
                      throws java.net.ConnectException,
                             AdminException
Administration method unsetting free reading access to this destination.

The request fails if this destination is deleted server side.

Throws:
java.net.ConnectException - If the administration connection is closed or broken.
AdminException - If the request fails.

unsetFreeWriting

public void unsetFreeWriting()
                      throws java.net.ConnectException,
                             AdminException
Administration method unsetting free writing access to this destination.

The request fails if this destination is deleted server side.

Throws:
java.net.ConnectException - If the administration connection is closed or broken.
AdminException - If the request fails.

setReader

public void setReader(User user)
               throws java.net.ConnectException,
                      AdminException
Administration method setting a given user as a reader on this destination.

The request fails if this destination is deleted server side.

Parameters:
user - User to be set as a reader.
Throws:
java.net.ConnectException - If the administration connection is closed or broken.
AdminException - If the request fails.

addReader

public void addReader(java.lang.String proxyId)
               throws java.net.ConnectException,
                      AdminException
Administration method setting a given user as a reader on this destination.

This method should be only used by the JMX MBean.

Specified by:
addReader in interface DestinationMBean
Parameters:
proxyId - The unique identification of the user's proxy.
Throws:
java.net.ConnectException - If the administration connection is closed or broken.
AdminException - If the request fails.
See Also:
DestinationMBean.addReader(java.lang.String)

setWriter

public void setWriter(User user)
               throws java.net.ConnectException,
                      AdminException
Administration method setting a given user as a writer on this destination.

The request fails if this destination is deleted server side.

Parameters:
user - User to be set as a writer.
Throws:
java.net.ConnectException - If the administration connection is closed or broken.
AdminException - If the request fails.

addWriter

public void addWriter(java.lang.String proxyId)
               throws java.net.ConnectException,
                      AdminException
Administration method setting a given user as a writer on this destination.

This method should be only used by the JMX MBean.

Specified by:
addWriter in interface DestinationMBean
Parameters:
proxyId - The unique identification of the user's proxy.
Throws:
java.net.ConnectException - If the administration connection is closed or broken.
AdminException - If the request fails.
See Also:
DestinationMBean.addWriter(java.lang.String)

unsetReader

public void unsetReader(User user)
                 throws java.net.ConnectException,
                        AdminException
Administration method unsetting a given user as a reader on this destination.

The request fails if this destination is deleted server side.

Parameters:
user - Reader to be unset.
Throws:
java.net.ConnectException - If the administration connection is closed or broken.
AdminException - If the request fails.

removeReader

public void removeReader(java.lang.String proxyId)
                  throws java.net.ConnectException,
                         AdminException
Administration method unsetting a given user as a reader on this destination.

This method should be only used by the JMX MBean.

Specified by:
removeReader in interface DestinationMBean
Parameters:
proxyId - The unique identification of the user's proxy.
Throws:
java.net.ConnectException - If the administration connection is closed or broken.
AdminException - If the request fails.
See Also:
DestinationMBean.removeReader(java.lang.String)

unsetWriter

public void unsetWriter(User user)
                 throws java.net.ConnectException,
                        AdminException
Administration method unsetting a given user as a writer on this destination.

The request fails if this destination is deleted server side.

Parameters:
user - Writer to be unset.
Throws:
java.net.ConnectException - If the administration connection is closed or broken.
AdminException - If the request fails.

removeWriter

public void removeWriter(java.lang.String proxyId)
                  throws java.net.ConnectException,
                         AdminException
Administration method unsetting a given user as a writer on this destination.

This method should be only used by the JMX MBean.

Specified by:
removeWriter in interface DestinationMBean
Parameters:
proxyId - The unique identification of the user's proxy.
Throws:
java.net.ConnectException - If the administration connection is closed or broken.
AdminException - If the request fails.
See Also:
DestinationMBean.removeWriter(java.lang.String)

getReaders

public java.util.List getReaders()
                          throws java.net.ConnectException,
                                 AdminException
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.

The request fails if the destination is deleted server side.

Throws:
java.net.ConnectException - If the administration connection is closed or broken.
AdminException - If the request fails.

getReaderList

public java.util.List getReaderList()
                             throws java.net.ConnectException,
                                    AdminException
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.

This method should be only used by the JMX MBean.

Specified by:
getReaderList in interface DestinationMBean
Throws:
java.net.ConnectException - If the administration connection is closed or broken.
AdminException - If the request fails.
See Also:
DestinationMBean.getReaderList()

getWriters

public java.util.List getWriters()
                          throws java.net.ConnectException,
                                 AdminException
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.

The request fails if the destination is deleted server side.

Throws:
java.net.ConnectException - If the administration connection is closed or broken.
AdminException - If the request fails.

getWriterList

public java.util.List getWriterList()
                             throws java.net.ConnectException,
                                    AdminException
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.

This method should be only used by the JMX MBean.

Specified by:
getWriterList in interface DestinationMBean
Throws:
java.net.ConnectException - If the administration connection is closed or broken.
AdminException - If the request fails.
See Also:
DestinationMBean.getWriterList()

isFreelyReadable

public boolean isFreelyReadable()
                         throws java.net.ConnectException,
                                AdminException
Monitoring method returning true if this destination provides free READ access.

The request fails if the destination is deleted server side.

Specified by:
isFreelyReadable in interface DestinationMBean
Throws:
java.net.ConnectException - If the administration connection is closed or broken.
AdminException - If the request fails.

setFreelyReadable

public void setFreelyReadable(boolean b)
                       throws java.net.ConnectException,
                              AdminException
Administration method (un)setting free reading access to this destination.

This method should be only used by the JMX MBean.

Specified by:
setFreelyReadable in interface DestinationMBean
Parameters:
b - if true set the free reading access else disable.
Throws:
java.net.ConnectException - If the administration connection is closed or broken.
AdminException - If the request fails.
See Also:
DestinationMBean.setFreelyReadable(boolean)

isFreelyWriteable

public boolean isFreelyWriteable()
                          throws java.net.ConnectException,
                                 AdminException
Monitoring method returning true if this destination provides free WRITE access.

The request fails if the destination is deleted server side.

Specified by:
isFreelyWriteable in interface DestinationMBean
Throws:
java.net.ConnectException - If the administration connection is closed or broken.
AdminException - If the request fails.

setFreelyWriteable

public void setFreelyWriteable(boolean b)
                        throws java.net.ConnectException,
                               AdminException
Administration method (un)setting free writing access to this destination.

This method should be only used by the JMX MBean.

Specified by:
setFreelyWriteable in interface DestinationMBean
Parameters:
b - if true set the free writing access else disable.
Throws:
java.net.ConnectException - If the administration connection is closed or broken.
AdminException - If the request fails.
See Also:
DestinationMBean.setFreelyWriteable(boolean)

getDMQ

public Queue getDMQ()
             throws java.net.ConnectException,
                    AdminException
Monitoring method returning the dead message queue of this destination, null if not set.

The request fails if the destination is deleted server side.

Throws:
java.net.ConnectException - If the administration connection is closed or broken.
AdminException - If the request fails.

setDMQ

public void setDMQ(Queue dmq)
            throws java.net.ConnectException,
                   AdminException,
                   javax.jms.InvalidDestinationException
Administration method setting or unsetting a dead message queue for this destination.

The request fails if this destination is deleted server side.

Parameters:
dmq - The dead message queue to be set (null for unsetting current DMQ).
Throws:
java.lang.IllegalArgumentException - If the DMQ is not a valid JORAM destination.
java.net.ConnectException - If the administration connection is closed or broken.
AdminException - If the request fails.
javax.jms.InvalidDestinationException - If the specified destination is invalid.

getDMQId

public java.lang.String getDMQId()
                          throws java.net.ConnectException,
                                 AdminException
Monitoring method returning the dead message queue id of this destination, null if not set.

The request fails if the destination is deleted server side.

Specified by:
getDMQId in interface DestinationMBean
Throws:
java.net.ConnectException - If the administration connection is closed or broken.
AdminException - If the request fails.

setDMQId

public void setDMQId(java.lang.String dmqId)
              throws java.net.ConnectException,
                     AdminException,
                     javax.jms.InvalidDestinationException
Administration method setting or unsetting a dead message queue for this destination.

The request fails if this destination is deleted server side.

Specified by:
setDMQId in interface DestinationMBean
Parameters:
dmqId - The dead message queue Id to be set (null for unsetting current DMQ).
Throws:
java.lang.IllegalArgumentException - If the DMQ is not a valid JORAM destination.
java.net.ConnectException - If the administration connection is closed or broken.
AdminException - If the request fails.
javax.jms.InvalidDestinationException - If the specified destination is invalid.

newInstance

public static Destination newInstance(java.lang.String id,
                                      java.lang.String name,
                                      byte type)
                               throws AdminException
Throws:
AdminException

getStatistic

public java.util.Hashtable getStatistic()
                                 throws java.net.ConnectException,
                                        AdminException
Deprecated. 

Return a set of statistic values from the destination.

Specified by:
getStatistic in interface DestinationMBean
Throws:
java.net.ConnectException
AdminException
See Also:
DestinationMBean.getStatistic()

getStatistics

public java.util.Hashtable getStatistics()
                                  throws java.net.ConnectException,
                                         AdminException
Return a set of statistic values from the destination.

Specified by:
getStatistics in interface DestinationMBean
Throws:
java.net.ConnectException
AdminException
See Also:
DestinationMBean.getStatistics()

toReference

public void toReference(javax.naming.Reference ref)
                 throws javax.naming.NamingException
Sets the naming reference of a connection factory.

Specified by:
toReference in class AdministeredObject
Throws:
javax.naming.NamingException

fromReference

public void fromReference(javax.naming.Reference ref)
                   throws javax.naming.NamingException
Restores the administered object from a naming reference.

Specified by:
fromReference in class AdministeredObject
Throws:
javax.naming.NamingException

code

public java.util.Hashtable code()
Codes a Destination as a Hashtable for travelling through the SOAP protocol.

Specified by:
code in interface fr.dyade.aaa.jndi2.soap.SoapObjectItf

decode

public void decode(java.util.Hashtable h)
Specified by:
decode in interface fr.dyade.aaa.jndi2.soap.SoapObjectItf

Joram 5.2.6

Copyright © 2000 - 2009 Scalagent D.T. - All rights reserved