de.topicmapslab.majortom.index.core
Class BaseCachedIndexImpl<T extends de.topicmapslab.majortom.model.store.ITopicMapStore>

java.lang.Object
  extended by de.topicmapslab.majortom.index.IndexImpl<T>
      extended by de.topicmapslab.majortom.index.core.BaseCachedIndexImpl<T>
All Implemented Interfaces:
de.topicmapslab.majortom.model.event.ITopicMapListener, org.tmapi.index.Index
Direct Known Subclasses:
BaseCachedIdentityIndexImpl, BaseCachedLiteralIndexImpl, BaseCachedScopeIndexImpl, BaseCachedSupertypeSubtypeIndexImpl, BaseCachedTypeInstanceIndexImpl, PagedConstructIndexImpl

public abstract class BaseCachedIndexImpl<T extends de.topicmapslab.majortom.model.store.ITopicMapStore>
extends IndexImpl<T>
implements de.topicmapslab.majortom.model.event.ITopicMapListener

Base class of all cached indexes

Author:
Sven Krosse

Constructor Summary
BaseCachedIndexImpl(T store)
          constructor
 
Method Summary
 void clear()
          Removed any cached content from internal cache
protected abstract  void clearCache()
          clear all internal caches
 void close()
          
 boolean isCachingEnabled()
          Checks if the underlying topic map store supports caching
protected  boolean isOnTransactionContext(java.util.Collection<?> context)
          Method checks if the given context are on transaction context
protected  boolean isOnTransactionContext(org.tmapi.core.Construct... constructs)
          Method checks if the given constructs are on transaction context
protected  boolean isOnTransactionContext(org.tmapi.core.Construct c)
          Method checks if the given theme is on transaction context
protected  boolean isOnTransactionContext(de.topicmapslab.majortom.model.core.IScope... scopes)
          Method checks if the given scopes are on transaction context
protected  boolean isOnTransactionContext(de.topicmapslab.majortom.model.core.IScope scope)
          Method checks if the given scope is on transaction context
 void open()
          
 
Methods inherited from class de.topicmapslab.majortom.index.IndexImpl
getTopicMapStore, isAutoUpdated, isOpen, reindex
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.topicmapslab.majortom.model.event.ITopicMapListener
topicMapChanged
 

Constructor Detail

BaseCachedIndexImpl

public BaseCachedIndexImpl(T store)
constructor

Parameters:
store - the store
Method Detail

clearCache

protected abstract void clearCache()
clear all internal caches


open

public void open()

Specified by:
open in interface org.tmapi.index.Index
Overrides:
open in class IndexImpl<T extends de.topicmapslab.majortom.model.store.ITopicMapStore>

close

public void close()

Specified by:
close in interface org.tmapi.index.Index
Overrides:
close in class IndexImpl<T extends de.topicmapslab.majortom.model.store.ITopicMapStore>

clear

public void clear()
Removed any cached content from internal cache

Overrides:
clear in class IndexImpl<T extends de.topicmapslab.majortom.model.store.ITopicMapStore>

isOnTransactionContext

protected boolean isOnTransactionContext(de.topicmapslab.majortom.model.core.IScope scope)
Method checks if the given scope is on transaction context

Parameters:
scope - the scope
Returns:
true if scope is on transaction context, false otherwise

isOnTransactionContext

protected boolean isOnTransactionContext(java.util.Collection<?> context)
Method checks if the given context are on transaction context

Parameters:
context - the context
Returns:
true if context are on transaction context, false otherwise

isOnTransactionContext

protected boolean isOnTransactionContext(de.topicmapslab.majortom.model.core.IScope... scopes)
Method checks if the given scopes are on transaction context

Parameters:
scopes - the scopes
Returns:
true if scopes are on transaction context, false otherwise

isOnTransactionContext

protected boolean isOnTransactionContext(org.tmapi.core.Construct c)
Method checks if the given theme is on transaction context

Parameters:
c - the construct
Returns:
true if themes is on transaction context, false otherwise

isOnTransactionContext

protected boolean isOnTransactionContext(org.tmapi.core.Construct... constructs)
Method checks if the given constructs are on transaction context

Parameters:
constructs - the constructs
Returns:
true if constructs are on transaction context, false otherwise

isCachingEnabled

public boolean isCachingEnabled()
Checks if the underlying topic map store supports caching

Returns:
true if caching is supported and enabled, false otherwise.