org.apache.stanbol.enhancer.servicesapi.helper
Class SingleEngineChain

java.lang.Object
  extended by org.apache.stanbol.enhancer.servicesapi.helper.SingleEngineChain
All Implemented Interfaces:
Chain

public class SingleEngineChain
extends java.lang.Object
implements Chain

Intended to be used if one needs to wrap a single EnhancementEngine with a Chain to execute it by using the EnhancementJobManager#enhanceContent(org.apache.stanbol.enhancer.servicesapi.ContentItem, String) method.

This Chain implementation is NOT intended to be registered as OSGI service. The intension is that it is instantiated by the component (e.g. the implementation of a RESTful service) for an EnhancementEngine and directly parsed to the EnhancementJobManager.

Author:
Rupert Westenthaler

Field Summary
 
Fields inherited from interface org.apache.stanbol.enhancer.servicesapi.Chain
PROPERTY_NAME
 
Constructor Summary
SingleEngineChain(EnhancementEngine engine)
           
 
Method Summary
 java.util.Set<java.lang.String> getEngines()
          Getter for the set of EnhancementEngines referenced by there name within the execution plan.
 org.apache.clerezza.rdf.core.Graph getExecutionPlan()
          Getter for the execution plan reflecting the current configuration of this Chain.
 java.lang.String getName()
          The name of this chain as configured by Chain.PROPERTY_NAME
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingleEngineChain

public SingleEngineChain(EnhancementEngine engine)
Method Detail

getExecutionPlan

public org.apache.clerezza.rdf.core.Graph getExecutionPlan()
                                                    throws ChainException
Description copied from interface: Chain
Getter for the execution plan reflecting the current configuration of this Chain. The returned Graph is read only and MUST NOT be changed if the configuration of this Chain changes. This means that the Chain MUST create a new Graph instance if the execution plan changes as a result of a change in the configuration. It MUST NOT change any execution plan parsed to other components by the getExecutionPlan() method.

Specified by:
getExecutionPlan in interface Chain
Returns:
the execution plan as defined by the http://stanbol.apache.org/ontology/enhancer/executionplan# schema.
Throws:
ChainException - If the execution plan can not be created. Typically the case of the Chain requires runtime information to determine the execution plan.

getEngines

public java.util.Set<java.lang.String> getEngines()
                                           throws ChainException
Description copied from interface: Chain
Getter for the set of EnhancementEngines referenced by there name within the execution plan. This method is intended to be used in situations where only the list of engines need to be known (e.g. when checking that all referenced engines are available).

Specified by:
getEngines in interface Chain
Returns:
the set of engine names referenced by this chain
Throws:
ChainException - If the engines referenced by this chain can not be determined. This may happen if a chain required runtime information to determine the list of engines.

getName

public java.lang.String getName()
Description copied from interface: Chain
The name of this chain as configured by Chain.PROPERTY_NAME

Specified by:
getName in interface Chain
Returns:
the name


Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.