Class ClusterDestination
- java.lang.Object
-
- org.objectweb.joram.client.jms.admin.AdministeredObject
-
- org.objectweb.joram.client.jms.Destination
-
- org.objectweb.joram.client.jms.admin.ClusterDestination
-
- All Implemented Interfaces:
Serializable,Destination,Referenceable,DestinationMBean
- Direct Known Subclasses:
ClusterQueue,ClusterTopic
public class ClusterDestination extends Destination
A base class for clustered destinations.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Hashtable<String,Destination>clusterprivate static org.objectweb.util.monolog.api.Loggerloggerprivate static longserialVersionUIDdefine serialVersionUID for interoperability-
Fields inherited from class org.objectweb.joram.client.jms.Destination
ACQUISITION_QUEUE, ACQUISITION_TOPIC, adminName, agentId, ALIAS_QUEUE, CLUSTER_QUEUE, DEAD_MQUEUE, DISTRIBUTION_QUEUE, DISTRIBUTION_TOPIC, FTP_QUEUE, JMXBeanName, QUEUE, QUEUE_TYPE, SCHEDULER_QUEUE, TEMPORARY, TOPIC, TOPIC_TYPE
-
Fields inherited from class org.objectweb.joram.client.jms.admin.AdministeredObject
rand
-
-
Constructor Summary
Constructors Constructor Description ClusterDestination()Constructs an empty clustered destination.ClusterDestination(Hashtable<String,Destination> cluster)Constructs a cluster destination.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDestination(String location, Destination dest)Adds a destination to the cluster with the specifiedlocationkey.voidaddDestination(Destination dest)Adds a destination to the cluster.voidfromReference(Reference ref)Restores the administered object from a naming reference.Hashtable<String,Destination>getCluster()protected DestinationgetDestination()return the appropriate destination of clusterStringgetName()Returns the name of the destination.bytegetType()Returns the type of the destination: queue or topic, temporary or not.voidsetCluster(Hashtable<String,Destination> cluster)voidsetFreeReading()Administration method setting free reading access to this destination.voidsetFreeWriting()Administration method setting free writing access to this destination.voidsetReader(User user)Administration method setting a given user as a reader on this destination.voidsetWriter(User user)Administration method setting a given user as a writer on this destination.voidtoReference(Reference ref)Sets the naming reference of an administered object.-
Methods inherited from class org.objectweb.joram.client.jms.Destination
addInterceptor, addInterceptors, addReader, addWriter, check, checkId, delete, doCreate, equals, getAdminName, getDMQ, getDMQId, getInterceptors, getJMXBeanName, getReaderList, getReaders, getStatistic, getStatistics, getStatistics, getWrapper, getWriterList, getWriters, hashCode, isFreelyReadable, isFreelyWriteable, isQueue, isTopic, newInstance, registerMBean, removeInterceptors, removeReader, removeWriter, replaceInterceptor, replaceInterceptor, scale, setDMQ, setDMQId, setFreelyReadable, setFreelyWriteable, setProperties, setWrapper, toXml, unregisterMBean, unsetFreeReading, unsetFreeWriting, unsetReader, unsetWriter
-
Methods inherited from class org.objectweb.joram.client.jms.admin.AdministeredObject
getReference
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
define serialVersionUID for interoperability- See Also:
- Constant Field Values
-
logger
private static final org.objectweb.util.monolog.api.Logger logger
-
cluster
protected Hashtable<String,Destination> cluster
-
-
Constructor Detail
-
ClusterDestination
public ClusterDestination()
Constructs an empty clustered destination.
-
ClusterDestination
public ClusterDestination(Hashtable<String,Destination> cluster)
Constructs a cluster destination.- Parameters:
cluster- Hashtable of the cluster agent destination.
-
-
Method Detail
-
setCluster
public void setCluster(Hashtable<String,Destination> cluster)
-
getCluster
public Hashtable<String,Destination> getCluster()
-
addDestination
public void addDestination(Destination dest)
Adds a destination to the cluster. The object will be added with a key equals to the location property. Be careful, the object should be rebind after modification.- Parameters:
dest- the Destination
-
addDestination
public void addDestination(String location, Destination dest)
Adds a destination to the cluster with the specifiedlocationkey. By default, the location value is set to the String server#i, where i is the server id. of the destination. Be careful, the object should be rebind after modification.- Parameters:
location- the location keydest- the Destination
-
getDestination
protected Destination getDestination()
return the appropriate destination of cluster
-
getName
public String getName()
Returns the name of the destination.- Specified by:
getNamein interfaceDestinationMBean- Overrides:
getNamein classDestination- Returns:
- the internal name of the destination.
-
getType
public byte getType()
Returns the type of the destination: queue or topic, temporary or not.- Overrides:
getTypein classDestination
-
setReader
public void setReader(User user) throws ConnectException, AdminException
Description copied from class:DestinationAdministration method setting a given user as a reader on this destination.The request fails if this destination is deleted server side.
- Overrides:
setReaderin classDestination- Parameters:
user- User to be set as a reader.- Throws:
ConnectException- If the administration connection is closed or broken.AdminException- If the request fails.
-
setWriter
public void setWriter(User user) throws ConnectException, AdminException
Description copied from class:DestinationAdministration method setting a given user as a writer on this destination.The request fails if this destination is deleted server side.
- Overrides:
setWriterin classDestination- Parameters:
user- User to be set as a writer.- Throws:
ConnectException- If the administration connection is closed or broken.AdminException- If the request fails.
-
setFreeReading
public void setFreeReading() throws ConnectException, AdminExceptionDescription copied from class:DestinationAdministration method setting free reading access to this destination.The request fails if this destination is deleted server side.
- Overrides:
setFreeReadingin classDestination- Throws:
ConnectException- If the administration connection is closed or broken.AdminException- If the request fails.
-
setFreeWriting
public void setFreeWriting() throws ConnectException, AdminExceptionDescription copied from class:DestinationAdministration method setting free writing access to this destination.The request fails if this destination is deleted server side.
- Overrides:
setFreeWritingin classDestination- Throws:
ConnectException- If the administration connection is closed or broken.AdminException- If the request fails.
-
toReference
public void toReference(Reference ref) throws NamingException
Sets the naming reference of an administered object.- Overrides:
toReferencein classDestination- Throws:
NamingException
-
fromReference
public void fromReference(Reference ref) throws NamingException
Restores the administered object from a naming reference.- Overrides:
fromReferencein classDestination- Throws:
NamingException
-
-