com.googlecode.sarasvati.mem
Class MemEngine

java.lang.Object
  extended by com.googlecode.sarasvati.impl.BaseEngine
      extended by com.googlecode.sarasvati.mem.MemEngine
All Implemented Interfaces:
Engine

public class MemEngine
extends BaseEngine


Constructor Summary
MemEngine()
          Creates a new MemEngine with the default application context.
MemEngine(boolean useGlobalGraphCache)
          Creates a new MemEngine with the default application context.
MemEngine(String applicationContext)
          Creates a new MemEngine with the given application context.
MemEngine(String applicationContext, boolean useGlobalGraphCache)
          Creates a new MemEngine with the given application context.
MemEngine(String applicationContext, MemGraphRepository repository)
          Creates a new MemEngine with the given application context.
 
Method Summary
 MemGraphFactory getFactory()
          Returns an appropriate GraphFactory for this Engine.
 GraphLoader<MemGraph> getLoader()
          Returns an appropriate GraphLoader for this Engine.
 GraphLoader<MemGraph> getLoader(GraphValidator validator)
          Returns an appropriate GraphLoader for this Engine.
 MemGraphRepository getRepository()
          Returns an appropriate GraphRepository for this Engine.
 MemEngine newEngine()
          Creates a new engine base on the same parameters as this.
 
Methods inherited from class com.googlecode.sarasvati.impl.BaseEngine
addExecutionListener, addExecutionListener, addGlobalCustomNodeType, addNodeType, backtrack, cancelProcess, complete, completeAsynchronous, completeWithNewTokenSet, evaluateGuard, executeQueuedArcTokens, finalizeCancel, finalizeComplete, fireEvent, getParentEngine, newEngine, newJoinLangEnv, newRubricEnv, removeExecutionListener, removeExecutionListener, setupScriptEnv, startProcess, startProcess, startProcess
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemEngine

public MemEngine()
Creates a new MemEngine with the default application context. Each application context can have it's own set of global listeners. MemEngine instances constructed via this constructor will use the global graph cache.


MemEngine

public MemEngine(boolean useGlobalGraphCache)
Creates a new MemEngine with the default application context. Each application context can have it's own set of global listeners.

Parameters:
useGlobalGraphCache - Specifies whether this engine should use the global graph cache, or a cache specific to this instance.

MemEngine

public MemEngine(String applicationContext)
Creates a new MemEngine with the given application context. Each application context has it's own set of global listeners. This allows different applications running the same JVM to have different sets of listeners without having to add them at the process level. MemEngine instances constructed via this constructor will use the global graph cache.

Parameters:
applicationContext - The application context

MemEngine

public MemEngine(String applicationContext,
                 boolean useGlobalGraphCache)
Creates a new MemEngine with the given application context. Each application context has it's own set of global listeners. This allows different applications running the same JVM to have different sets of listeners without having to add them at the process level.

Parameters:
applicationContext - The application context
useGlobalGraphCache - Specifies whether this engine should use the global graph cache, or a cache specific to this instance.

MemEngine

public MemEngine(String applicationContext,
                 MemGraphRepository repository)
Creates a new MemEngine with the given application context. Each application context has it's own set of global listeners. This allows different applications running the same JVM to have different sets of listeners without having to add them at the process level.

Parameters:
applicationContext - The application context
repository - The repository to use for loading graphs and as a graph source
Method Detail

getFactory

public MemGraphFactory getFactory()
Description copied from interface: Engine
Returns an appropriate GraphFactory for this Engine. Subclasses may override this provide customer behavior.

Returns:
A GraphFactory which will generate the appropriate types for this Engine.

getRepository

public MemGraphRepository getRepository()
Description copied from interface: Engine
Returns an appropriate GraphRepository for this Engine. Subclasses may override this to provide custom behavior.

Returns:
An appropriate GraphRepository for this Engine

getLoader

public GraphLoader<MemGraph> getLoader()
Description copied from interface: Engine
Returns an appropriate GraphLoader for this Engine. Subclasses may override this provide customer behavior.

Equivalent to getLoader( null )

Returns:
A GraphLoader which, by default, will use the factory and repository from this engine.

getLoader

public GraphLoader<MemGraph> getLoader(GraphValidator validator)
Description copied from interface: Engine
Returns an appropriate GraphLoader for this Engine. Subclasses may override this provide customer behavior.

Returns:
A GraphLoader which, by default, will use the factory and repository from this engine.

newEngine

public MemEngine newEngine()
Description copied from class: BaseEngine
Creates a new engine base on the same parameters as this. For example, if the engine is database backed, it should share the same database engine.

Returns:
A new engine