eu.larkc.jactr.modules.larkc.plugin
Class LarKCPluginModule

java.lang.Object
  extended by org.jactr.core.utils.DefaultAdaptable
      extended by org.jactr.core.module.AbstractModule
          extended by eu.larkc.jactr.modules.larkc.plugin.LarKCPluginModule
All Implemented Interfaces:
ILarKCPluginModule, ISPARQLRetrievalModule, IModule, IRetrievalModule4, IRetrievalModule, IAdaptable, IInitializable, IInstallable, IParameterized

public class LarKCPluginModule
extends AbstractModule
implements ILarKCPluginModule, ISPARQLRetrievalModule, IRetrievalModule4, IParameterized

The Module that wraps any LarKC Plug-in. Should be initialized with the parameters: PluginName, PluginURI, PluginInput and PluginOutput

Author:
Martijn Brakenhoff

Field Summary
 
Fields inherited from interface eu.larkc.jactr.modules.larkc.plugin.ILarKCPluginModule
PLUGIN_BUFFER, PLUGIN_URI
 
Fields inherited from interface org.jactr.core.module.retrieval.four.IRetrievalModule4
LATENCY_EXPONENT, LATENCY_FACTOR
 
Fields inherited from interface org.jactr.core.module.retrieval.IRetrievalModule
RETRIEVAL_THRESHOLD
 
Constructor Summary
LarKCPluginModule()
           
LarKCPluginModule(String moduleName)
           
 
Method Summary
 void addListener(IRetrievalModuleListener listener, Executor executor)
           
 void dispose()
           
 String getBufferName()
           
 double getLatencyExponent()
           
 double getLatencyFactor()
           
 String getParameter(String key)
           
 String getPluginURI()
          Returns the PluginURI parameter that was supplied to this module.
 Collection<String> getPossibleParameters()
           
 double getRetrievalThreshold()
           
 IRetrievalTimeEquation getRetrievalTimeEquation()
           
 Collection<String> getSetableParameters()
           
 void initialize()
           
 void install(IModel model)
           
 boolean isAlive()
          Checks if the plug-in manager thread is still running or has terminated.
 void removeListener(IRetrievalModuleListener listener)
           
 void reset()
           
 void reset(boolean resetFinstsToo)
           
 Future<IChunk> retrieveChunk(ChunkTypeRequest chunkPattern)
           
 Future<IChunk> retrieveChunk(SPARQLRequest sparqlRequest)
          Returns (the promise of) an IChunk that matches the SPARQLRequest.
 void setBufferName(String name)
          Sets the buffer name that will be used by this module.
 void setLatencyExponent(double exp)
           
 void setLatencyFactor(double fact)
           
 void setParameter(String key, String value)
           
 void setPluginURI(String uri)
          Sets the URI that specifies the LarKC Plug-in that will be wrapped by this module.
 void setRetrievalThreshold(double threshold)
           
 
Methods inherited from class org.jactr.core.module.AbstractModule
delayedFuture, getExecutor, getModel, getName, immediateFuture, immediateReturn, uninstall
 
Methods inherited from class org.jactr.core.utils.DefaultAdaptable
getAdapter
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jactr.core.module.IModule
getModel, getName
 
Methods inherited from interface org.jactr.core.utils.IInstallable
uninstall
 
Methods inherited from interface org.jactr.core.utils.IAdaptable
getAdapter
 

Constructor Detail

LarKCPluginModule

public LarKCPluginModule()

LarKCPluginModule

public LarKCPluginModule(String moduleName)
Method Detail

install

public void install(IModel model)
Specified by:
install in interface IModule
Specified by:
install in interface IInstallable
Overrides:
install in class AbstractModule

initialize

public void initialize()
Specified by:
initialize in interface IModule
Specified by:
initialize in interface IInitializable
Specified by:
initialize in class AbstractModule

dispose

public void dispose()
Specified by:
dispose in interface IModule
Overrides:
dispose in class AbstractModule

reset

public void reset()
Specified by:
reset in interface IModule

reset

public void reset(boolean resetFinstsToo)
Specified by:
reset in interface IRetrievalModule

addListener

public void addListener(IRetrievalModuleListener listener,
                        Executor executor)
Specified by:
addListener in interface IRetrievalModule

removeListener

public void removeListener(IRetrievalModuleListener listener)
Specified by:
removeListener in interface IRetrievalModule

isAlive

public boolean isAlive()
Description copied from interface: ILarKCPluginModule
Checks if the plug-in manager thread is still running or has terminated.

Specified by:
isAlive in interface ILarKCPluginModule
Returns:
True if the plug-in manager is still alive, otherwise false.

retrieveChunk

public Future<IChunk> retrieveChunk(SPARQLRequest sparqlRequest)
Description copied from interface: ISPARQLRetrievalModule
Returns (the promise of) an IChunk that matches the SPARQLRequest.

Specified by:
retrieveChunk in interface ISPARQLRetrievalModule
Parameters:
sparqlRequest - the SPARQLRequest that will be matched.
Returns:
the promise of the chunk that matches most.

retrieveChunk

public Future<IChunk> retrieveChunk(ChunkTypeRequest chunkPattern)
Specified by:
retrieveChunk in interface IRetrievalModule

getRetrievalThreshold

public double getRetrievalThreshold()
Specified by:
getRetrievalThreshold in interface IRetrievalModule

setRetrievalThreshold

public void setRetrievalThreshold(double threshold)
Specified by:
setRetrievalThreshold in interface IRetrievalModule

getRetrievalTimeEquation

public IRetrievalTimeEquation getRetrievalTimeEquation()
Specified by:
getRetrievalTimeEquation in interface IRetrievalModule

getLatencyExponent

public double getLatencyExponent()
Specified by:
getLatencyExponent in interface IRetrievalModule4

setLatencyExponent

public void setLatencyExponent(double exp)
Specified by:
setLatencyExponent in interface IRetrievalModule4

getLatencyFactor

public double getLatencyFactor()
Specified by:
getLatencyFactor in interface IRetrievalModule4

setLatencyFactor

public void setLatencyFactor(double fact)
Specified by:
setLatencyFactor in interface IRetrievalModule4

getPluginURI

public String getPluginURI()
Description copied from interface: ILarKCPluginModule
Returns the PluginURI parameter that was supplied to this module.

Specified by:
getPluginURI in interface ILarKCPluginModule
Returns:
the Plug-in URI specified in the model.

setPluginURI

public void setPluginURI(String uri)
Description copied from interface: ILarKCPluginModule
Sets the URI that specifies the LarKC Plug-in that will be wrapped by this module.

Specified by:
setPluginURI in interface ILarKCPluginModule
Parameters:
uri - the Plug-in URI

getBufferName

public String getBufferName()

setBufferName

public void setBufferName(String name)
Description copied from interface: ILarKCPluginModule
Sets the buffer name that will be used by this module. This is a necessity, because multiple instances of this module are necessary to create a Workflow.

Specified by:
setBufferName in interface ILarKCPluginModule
Parameters:
name - the buffer name.

getParameter

public String getParameter(String key)
Specified by:
getParameter in interface IParameterized
See Also:
IParameterized.getParameter(java.lang.String)

getPossibleParameters

public Collection<String> getPossibleParameters()
Specified by:
getPossibleParameters in interface IParameterized
See Also:
IParameterized.getPossibleParameters()

getSetableParameters

public Collection<String> getSetableParameters()
Specified by:
getSetableParameters in interface IParameterized
See Also:
IParameterized.getSetableParameters()

setParameter

public void setParameter(String key,
                         String value)
Specified by:
setParameter in interface IParameterized
See Also:
IParameterized.setParameter(java.lang.String, java.lang.String)