public interface TopicMapManager extends Module
The interface for a module that provides a topic map, and related services, for other modules. Just providing access to the topic map is the main function of this. In addition to that, there are some locking mechanisms, but depending on the implementation, they may or may not actually do anything. Implementation details may also vary but the idea is that any number of read locks can be acquired at the same time but write locks are exclusive, no readers or other writers are allowed at the same time.
You can also add listeners that will be notified if the whole topic map is changed. Note that this is different to just changes in the topic map, the topic map itself has listener mechanisms for that. The listener you register with the manager is notified when the entire topic map is replaced with another topic map.
Modifier and Type | Interface and Description |
---|---|
static interface |
TopicMapManager.TopicMapManagerListener
An interface for objects that want to be notified when the managed topic
map is replaced with another topic map.
|
Modifier and Type | Method and Description |
---|---|
void |
addTopicMapManagerListener(TopicMapManager.TopicMapManagerListener listener)
Adds a topic map listener that will be notified when the managed
topic map is replaced with another topic map.
|
TopicMap |
getTopicMap()
Returns the topic map managed by this topic map manager.
|
boolean |
lockRead()
Locks the topic map for reading.
|
boolean |
lockWrite()
Locks the topic map for writing.
|
void |
removeTopicMapManagerListener(TopicMapManager.TopicMapManagerListener listener)
Removes a topic map listener.
|
void |
unlockRead()
Releases a previously acquired read lock.
|
void |
unlockWrite()
Releases a previously acquired write lock.
|
getDependencies, init, isInitialized, isRunning, start, stop
boolean lockRead()
void unlockRead()
boolean lockWrite()
void unlockWrite()
TopicMap getTopicMap()
void addTopicMapManagerListener(TopicMapManager.TopicMapManagerListener listener)
listener
- The topic map listener.void removeTopicMapManagerListener(TopicMapManager.TopicMapManagerListener listener)
listener
- The listener.Copyright 2004-2015 Wandora Team