public class TopicMapEvents extends Object
There is currently only listener support for topics added or removed. The listeners will receive callbacks after the transaction has been committed. This means that the listeners will only see committed changes.
Use the addTopicListener
and
removeTopicListener
methods to register and unregister
your listeners.
Here is an example of how you can register a listener:
TopicMapRepositoryIF rep = TopicMaps.getRepository(); String topicmapId = "mytopicmap"; TopicMapReferenceIF ref = repository.getReferenceByKey(topicmapId); TopicMapListenerIF myListener = new MyTopicListener(); TopicMapEvents.addTopicListener(ref, myListener);
Note that you should only register your listener once.
Modifier and Type | Method and Description |
---|---|
static void |
addTopicListener(TopicMapReferenceIF topicmapRef,
TopicMapListenerIF listener)
PUBLIC: Call this method to register a topic listener with a
given topic map.
|
static void |
removeTopicListener(TopicMapReferenceIF topicmapRef,
TopicMapListenerIF listener)
PUBLIC: Call this method to unregister a topic listener with a
given topic map.
|
public static void addTopicListener(TopicMapReferenceIF topicmapRef, TopicMapListenerIF listener)
public static void removeTopicListener(TopicMapReferenceIF topicmapRef, TopicMapListenerIF listener)