Joram ${version}

org.objectweb.joram.client.jms
Class Destination

java.lang.Object
  extended byorg.objectweb.joram.client.jms.admin.AdministeredObject
      extended byorg.objectweb.joram.client.jms.Destination
All Implemented Interfaces:
javax.jms.Destination, DestinationMBean, javax.naming.Referenceable, java.io.Serializable, fr.dyade.aaa.jndi2.soap.SoapObjectItf
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.
 
Constructor Summary
  Destination()
           
protected Destination(java.lang.String name, java.lang.String type)
           
 
Method Summary
 void addReader(java.lang.String proxyId)
          used by MBean jmx
 void addWriter(java.lang.String proxyId)
          used by MBean jmx
 java.util.Hashtable code()
          Codes a Destination as a Hashtable for travelling through the SOAP protocol.
 void decode(java.util.Hashtable h)
           
 void delete()
          Admin 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, java.lang.String expectedType)
          Admin method creating or retrieving a destination with a given name on a given server, and returning its identifier.
 boolean equals(java.lang.Object obj)
          Returns true if the parameter object is a Joram destination wrapping the same agent identifier.
 java.lang.String getAdminName()
          Returns the admin name of the destination.
 DeadMQueue getDMQ()
          Monitoring method returning the dead message queue of this destination, null if not set.
 java.lang.String getName()
          Returns the name of the destination.
 java.util.List getReaderList()
          used by MBean jmx
 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.
 javax.naming.Reference getReference()
          Sets the naming reference of a destination.
 java.util.Hashtable getStatistic()
           
 java.lang.String getType()
           
 java.util.List getWriterList()
          used by MBean jmx
 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.
static boolean isAssignableTo(java.lang.String realType, java.lang.String resultingType)
           
 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.
static Destination newInstance(java.lang.String id, java.lang.String name, java.lang.String type)
           
 void removeReader(java.lang.String proxyId)
          used by MBean jmx
 void removeWriter(java.lang.String proxyId)
          used by MBean jmx
 void setDMQ(DeadMQueue dmq)
          Admin method setting or unsetting a dead message queue for this destination.
 void setFreelyReadable(boolean b)
          used by MBean
 void setFreelyWriteable(boolean b)
          used by MBean
 void setFreeReading()
          Admin method setting free reading access to this destination.
 void setFreeWriting()
          Admin method setting free writing access to this destination.
 void setReader(User user)
          Admin method setting a given user as a reader on this destination.
 void setWriter(User user)
          Admin method setting a given user as a writer on this destination.
 void unsetFreeReading()
          Admin method unsetting free reading access to this destination.
 void unsetFreeWriting()
          Admin method unsetting free writing access to this destination.
 void unsetReader(User user)
          Admin method unsetting a given user as a reader on this destination.
 void unsetWriter(User user)
          Admin method unsetting a given user as a writer on this destination.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

agentId

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


adminName

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

Constructor Detail

Destination

public Destination()

Destination

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

getName

public java.lang.String getName()
Returns the name of the destination.

Specified by:
getName in interface DestinationMBean

getAdminName

public final java.lang.String getAdminName()
Returns the admin name of the destination.

Specified by:
getAdminName in interface DestinationMBean

getType

public final java.lang.String getType()
Specified by:
getType in interface DestinationMBean

equals

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


isQueue

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

Specified by:
isQueue in interface DestinationMBean

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

getReference

public javax.naming.Reference getReference()
                                    throws javax.naming.NamingException
Sets the naming reference of a destination.

Specified by:
getReference in interface javax.naming.Referenceable
Overrides:
getReference in class AdministeredObject
Throws:
javax.naming.NamingException

doCreate

protected static void doCreate(int serverId,
                               java.lang.String name,
                               java.lang.String className,
                               java.util.Properties props,
                               Destination dest,
                               java.lang.String expectedType)
                        throws java.net.ConnectException,
                               AdminException
Admin 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 deployement fails server side.

Parameters:
serverId - The identifier of the server where deploying the destination.
name - The destination name.
className - Name of the MOM destination class.
Throws:
java.net.ConnectException - If the admin connection is closed or broken.
AdminException - If the request fails.

delete

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

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

setFreeReading

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

The request fails if this destination is deleted server side.

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

setFreeWriting

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

The request fails if this destination is deleted server side.

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

unsetFreeReading

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

The request fails if this destination is deleted server side.

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

unsetFreeWriting

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

The request fails if this destination is deleted server side.

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

setReader

public void setReader(User user)
               throws java.net.ConnectException,
                      AdminException
Admin 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 admin connection is closed or broken.
AdminException - If the request fails.

addReader

public void addReader(java.lang.String proxyId)
               throws java.net.ConnectException,
                      AdminException
used by MBean jmx

Specified by:
addReader in interface DestinationMBean
Throws:
java.net.ConnectException
AdminException

setWriter

public void setWriter(User user)
               throws java.net.ConnectException,
                      AdminException
Admin 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 admin connection is closed or broken.
AdminException - If the request fails.

addWriter

public void addWriter(java.lang.String proxyId)
               throws java.net.ConnectException,
                      AdminException
used by MBean jmx

Specified by:
addWriter in interface DestinationMBean
Throws:
java.net.ConnectException
AdminException

unsetReader

public void unsetReader(User user)
                 throws java.net.ConnectException,
                        AdminException
Admin 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 admin connection is closed or broken.
AdminException - If the request fails.

removeReader

public void removeReader(java.lang.String proxyId)
                  throws java.net.ConnectException,
                         AdminException
used by MBean jmx

Specified by:
removeReader in interface DestinationMBean
Throws:
java.net.ConnectException
AdminException

unsetWriter

public void unsetWriter(User user)
                 throws java.net.ConnectException,
                        AdminException
Admin 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 admin connection is closed or broken.
AdminException - If the request fails.

removeWriter

public void removeWriter(java.lang.String proxyId)
                  throws java.net.ConnectException,
                         AdminException
used by MBean jmx

Specified by:
removeWriter in interface DestinationMBean
Throws:
java.net.ConnectException
AdminException

setDMQ

public void setDMQ(DeadMQueue dmq)
            throws java.net.ConnectException,
                   AdminException
Admin method setting or unsetting a dead message queue for this destination.

The request fails if this destination is deleted server side.

Specified by:
setDMQ in interface DestinationMBean
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 admin connection is closed or broken.
AdminException - If the request fails.

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 admin connection is closed or broken.
AdminException - If the request fails.

getReaderList

public java.util.List getReaderList()
                             throws java.net.ConnectException,
                                    AdminException
used by MBean jmx

Specified by:
getReaderList in interface DestinationMBean
Throws:
java.net.ConnectException
AdminException

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 admin connection is closed or broken.
AdminException - If the request fails.

getWriterList

public java.util.List getWriterList()
                             throws java.net.ConnectException,
                                    AdminException
used by MBean jmx

Specified by:
getWriterList in interface DestinationMBean
Throws:
java.net.ConnectException
AdminException

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 admin connection is closed or broken.
AdminException - If the request fails.

setFreelyReadable

public void setFreelyReadable(boolean b)
                       throws java.net.ConnectException,
                              AdminException
used by MBean

Specified by:
setFreelyReadable in interface DestinationMBean
Throws:
java.net.ConnectException
AdminException

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 admin connection is closed or broken.
AdminException - If the request fails.

setFreelyWriteable

public void setFreelyWriteable(boolean b)
                        throws java.net.ConnectException,
                               AdminException
used by MBean

Specified by:
setFreelyWriteable in interface DestinationMBean
Throws:
java.net.ConnectException
AdminException

getDMQ

public DeadMQueue 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.

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

newInstance

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

isAssignableTo

public static boolean isAssignableTo(java.lang.String realType,
                                     java.lang.String resultingType)

getStatistic

public java.util.Hashtable getStatistic()
                                 throws java.net.ConnectException,
                                        AdminException
Specified by:
getStatistic in interface DestinationMBean
Throws:
java.net.ConnectException
AdminException

Joram ${version}

Copyright © 2005 Scalagent - All rights reserved