net.ontopia.topicmaps.impl.utils
Class AbstractSubjectIdentityCache

java.lang.Object
  extended by net.ontopia.topicmaps.impl.utils.AbstractSubjectIdentityCache
All Implemented Interfaces:
java.io.Serializable, EventListenerIF
Direct Known Subclasses:
SubjectIdentityCache, SubjectIdentityCache

public abstract class AbstractSubjectIdentityCache
extends java.lang.Object
implements EventListenerIF, java.io.Serializable

INTERNAL: Class that maintains indexes for use with the TopicMapIF locator lookup methods. This is especially useful in the cases where the topic map object cannot use queries to do the lookups.

This class uses the event model to maintain its indexes.

See Also:
Serialized Form

Nested Class Summary
protected  class AbstractSubjectIdentityCache.EventHandler
           
 
Field Summary
protected  java.util.Map<java.lang.String,AbstractSubjectIdentityCache.EventHandler> handlers
           
 
Constructor Summary
AbstractSubjectIdentityCache(java.util.Map<java.lang.String,AbstractSubjectIdentityCache.EventHandler> handlers)
           
 
Method Summary
protected abstract  TMObjectIF _getObjectByItemIdentifier(LocatorIF source_locator)
           
protected abstract  TopicIF _getTopicBySubjectIdentifier(LocatorIF subject_indicator)
           
protected abstract  TopicIF _getTopicBySubjectLocator(LocatorIF subject)
           
abstract  TMObjectIF getObjectById(java.lang.String object_id)
           
abstract  TMObjectIF getObjectByItemIdentifier(LocatorIF locator)
           
abstract  TopicIF getTopicBySubjectIdentifier(LocatorIF locator)
           
abstract  TopicIF getTopicBySubjectLocator(LocatorIF locator)
           
 void processEvent(java.lang.Object object, java.lang.String event, java.lang.Object new_value, java.lang.Object old_value)
          INTERNAL: A method that receives notification when an event has been triggered.
 void registerListeners(EventManagerIF emanager, EventManagerIF otree)
          INTERNAL: Registers the subject identity cache listeners with the default event manager and the object tree event managers.
protected  void registerObject(TMObjectIF object)
          INTERNAL: Register the object with the identity map.
protected abstract  void registerSourceLocator(LocatorIF source_locator, TMObjectIF object)
           
protected abstract  void registerSubject(LocatorIF subject, TopicIF object)
           
protected abstract  void registerSubjectIndicator(LocatorIF subject_indicator, TopicIF object)
           
protected  void unregisterObject(TMObjectIF object)
          INTERNAL: Unregister the object with the identity map.
protected abstract  void unregisterSourceLocator(LocatorIF source_locator)
           
protected abstract  void unregisterSubject(LocatorIF subject)
           
protected abstract  void unregisterSubjectIndicator(LocatorIF subject_indicator)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

handlers

protected java.util.Map<java.lang.String,AbstractSubjectIdentityCache.EventHandler> handlers
Constructor Detail

AbstractSubjectIdentityCache

public AbstractSubjectIdentityCache(java.util.Map<java.lang.String,AbstractSubjectIdentityCache.EventHandler> handlers)
Method Detail

registerListeners

public void registerListeners(EventManagerIF emanager,
                              EventManagerIF otree)
INTERNAL: Registers the subject identity cache listeners with the default event manager and the object tree event managers.

Parameters:
emanager - The default event manager.
otree - The object tree manager.

getObjectById

public abstract TMObjectIF getObjectById(java.lang.String object_id)

getObjectByItemIdentifier

public abstract TMObjectIF getObjectByItemIdentifier(LocatorIF locator)

getTopicBySubjectLocator

public abstract TopicIF getTopicBySubjectLocator(LocatorIF locator)

getTopicBySubjectIdentifier

public abstract TopicIF getTopicBySubjectIdentifier(LocatorIF locator)

registerObject

protected void registerObject(TMObjectIF object)
INTERNAL: Register the object with the identity map. Does nothing by default.


unregisterObject

protected void unregisterObject(TMObjectIF object)
INTERNAL: Unregister the object with the identity map. Does nothing by default.


_getObjectByItemIdentifier

protected abstract TMObjectIF _getObjectByItemIdentifier(LocatorIF source_locator)

registerSourceLocator

protected abstract void registerSourceLocator(LocatorIF source_locator,
                                              TMObjectIF object)

unregisterSourceLocator

protected abstract void unregisterSourceLocator(LocatorIF source_locator)

_getTopicBySubjectIdentifier

protected abstract TopicIF _getTopicBySubjectIdentifier(LocatorIF subject_indicator)

registerSubjectIndicator

protected abstract void registerSubjectIndicator(LocatorIF subject_indicator,
                                                 TopicIF object)

unregisterSubjectIndicator

protected abstract void unregisterSubjectIndicator(LocatorIF subject_indicator)

_getTopicBySubjectLocator

protected abstract TopicIF _getTopicBySubjectLocator(LocatorIF subject)

registerSubject

protected abstract void registerSubject(LocatorIF subject,
                                        TopicIF object)

unregisterSubject

protected abstract void unregisterSubject(LocatorIF subject)

processEvent

public void processEvent(java.lang.Object object,
                         java.lang.String event,
                         java.lang.Object new_value,
                         java.lang.Object old_value)
Description copied from interface: EventListenerIF
INTERNAL: A method that receives notification when an event has been triggered.

Specified by:
processEvent in interface EventListenerIF


Copyright © 2000-2012 Ontopia.