Class Destination

  • All Implemented Interfaces:
    Serializable, Destination, Referenceable, DestinationMBean
    Direct Known Subclasses:
    ClusterDestination, Queue, Topic

    public abstract class Destination
    extends AdministeredObject
    implements Destination, DestinationMBean
    Implements the 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:

    • Queue: each messages is read only by a single client.
    • Topic: All clients that have previously subscribed to this topic are notified of the corresponding message.
    A destination allows clients to perform operations according to their access rights. A client set as a READER will be able to request messages from the destination (either as a subscriber to a topic, or as a receiver or browser on a queue). A client set as a WRITER will be able to send messages to the destination.

    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.

    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field 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.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method 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) org.objectweb.joram.shared.admin.AdminReply doRequest​(org.objectweb.joram.shared.admin.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.
      org.objectweb.joram.shared.admin.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.
    • Field Detail

      • serialVersionUID

        private static final long serialVersionUID
        Define serialVersionUID for interoperability.
        See Also:
        Constant Field Values
      • logger

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

        protected String agentId
        Identifier of the agent destination. Be careful when using directly this attribute, it is null in clustered destination even the getDestination method is called.
      • 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

        private byte type
        Type of the destination: Queue or Topic, Temporary or not.
        See Also:
        getType()
      • adminName

        protected String adminName
        Symbolic name given by the administrator.
      • wrapper

        AdminItf wrapper
        Administration wrapper used to perform administration stuff.

        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.

      • QUEUE

        public static final String QUEUE
        Constant defining the implementation class for a classic Queue.
        See Also:
        Constant Field Values
      • TOPIC

        public static final String TOPIC
        Constant defining the implementation class for a classic Topic.
        See Also:
        Constant Field Values
      • DEAD_MQUEUE

        public static final String DEAD_MQUEUE
        Deprecated.
        Since Joram 5.2.2 the DeadMQueue is a simple Queue.
        Constant defining the implementation class for a Dead Message Queue.
        See Also:
        Constant Field Values
      • CLUSTER_QUEUE

        public static final String CLUSTER_QUEUE
        Constant defining the implementation class for a clustered Queue.
        See Also:
        Constant Field Values
      • SCHEDULER_QUEUE

        public static final String SCHEDULER_QUEUE
        Constant defining the implementation class for a scheduled Queue.
        See Also:
        Constant Field Values
      • ACQUISITION_QUEUE

        public static final String ACQUISITION_QUEUE
        Constant defining the implementation class for a Queue allowing to collect data from external sources. The nature of data collector is configurable through properties.
        See Also:
        Constant Field Values
      • DISTRIBUTION_QUEUE

        public static final String DISTRIBUTION_QUEUE
        Constant defining the implementation class for a Queue allowing to forward data to external targets. The nature of data forwarder is configurable through properties.
        See Also:
        Constant Field Values
      • ACQUISITION_TOPIC

        public static final String ACQUISITION_TOPIC
        Constant defining the implementation class for a Topic allowing to collect data from external sources. The nature of data collector is configurable through properties.
        See Also:
        Constant Field Values
      • DISTRIBUTION_TOPIC

        public static final String DISTRIBUTION_TOPIC
        Constant defining the implementation class for a Queue allowing to forward data to external targets. The nature of data forwarder is configurable through properties.
        See Also:
        Constant Field Values
      • FTP_QUEUE

        public static final String FTP_QUEUE
        Constant defining the implementation class for a Queue allowing to forward data with Ftp. The nature of data forwarder is configurable through properties.
        See Also:
        Constant Field Values
      • JMXBeanName

        protected transient String JMXBeanName
    • Constructor Detail

      • Destination

        public Destination()
      • Destination

        protected Destination​(byte type)
      • Destination

        protected Destination​(String id,
                              byte type)