Class Topic
- java.lang.Object
-
- org.objectweb.joram.client.jms.admin.AdministeredObject
-
- org.objectweb.joram.client.jms.Destination
-
- org.objectweb.joram.client.jms.Topic
-
- All Implemented Interfaces:
Serializable,Destination,Topic,Referenceable,DestinationMBean,TopicMBean
- Direct Known Subclasses:
TemporaryTopic
public class Topic extends Destination implements Topic, TopicMBean
Implements thejavax.jms.Topicinterface.This is a proxy object a client uses to specify the destination of messages it is sending and the source of messages it receives.
The Topic class is a factory for Joram's Topic destination through the create static methods, the Topic object provides Joram specific administration and monitoring methods.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private 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, logger, QUEUE, QUEUE_TYPE, SCHEDULER_QUEUE, TEMPORARY, TOPIC, TOPIC_TYPE, wrapper
-
Fields inherited from class org.objectweb.joram.client.jms.admin.AdministeredObject
rand
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddClusteredTopic(Topic addedTopic)Adds a topic into the cluster this topic belongs to.static Topiccreate()Admin method creating and deploying a topic on the local server.static Topiccreate(int serverId)Admin method creating and deploying a topic on a given server.static Topiccreate(int serverId, String name)Admin method creating and deploying (or retrieving) a topic on a given server with a given name.static Topiccreate(int serverId, String name, String className, Properties prop)Admin method creating and deploying (or retrieving) a topic on a given server.static Topiccreate(int serverId, String className, Properties prop)Admin method creating and deploying a topic on a given server.static Topiccreate(int serverId, Properties prop)Admin method creating and deploying a topic on a given server.static Topiccreate(String name)Admin method creating and deploying (or retrieving) a topic on the local server.static TopiccreateTopic(String agentId, String name)ListgetClusterFellows()Monitoring method returning the list describing the cluster this topic is part of.TopicgetHierarchicalFather()Monitoring method returning the hierarchical father of this topic, null if none.String[]getSubscriberIds()Monitoring method returning an array containing the ids of users that subscribes on this topic.intgetSubscriptions()Monitoring method returning the number of users that subscribes on this topic.StringgetTopicName()API method.voidremoveFromCluster()Removes this topic from the cluster it belongs to.voidsetParent(Topic parent)Creates a hierarchical relationship between this topic and its father topic.StringtoString()Returns a String image of the topic.voidunsetParent()Unsets the father of this topic.-
Methods inherited from class org.objectweb.joram.client.jms.Destination
addInterceptor, addInterceptors, addReader, addWriter, check, checkId, delete, doCreate, doRequest, equals, fromReference, getAdminName, getDMQ, getDMQId, getInterceptors, getJMXBeanName, getName, getReaderList, getReaders, getStatistic, getStatistics, getStatistics, getType, getWrapper, getWriterList, getWriters, hashCode, isFreelyReadable, isFreelyWriteable, isQueue, isTopic, newInstance, registerMBean, removeInterceptors, removeReader, removeWriter, replaceInterceptor, replaceInterceptor, scale, setDMQ, setDMQId, setFreelyReadable, setFreelyWriteable, setFreeReading, setFreeWriting, setProperties, setReader, setWrapper, setWriter, toReference, toXml, unregisterMBean, unsetFreeReading, unsetFreeWriting, unsetReader, unsetWriter
-
Methods inherited from class org.objectweb.joram.client.jms.admin.AdministeredObject
getReference
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.objectweb.joram.client.jms.DestinationMBean
addInterceptors, addReader, addWriter, delete, getAdminName, getDMQId, getInterceptors, getName, getReaderList, getStatistic, getStatistics, getWriterList, isFreelyReadable, isFreelyWriteable, isQueue, isTopic, removeInterceptors, removeReader, removeWriter, setDMQId, setFreelyReadable, setFreelyWriteable
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
define serialVersionUID for interoperability- See Also:
- Constant Field Values
-
-
Method Detail
-
toString
public String toString()
Returns a String image of the topic.
-
getTopicName
public String getTopicName() throws JMSException
API method. Gets the The Joram's internal unique identifier of this topic.- Specified by:
getTopicNamein interfaceTopic- Returns:
- The Joram's internal unique identifier.
- Throws:
JMSException- Actually never thrown.
-
create
public static Topic create(int serverId, String name, String className, Properties prop) throws ConnectException, AdminException
Admin method creating and deploying (or retrieving) a topic on a given server. First a destination with the specified name is searched on the given server, if it does not exist it is created. In any case, its provider-specific address is returned.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 topic.name- The name of the topic.className- The topic class name.prop- The topic properties.- Throws:
ConnectException- If the admin connection is closed or broken.AdminException- If the request fails.
-
create
public static Topic create(int serverId, String className, Properties prop) throws ConnectException, AdminException
Admin method creating and deploying a topic on a given server.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 topic.className- The topic class name.prop- The topic properties.- Throws:
ConnectException- If the admin connection is closed or broken.AdminException- If the request fails.
-
create
public static Topic create(int serverId, Properties prop) throws ConnectException, AdminException
Admin method creating and deploying a topic on a given server. It creates a Jorram's standard topic.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 topic.prop- The topic properties.- Throws:
ConnectException- If the admin connection is closed or broken.AdminException- If the request fails.
-
create
public static Topic create(int serverId, String name) throws ConnectException, AdminException
Admin method creating and deploying (or retrieving) a topic on a given server with a given name. First a destination with the specified name is searched on the given server, if it does not exist it is created. In any case, its provider-specific address is returned.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 topic.name- The topic name.- Throws:
ConnectException- If the admin connection is closed or broken.AdminException- If the request fails.
-
create
public static Topic create(String name) throws ConnectException, AdminException
Admin method creating and deploying (or retrieving) a topic on the local server. First a destination with the specified name is searched on the given server, if it does not exist it is created. In any case, its provider-specific address is returned.The request fails if the destination deployment fails server side.
Be careful this method use the static AdminModule connection.
- Parameters:
name- The topic name.- Throws:
ConnectException- If the admin connection is closed or broken.AdminException- If the request fails.
-
create
public static Topic create(int serverId) throws ConnectException, AdminException
Admin method creating and deploying a topic on a given server.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 topic.- Throws:
ConnectException- If the admin connection is closed or broken.AdminException- If the request fails.
-
create
public static Topic create() throws ConnectException, AdminException
Admin method creating and deploying a topic on the local server.The request fails if the destination deployment fails server side.
Be careful this method use the static AdminModule connection.
- Throws:
ConnectException- If the admin connection is closed or broken.AdminException- If the request fails.
-
getHierarchicalFather
public Topic getHierarchicalFather() throws ConnectException, AdminException
Monitoring method returning the hierarchical father of this topic, null if none.The request fails if the topic is deleted server side.
- Throws:
ConnectException- If the admin connection is closed or broken.AdminException- If the request fails.
-
getClusterFellows
public List getClusterFellows() throws ConnectException, AdminException
Monitoring method returning the list describing the cluster this topic is part of.The request fails if the topic is deleted server side.
- Throws:
ConnectException- If the admin connection is closed or broken.AdminException- If the request fails.
-
getSubscriptions
public int getSubscriptions() throws ConnectException, AdminExceptionMonitoring method returning the number of users that subscribes on this topic. If a client has many subscriptions it is only counted once.The request fails if the topic is deleted server side.
- Specified by:
getSubscriptionsin interfaceTopicMBean- Throws:
ConnectException- If the admin connection is closed or broken.AdminException- If the request fails.
-
getSubscriberIds
public String[] getSubscriberIds() throws AdminException, ConnectException
Description copied from interface:TopicMBeanMonitoring method returning an array containing the ids of users that subscribes on this topic. If a client has many subscriptions its ids appears once.- Specified by:
getSubscriberIdsin interfaceTopicMBean- Throws:
AdminExceptionConnectException
-
addClusteredTopic
public void addClusteredTopic(Topic addedTopic) throws ConnectException, AdminException
Adds a topic into the cluster this topic belongs to. If this topic doesn't belong to a cluster then a cluster is created by clustering this topic with the added topic.The request fails if one or both of the topics are deleted, or can't belong to a cluster.
- Parameters:
addedTopic- topic added to the cluster- Throws:
ConnectException- If the admin connection is closed or broken.AdminException- If the request fails.
-
removeFromCluster
public void removeFromCluster() throws ConnectException, AdminExceptionRemoves this topic from the cluster it belongs to.The request fails if the topic does not exist or is not part of any cluster.
- Throws:
ConnectException- If the admin connection is closed or broken.AdminException- If the request fails.
-
setParent
public void setParent(Topic parent) throws ConnectException, AdminException
Creates a hierarchical relationship between this topic and its father topic.The request fails if one of the topics does not exist or can't be part of a hierarchy.
- Parameters:
parent- the topic which will be parent. null to remove previous parent.- Throws:
ConnectException- If the admin connection is closed or broken.AdminException- If the request fails.
-
unsetParent
public void unsetParent() throws ConnectException, AdminExceptionUnsets the father of this topic.The request fails if the topic does not exist or is not part of any hierarchy.
- Throws:
ConnectException- If the admin connection is closed or broken.AdminException- If the request fails.
-
-