Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.codehaus.activemq.message
Class ActiveMQDestination

    java.lang.Object
      org.codehaus.activemq.jndi.JNDIBaseStorable
          org.codehaus.activemq.message.ActiveMQDestination

All Implemented Interfaces:
  java.lang.Comparable, Destination, JNDIStorableInterface, javax.naming.Referenceable, java.io.Serializable

Direct Known Subclasses:
  ActiveMQQueue, ActiveMQTopic

public abstract class ActiveMQDestination
extends JNDIBaseStorable
implements Destination, java.lang.Comparable, java.io.Serializable

A `Destination` object encapsulates a provider-specific address. The JMS API does not define a standard address syntax. Although a standard address syntax was considered, it was decided that the differences in address semantics between existing message-oriented middleware (MOM) products were too wide to bridge with a single syntax.

Since `Destination` is an administered object, it may contain provider-specific configuration information in addition to its address.

The JMS API also supports a client's use of provider-specific address names.

`Destination` objects support concurrent use.

A `Destination` object is a JMS administered object.

JMS administered objects are objects containing configuration information that are created by an administrator and later used by JMS clients. They make it practical to administer the JMS API in the enterprise.

Although the interfaces for administered objects do not explicitly depend on the Java Naming and Directory Interface (JNDI) API, the JMS API establishes the convention that JMS clients find administered objects by looking them up in a JNDI namespace.

An administrator can place an administered object anywhere in a namespace. The JMS API does not define a naming policy.

It is expected that JMS providers will provide the tools an administrator needs to create and configure administered objects in a JNDI namespace. JMS provider implementations of administered objects should implement the `javax.naming.Referenceable` and `java.io.Serializable` interfaces so that they can be stored in all JNDI naming contexts. In addition, it is recommended that these implementations follow the JavaBeansTM design patterns.

This strategy provides several benefits:

- It hides provider-specific details from JMS clients.
- It abstracts JMS administrative information into objects in the Java programming language ("Java objects") that are easily organized and administered from a common management console.
- Since there will be JNDI providers for all popular naming services, JMS providers can deliver one implementation of administered objects that will run everywhere.

An administered object should not hold on to any remote resources. Its lookup should not use remote resources other than those used by the JNDI API itself.

Clients should think of administered objects as local Java objects. Looking them up should not have any hidden side effects or use surprising amounts of local resources.

See Also:
  Serialized Form

Field Summary
`static int` | `ACTIVEMQ_QUEUE` Queue Destination object
`static int` | `ACTIVEMQ_TEMPORARY_QUEUE` Temporary Queue Destination object
`static int` | `ACTIVEMQ_TEMPORARY_TOPIC` Temporary Topic Destination object
`static int` | `ACTIVEMQ_TOPIC` Topic Destination object

Constructor Summary
`protected` | `ActiveMQDestination()` The Default Constructor
`protected` | `ActiveMQDestination(java.lang.String name)` Construct the ActiveMQDestination with a defined physical name;

Method Summary
`protected void` | `buildFromProperties(java.util.Properties props)` Set the properties that will represent the instance in JNDI
`int` | `compareTo(ActiveMQDestination that)` Lets sort by name first then lets sort topics greater than queues
`int` | `compareTo(java.lang.Object o)`
`static java.lang.String` | `createTemporaryName(java.lang.String clientId)` Create a temporary name from the clientId
`boolean` | `equals(java.lang.Object obj)` if the object passed in is equivalent, return true
`static java.lang.String` | `getClientId(ActiveMQDestination destination)` From a temporary destination find the clientId of the Connection that created it
`abstract int` | `getDestinationType()`
`java.lang.String` | `getPhysicalName()`
`int` | `hashCode()`
`static java.lang.String` | `inspect(Destination destination)` A helper method to return a descriptive string for the topic or queue
`boolean` | `isQueue()` Returns true if a Queue Destination
`boolean` | `isTemporary()` Returns true if a temporary Destination
`boolean` | `isTopic()` Returns true if a Topic Destination
`boolean` | `isWildcard()`
`protected void` | `populateProperties(java.util.Properties props)` Initialize the instance from properties stored in JNDI
`static ActiveMQDestination` | `readFromStream(java.io.DataInput dataIn)` Read an ActiveMQDestination from a Stream
`void` | `setPhysicalName(java.lang.String newPhysicalName)`
`java.lang.String` | `toString()`
`static ActiveMQDestination` | `transformDestination(Destination destination)`
`static void` | `writeToStream(ActiveMQDestination destination, java.io.DataOutput dataOut)` Write an ActiveMQDestination to a Stream

Methods inherited from class org.codehaus.activemq.jndi.JNDIBaseStorable
`getProperties, getReference, setProperties`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Field Detail

### ACTIVEMQ_TOPIC

    public static final int ACTIVEMQ_TOPIC

  Topic Destination object

  See Also:
    Constant Field Values

### ACTIVEMQ_TEMPORARY_TOPIC

    public static final int ACTIVEMQ_TEMPORARY_TOPIC

  Temporary Topic Destination object

  See Also:
    Constant Field Values

### ACTIVEMQ_QUEUE

    public static final int ACTIVEMQ_QUEUE

  Queue Destination object

  See Also:
    Constant Field Values

### ACTIVEMQ_TEMPORARY_QUEUE

    public static final int ACTIVEMQ_TEMPORARY_QUEUE

  Temporary Queue Destination object

  See Also:
    Constant Field Values

Constructor Detail

### ActiveMQDestination

    protected ActiveMQDestination()

  The Default Constructor

### ActiveMQDestination

    protected ActiveMQDestination(java.lang.String name)

  Construct the ActiveMQDestination with a defined physical name;

Parameters:
  `name` -

Method Detail

### inspect

    public static java.lang.String inspect(Destination destination)

  A helper method to return a descriptive string for the topic or queue

  Returns:
    a descriptive string for this queue or topic

### compareTo

    public int compareTo(java.lang.Object o)

  Specified by:
    `compareTo` in interface `java.lang.Comparable`
  Parameters:
    `o` - object to compare
  Returns:
    1 if this > o else 0 if they are equal or -1 if this < o

### compareTo

    public int compareTo(ActiveMQDestination that)

  Lets sort by name first then lets sort topics greater than queues

  Parameters:
    `that` - another destination to compare against
  Returns:
    1 if this > that else 0 if they are equal or -1 if this < that

### getDestinationType

    public abstract int getDestinationType()

  Returns:
    Returns the Destination type

### getPhysicalName

    public java.lang.String getPhysicalName()

  Returns:
    Returns the physicalName.

### setPhysicalName

    public void setPhysicalName(java.lang.String newPhysicalName)

  Parameters:
    `newPhysicalName` - The physicalName to set.

### buildFromProperties

    protected void buildFromProperties(java.util.Properties props)

  Set the properties that will represent the instance in JNDI

  Specified by:
    `buildFromProperties` in class `JNDIBaseStorable`
  Parameters:
    `props` -

### populateProperties

    protected void populateProperties(java.util.Properties props)

  Initialize the instance from properties stored in JNDI

  Specified by:
    `populateProperties` in class `JNDIBaseStorable`
  Parameters:
    `props` -

### isTemporary

    public boolean isTemporary()

  Returns true if a temporary Destination

  Returns:
    true/false

### isTopic

    public boolean isTopic()

  Returns true if a Topic Destination

  Returns:
    true/false

### isQueue

    public boolean isQueue()

  Returns true if a Queue Destination

  Returns:
    true/false

### toString

    public java.lang.String toString()

  Returns:
    string representation of this instance

### hashCode

    public int hashCode()

  Returns:
    hashCode for this instance

### equals

    public boolean equals(java.lang.Object obj)

  if the object passed in is equivalent, return true

  Parameters:
    `obj` - the object to compare
  Returns:
    true if this instance and obj are equivalent

### writeToStream

    public static void writeToStream(ActiveMQDestination destination,
                                     java.io.DataOutput dataOut)
                              throws java.io.IOException

  Write an ActiveMQDestination to a Stream

  Parameters:
    `destination` -
    `dataOut` -
  Throws:
    `java.io.IOException`

### readFromStream

    public static ActiveMQDestination readFromStream(java.io.DataInput dataIn)
                                              throws java.io.IOException

  Read an ActiveMQDestination from a Stream

  Parameters:
    `dataIn` -
  Returns:
    the ActiveMQDestination
  Throws:
    `java.io.IOException`

### createTemporaryName

    public static java.lang.String createTemporaryName(java.lang.String clientId)

  Create a temporary name from the clientId

  Parameters:
    `clientId` -
  Returns:

### getClientId

    public static java.lang.String getClientId(ActiveMQDestination destination)

  From a temporary destination find the clientId of the Connection that created it

  Parameters:
    `destination` -
  Returns:
    the clientId or null if not a temporary destination

### isWildcard

    public boolean isWildcard()

  Returns:
    true if the destination matches multiple possible destinations

### transformDestination

    public static ActiveMQDestination transformDestination(Destination destination)
                                                    throws JMSException

  Parameters:
    `destination` -
  Returns:
    @throws JMSException
  Throws:
    `JMSException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004 Protique, Ltd.. All Rights Reserved.