public interface Topic
Topic encapsulates particular endpoint for sending/receiving messages.
It is associated with TopicKey and in current implementation several Topic instances can be associated with the particular JMS Topic.
Topic holds collection of TopicListener and one MessageDataSerializer.
Modifier and Type | Method and Description |
---|---|
void |
addTopicListener(TopicListener topicListener)
Adds listener through that topic events will be published (by calling
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 |
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 |
setMessageDataSerializer(MessageDataSerializer serializer)
Associated this topic with given
MessageDataSerializer |
TopicKey getKey()
MessageDataSerializer getMessageDataSerializer()
MessageDataSerializer
that is associated with this topicvoid setMessageDataSerializer(MessageDataSerializer serializer)
MessageDataSerializer
serializer
- void addTopicListener(TopicListener topicListener)
publishEvent(TopicEvent)
).void removeTopicListener(TopicListener topicListener)
void checkSubscription(Session session) throws SubscriptionFailureException
SubscriptionFailureException
- when given session can't be subscribed to this topicvoid publishEvent(TopicEvent event)
void publish(Object messageData) throws MessageException
messageData
- data that will be serialized by MessageDataSerializerMessageException
Copyright © 2014 JBoss by Red Hat. All Rights Reserved.