Constructor and Description |
---|
AbstractTopic(TopicKey key) |
Modifier and Type | Method and Description |
---|---|
void |
addTopicListener(TopicListener topicListener)
Adds listener through that topic events will be published (by calling
Topic.publishEvent(TopicEvent) ). |
void |
checkSubscription(Session session)
Checks that the given session can be subscribed to this topic
|
TopicKey |
getKey()
Returns the key which this topic is associated with
|
MessageDataSerializer |
getMessageDataSerializer()
Returns the
MessageDataSerializer that is associated with this topic |
boolean |
isAllowSubtopics()
Returns true if this topic allow to use subtopics
|
abstract void |
publish(Object messageData)
Publish data to the subscribed clients
|
void |
publishEvent(TopicEvent event)
Publishes topic event to all subscribed TopicListeners
|
void |
removeTopicListener(TopicListener topicListener)
Removes topic listener
|
void |
setAllowSubtopics(boolean allowSubtopics)
Allow or disallow use of topics
|
void |
setMessageDataSerializer(MessageDataSerializer serializer)
Associated this topic with given
MessageDataSerializer |
public AbstractTopic(TopicKey key)
public MessageDataSerializer getMessageDataSerializer()
Topic
MessageDataSerializer
that is associated with this topicgetMessageDataSerializer
in interface Topic
public void setMessageDataSerializer(MessageDataSerializer serializer)
Topic
MessageDataSerializer
setMessageDataSerializer
in interface Topic
public boolean isAllowSubtopics()
public void setAllowSubtopics(boolean allowSubtopics)
public TopicKey getKey()
Topic
public void addTopicListener(TopicListener topicListener)
Topic
Topic.publishEvent(TopicEvent)
).addTopicListener
in interface Topic
public void removeTopicListener(TopicListener topicListener)
Topic
removeTopicListener
in interface Topic
public void checkSubscription(Session session) throws SubscriptionFailureException
Topic
checkSubscription
in interface Topic
SubscriptionFailureException
- when given session can't be subscribed to this topicpublic void publishEvent(TopicEvent event)
Topic
publishEvent
in interface Topic
public abstract void publish(Object messageData) throws MessageException
Topic
publish
in interface Topic
messageData
- data that will be serialized by MessageDataSerializerMessageException
Copyright © 2014 JBoss by Red Hat. All Rights Reserved.