org.apache.stanbol.enhancer.servicesapi
Interface Chain

All Known Implementing Classes:
AbstractChain, SingleEngineChain

public interface Chain

An Enhancement Chain represents a configuration that defines what engines and in what order are used to process ContentItems. The Chain is not responsible for the execution, but only provides the configuration - the execution plan - to the EnhancementJobManager.

Typically Chains are registered as OSGI services. Such Chains are accessible via the ChainManager service by name - the value of PROPERTY_NAME in the service registration. Chains that are registered like that can be directly addressed by users by parsing content to /engines/chain/{name}.

To use a Chain for the execution of a ContentItem with the EnhancementJobManager it is not required that it is registered as OSGI service. EnhancementJobManager MUST also accept Chains that are not registered as OSGI service. Chains are registered as OSGI services and identified by the "stanbol.enhancer.chain.name" property.


Field Summary
static java.lang.String PROPERTY_NAME
          The property to be used for providing the name of a chain.
 
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 PROPERTY_NAME
 

Field Detail

PROPERTY_NAME

static final java.lang.String PROPERTY_NAME
The property to be used for providing the name of a chain.

See Also:
Constant Field Values
Method Detail

getExecutionPlan

org.apache.clerezza.rdf.core.Graph getExecutionPlan()
                                                    throws ChainException
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.

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

java.util.Set<java.lang.String> getEngines()
                                           throws ChainException
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).

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

java.lang.String getName()
The name of this chain as configured by PROPERTY_NAME

Returns:
the name


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