Author: buildbot
Date: Fri Jan 27 08:06:37 2012
New Revision: 803399
Log:
Staging update by buildbot for stanbol
Added:
websites/staging/stanbol/trunk/content/stanbol/docs/trunk/enhancer/engines/enhancementengine.html
websites/staging/stanbol/trunk/content/stanbol/docs/trunk/enhancer/engines/enhancementenginemanager.html
Modified:
websites/staging/stanbol/trunk/content/stanbol/docs/trunk/enhancer/chains/chainmanager.html
websites/staging/stanbol/trunk/content/stanbol/docs/trunk/enhancer/chains/enhancementchain.html
Modified:
websites/staging/stanbol/trunk/content/stanbol/docs/trunk/enhancer/chains/chainmanager.html
==============================================================================
---
websites/staging/stanbol/trunk/content/stanbol/docs/trunk/enhancer/chains/chainmanager.html
(original)
+++
websites/staging/stanbol/trunk/content/stanbol/docs/trunk/enhancer/chains/chainmanager.html
Fri Jan 27 08:06:37 2012
@@ -57,7 +57,7 @@
<div id="content">
<h1 class="title">ChainManager</h1>
- <p>The ChainManager provides name based access to all active <a
href="enhancementchain.html">Enhancement Chain</a> and there ServiceReferences.
This interface is typically used by components that need to lookup Chains based
on there name. However the ChainsTracker implementation can also be used to
track specific Chains.</p>
+ <p>The ChainManager provides name based access to all active <a
href="enhancementchain.html">Enhancement Chain</a> and their ServiceReferences.
This interface is typically used by components that need to lookup Chains based
on their name. However the ChainsTracker implementation can also be used to
track specific Chains.</p>
<h3 id="chainmanager_interface">ChainManager interface</h3>
<p>This is the Java API providing access to registered Chains in the ways as
described above. This interface includes the following methods:</p>
<div class="codehilite"><pre><span class="sr">/** Constant for the name of the
DefaultChain */</span>
Modified:
websites/staging/stanbol/trunk/content/stanbol/docs/trunk/enhancer/chains/enhancementchain.html
==============================================================================
---
websites/staging/stanbol/trunk/content/stanbol/docs/trunk/enhancer/chains/enhancementchain.html
(original)
+++
websites/staging/stanbol/trunk/content/stanbol/docs/trunk/enhancer/chains/enhancementchain.html
Fri Jan 27 08:06:37 2012
@@ -70,7 +70,7 @@
<p>are processed by using the default enhancement chain.</p>
-<p>When using the Java API Chains can be looked up as OSGI services. The the
<a href="chainmanager.html">ChainManager</a> service is designed to ease this
by providing a API that allows to access Chains by their name. Because Chains
are not responsible to perform the actual execution but only provide the <a
href="executionplan.html">ExecutionPlan</a> one needs to also lookup an
EnhancementJobManager instance to enhance a contentItem</p>
+<p>When using the Java API Chains can be looked up as OSGI services. The <a
href="chainmanager.html">ChainManager</a> service is designed to ease this by
providing a API that allows to access Chains by their name. Because Chains are
not responsible to perform the actual execution but only provide the <a
href="executionplan.html">ExecutionPlan</a> one needs to also lookup an
EnhancementJobManager instance to enhance a contentItem</p>
<div class="codehilite"><pre><span class="nv">@Reference</span>
<span class="n">EnhancementJobManager</span> <span
class="n">jobManager</span><span class="p">;</span>
@@ -106,7 +106,7 @@
</pre></div>
-<p>Each Chain has an name assigned. This is typically provided by the chain
configuration and MUST me set as value to the property
"stanbol.enhancer.chain.name" of the service registration. The getter for the
name MUST return the same value. Chain implementation will usually get the name
typically by calling</p>
+<p>Each Chain has an name assigned. This is typically provided by the chain
configuration and MUST be set as value to the property
"stanbol.enhancer.chain.name" of the service registration. The getter for the
name MUST return the same value. Chain implementation will usually get the name
by calling</p>
<p>this.name = (String)ComponentContext.getProperties(Chain.PROPERTY_NAME);</p>
<p>within the activate method of the Chain. There is also an AbstractChain
implementation provided by the servicesapi module of the Stanbol Enhancer that
already implements this functionality.</p>
<p>The getEngines method returns the name of all EnhancementEngines referenced
by a Chain. Note that this method returns a Set. This method is intended to
allow fast access to the referenced engines and does not provide any
information about the execution order.</p>
@@ -134,7 +134,7 @@
<p>If no chain is active a ChainException with an according message MUST BE
thrown.</p>
<p>All Stanbol launchers are configured with the <a
href="defaultchain.html">Default Chain</a> enabled. This registers itself with
the name "default" and the lowest possible service ranking - Integer.MIN_VALUE.
This default provides a Chain that considered all currently active
EnhancementEngines and sorts them based on there ordering information (see the
<a href="weightedchain.html#calculation_of_the_executionplan">Calculation of
the Execution Plan based on the EnhancementEngine Ordering</a> for details).</p>
<h3 id="chainmanager_interface">ChainManager interface</h3>
-<p>The <a href="chainmanager.html">ChainManager</a> is the management
interface for EnhancementChains that can be used by components to lookup chains
based on there name. It also provides a getter for the default chain. There is
also OSGI ServiceTracker like implementation that can be used to track only
chains with specific names and to get even notified on any change of such
chains.</p>
+<p>The <a href="chainmanager.html">ChainManager</a> is the management
interface for EnhancementChains that can be used by components to lookup chains
based on their name. It also provides a getter for the default chain. There is
also OSGI ServiceTracker like implementation that can be used to track only
chains with specific names and to get even notified on any change of such
chains.</p>
<h2 id="chain_implementations">Chain implementations</h2>
<p>The following Chain implementations are included within the default Stanbol
Enhancer distribution:</p>
<ul>
Added:
websites/staging/stanbol/trunk/content/stanbol/docs/trunk/enhancer/engines/enhancementengine.html
==============================================================================
---
websites/staging/stanbol/trunk/content/stanbol/docs/trunk/enhancer/engines/enhancementengine.html
(added)
+++
websites/staging/stanbol/trunk/content/stanbol/docs/trunk/enhancer/engines/enhancementengine.html
Fri Jan 27 08:06:37 2012
@@ -0,0 +1,174 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE- 2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+ <link href="/stanbol/css/stanbol.css" rel="stylesheet" type="text/css">
+ <title>Apache Stanbol - EnhancementEngine</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <link rel="icon" type="image/png"
href="/stanbol/images/stanbol-logo/stanbol-favicon.png"/>
+</head>
+
+<body>
+ <div id="navigation">
+ <a href="/stanbol/index.html"><img alt="Apache Stanbol" width="220"
height="101" border="0"
src="/stanbol/images/stanbol-logo/stanbol-2010-12-14.png"/></a>
+ <h1 id="stanbol">Stanbol</h1>
+<ul>
+<li><a href="/stanbol/index.html">Home</a></li>
+<li><a href="/stanbol/docs/trunk/tutorial.html">Tutorial</a></li>
+<li><a href="/stanbol/docs/trunk/">Documentation</a></li>
+<li><a href="/stanbol/docs/trunk/building.html">Building</a></li>
+</ul>
+<h1 id="project">Project</h1>
+<ul>
+<li><a href="/stanbol/docs/trunk/mailinglists.html">Mailing Lists</a></li>
+<li><a href="https://issues.apache.org/jira/browse/STANBOL">Issue
Tracker</a></li>
+<li><a href="/stanbol/team.html">Project Team</a></li>
+<li><a href="http://www.apache.org/licenses/LICENSE-2.0">License</a></li>
+</ul>
+<h1 id="downloads">Downloads</h1>
+<ul>
+<li><a href="http://dev.iks-project.eu/downloads/stanbol-launchers/">Pre-built
Launchers</a></li>
+</ul>
+<h1 id="the_asf">The ASF</h1>
+<ul>
+<li><a href="http://www.apache.org">Apache Software Foundation</a></li>
+<li><a href="http://www.apache.org/foundation/thanks.html">Thanks</a></li>
+<li><a href="http://www.apache.org/foundation/sponsorship.html">Become a
Sponsor</a></li>
+<li><a href="http://www.apache.org/security/">Security</a></li>
+</ul>
+ </div>
+
+ <div id="content">
+ <h1 class="title">EnhancementEngine</h1>
+ <p>EnhancementEngines are the components that are responsible to enhance
ContentItmes. They are called by the <a
href="enhancementjobmanager.html">EnhancementJobManager</a>. EnhancementEngines
do have full access to the parsed ContentItems. They are expected to modify the
state of the content item.</p>
+<p>The RESTful interface of an EnhancementEngines can be accessed by</p>
+<div class="codehilite"><pre><span class="n">http:</span><span
class="sr">//</span><span class="p">{</span><span class="n">host</span><span
class="p">}:{</span><span class="n">port</span><span class="p">}</span><span
class="sr">/{stanbol-root}/</span><span class="n">enhancer</span><span
class="sr">/engine/</span><span class="p">{</span><span
class="n">engine</span><span class="o">-</span><span class="n">name</span><span
class="p">}</span>
+</pre></div>
+
+
+<p>e.g. an EnhancementEngine with the name "ner" running at a Apache Stanbol
instance on local host with the default configuration will be accessible at</p>
+<div class="codehilite"><pre><span class="n">http:</span><span
class="sr">//</span><span class="n">localhost:8080</span><span
class="sr">/enhancer/</span><span class="n">engine</span><span
class="o">/</span><span class="n">ner</span>
+</pre></div>
+
+
+<p>When using the Java API EnhancementEngines can be liked up as OSGI
services. The <a href="enhancementenginemanager.html">EnhanceEngineManager</a>
service is designed to ease this by providing a API that allows to access
EnhancementEngine by their name.</p>
+<h2 id="enhancementengine_interface">EnhancementEngine Interface</h2>
+<p>The interface for EnhancementEngines contains the following three
methods:</p>
+<div class="codehilite"><pre><span class="sr">/** Getter for the value of the
"stanbol.enhancer.engine.name" property */</span>
+<span class="o">+</span> <span class="n">getName</span><span
class="p">()</span> <span class="p">:</span> <span class="n">String</span>
+<span class="sr">/** Checks if this engine can enhance the parsed content item
*/</span>
+<span class="o">+</span> <span class="n">canEnhance</span><span
class="p">(</span><span class="n">ContentItem</span> <span
class="n">ci</span><span class="p">)</span> <span class="p">:</span> <span
class="nb">int</span>
+<span class="sr">/** Enhances the parsed content item */</span>
+<span class="o">+</span> <span class="n">computeEnhacements</span><span
class="p">(</span><span class="n">ContentItem</span> <span
class="n">ci</span><span class="p">)</span>
+
+<span class="sr">/** The property used for the name of an engine */</span>
+<span class="n">PROPERTY_NAME</span> <span class="p">:</span> <span
class="n">String</span>
+<span class="sr">/** Indicates that this engine can not enhance an content
item */</span>
+<span class="n">CANNOT_ENHANCE</span> <span class="p">:</span> <span
class="nb">int</span>
+<span class="sr">/** Indicates support for synchronous enhancement */</span>
+<span class="n">ENHANCE_SYNCHRONOUS</span> <span class="p">:</span> <span
class="nb">int</span>
+<span class="sr">/** Indicates support for asynchronous enhancement */</span>
+<span class="n">ENHANCE_ASYNC</span> <span class="p">:</span> <span
class="nb">int</span>
+</pre></div>
+
+
+<p>Each EnhancementEngine has an name assigned. This is typically provided by
the engine configuration and MUST be set as value to the property
"stanbol.enhancer.engine.name" in the service registration of the enhancement
engine. The getter for the name MUST return the same value as the value set to
this property. EnhancementEngine implementations will usually get the name by
calling</p>
+<p>this.name =
(String)ComponentContext.getProperties(EnhancementEngine.PROPERTY_NAME);</p>
+<p>in the activate method.</p>
+<p>The "canEnahnce(ContentItem ci)" method is used by the <a
href="../enhancementjobmanager.html">EnhancementJobManager</a> to check if an
engine is able to process a ContentItem. Calling this method MUST NOT change
the state of the ContentItem and this method MUST also NOT acquire a write lock
on the content item.</p>
+<p>The "computeEnhacements(ContentItem ci)" starts the processing of the
parsed ContentItem by the engine. It is expected to change the state of the
parsed ContentItem. Engines that support asynchronous processing need to take
care to correctly apply read/write locks when reading/writing information
from/to the content time. Engines that return ENHANCE_SYNCHRONOUS on calls to
canEnhance(..) do not need to use locks. They can trust that they have
exclusive read/write access to the content item.</p>
+<p>EnhancementEngiens do have full access to the ContentItem. Theoretically
they would be even allowed to delete all metadata as well as all content parts
from the parsed ContentItem. However typically the do only</p>
+<ul>
+<li>read existing ContentParts</li>
+<li>add new ContentParts</li>
+<li>add new Enhancements to the metadata</li>
+<li>some engines might also need to update/delete existing metadata.</li>
+</ul>
+<p>Both the "canEnhance(..)" and "computeEnhancements(..)" methods MUST be
called by the <a href="../enhancementjobmanager.html">EnhancementJobManager</a>
after all the executions of all EnhancementEngines this one depends on are
completed. This dependencies are defined by the <a
href="../chains/executionplan.html">ExecutionPlan</a> used by the
EnhancementJobManager to enhance the ContentItem. Implementors of
EnhancementEngines can therefore trust that all metadata expected to be added
by other EnhancementEngines are already present within the metadata of the
parsed ContentItems when "canEnhance(..)" or "computeEnhancements(..)" is
called.</p>
+<h3 id="servicesproperties_interface">ServicesProperties Interface</h3>
+<p>This interface is implemented by most of the current EnhancementEngines. It
allows engines to expose additional properties to other component. This
interface defines a single method</p>
+<div class="codehilite"><pre><span class="sr">/** Getter for the
ServiceProperties */</span>
+<span class="n">Map</span><span class="sr"><String,Object></span> <span
class="n">getServiceProperties</span><span class="p">();</span>
+</pre></div>
+
+
+<p>but also predefines the property ENHANCEMENT_ENGINE_ORDERING =
"org.apache.stanbol.enhancer.engine.order" that can be used by
EnhancementEngine implementations to specify their typical ordering within the
enhancement process.</p>
+<h3 id="engine_ordering_information">Engine Ordering Information</h3>
+<p>By implementing the ServicesProperties interface EnhancementEngines do have
the possibility to expose additional metadata to other components. The
ServicesProperties interface defines only a single method</p>
+<div class="codehilite"><pre><span class="sr">/** Getter for the
ServiceProperties */</span>
+<span class="n">Map</span><span class="sr"><String,Object></span> <span
class="n">getServiceProperties</span><span class="p">();</span>
+</pre></div>
+
+
+<p>and is implemented by most of the current EnhancementEngines. Its currently
only use is to provide information about the engine ordering within the
enhancement process. This information is exposed by using the key
"org.apache.stanbol.enhancer.engine.order" that is defined as value by the
constant ENHANCEMENT_ENGINE_ORDERING defined directly by the ServicesProperties
interface. Values are expected to be integer within the ranges </p>
+<ul>
+<li><strong>ORDERING_PRE_PROCESSING</strong>: All values >= 200 are
considered for engines that do some kind of preprocessing of the Content. This
includes e.g. the conversation of media formats such as extracting the plain
text from HTML, keyframes from videos, wave form from mp3 ...; extracting
metadata directly encoded within the parsed content such as ID3 tags from MP3
or RDFa, microdata provided by HTML content.</li>
+<li><strong>ORDERING_CONTENT_EXTRACTION</strong>: This range includes values
form < 200 and >= 100 and shall be used by enhancement engine that need
to analyze the parsed content to extract additional metadata. Examples would be
Language detection, Natural Language Processing, Named Entity Recognition, Face
Detection in Images, Speech to text â¦</li>
+<li><strong>ORDERING_EXTRACTION_ENHANCEMENT</strong>: This range includes
values from < 100 and >= 1 and shall be used by enhancement engines to
provide semantic lifting of preexisting enhancement such as linking named
entities extracted by an NER engine with entities defines in a controlled
vocabulary or lifting artist names, song titles ... extracted from mp3 files
with the according Entities defined in an music database.</li>
+<li><strong>ORDERING_DEFAULT</strong>: This represents the value 0 and shall
be used as default value for all EnhancementEngines that do not provide
ordering information or do not implement the ServicesProperties interface.</li>
+<li><strong>ORDERING_POST_PROCESSING</strong>: This range includes valued form
< 0 and >= -100 and is intended to be used by all enhancement engines
that do post processing of enhancement results such as schema translation,
filtering of Enhancements ...<br />
+</li>
+</ul>
+<p>The Engine Ordering information as described here are used by the <a
href="../chains/defaultchain.html">DefaultChain</a> and the <a
href="../chains/weightedchain.html">WeightedChain</a> to calculate the <a
href="../chains/executionplan.html">ExecutionPlan</a>.</p>
+<p>Basically this features allows the implementor of an EnhancementEngine to
define the correct position of his engine within an typical enhancement chain
and therefore ensure that users that add this engine to a Stanbol Enhancer
installation to immediately use this engine with the <a
href="../chains/defaultchain.html">DefaultChain</a>.</p>
+<p>However the Engine Ordering is not the only possibility for users to
control the execution order. Enhancement chain implementations such as the <a
href="../chains/listchain.html">ListChain</a> and the <a
href="../chains/grpahchain.html">GraphChain</a> do also allow to directly
define the oder of execution. For this chains the ordering information provided
by EnhancementEngines are ignored.</p>
+<h2 id="enhancementengine_management">EnhancementEngine management</h2>
+<p>This section describes how EnhancementEngines are managed by the Stanbol
Enhancer and how they can be selected/accessed by the <a
href="../enhancementjobmanager.html">EnhancementJobManager</a> execution a <a
href="../chains/enhancementchain.html">Chain</a>.</p>
+<p>EnhancementEngines are registered as OSGI services and managed by using the
following service properties:</p>
+<ul>
+<li><strong>Name:</strong> Defined by the value of the property
"stanbol.enhancer.engine.name" it will be used to access Engines on the Stanbol
RESTful interface</li>
+<li><strong>Service Ranking:</strong> The service ranking property defined by
OSGI will be used to decide which engine to use in case several active
EnhancementEngines do use the same name. In such cases only the Engine with the
highest ranking will be used to enhance ContentItems.</li>
+</ul>
+<!-- TODO: The Configuration is not yet defined
+* __Configuration:__ Each EnhacementEngien MAY provide an RDF graph with its
configuration. This graph will be returned on GET request on the URL of the
EnhancementEngine. If no configuration is known for the engine this MUST at
least return a single triple with the name for the engine.
+
+_TODO:_ To correctly construct this graph the Engine needs to know this URL.
This could e.g. be provided by some OSGI environment parameter set by the
JerseyApplication. As an alternative we could also parse this URI as an
parameter to the getEngineConfig method.
+-->
+
+<p>Other components such as enhancement Chains do refer to engines by their
name. The actual EnhancementEngine instance is only looked up shortly before
the execution.</p>
+<h3 id="enhancementengine_name_conflicts">EnhancementEngine Name Conflicts</h3>
+<p>As EnhancementEngines are identified by the value of the
"stanbol.enhancer.engine.name" property - the name - there might be cases where
multiple EnhancementEngine are registered for the same name. In such cases the
normal OSGI procedure to select the default service instance of several
possible matches is used. This means that</p>
+<ol>
+<li>the EnhancementEngine with the highest "service.ranking" and</li>
+<li>the EnhancementEngine with the lowest "service.id"</li>
+</ol>
+<p>will be selected on requests for a EnhancementEngine with a given name.
Requests on the RESTful service API will always answer with the
EnhancementEngine selected as default. When using the Java API there are also
means to retrieve all EnhancementEngines for a given name via the <a
href="enhancementenginemanager.html">EnhancementEngineManager</a> interface.</p>
+<p>Out of a user perspective there is one major use case for configuring
multiple enhancement engines for the same name. This is to allow the definition
of fallback engines if the main one becomes unavailable. e.g. lets assume that
a user has a local cache of geonames.org loaded into the Entityhub and
configures an <a href="keywordlinkingengine.html">NamedEntityLinking</a> engine
to perform semantic lifting of extracted locations. However Stanbol also
provides the <a href="geonamesengine.html">geonames.org Engine</a> that
provides a similar functionality by directly accessing <a
href="http://geonames.org">geonames.org</a>. By configuring both engines for
the same name, but specifying a higher service ranking for the one using the
local cache one can ensure that the local cache is used for the enhancement
under normal circumstances. However in case the local cache becomes unavailable
the other engine using the remote service will be used for enhancement.</p>
+<h3 id="enhancementenginemanager_interface">EnhancementEngineManager
interface</h3>
+<p>The <a href="enhancementenginemanager.html">EnhancementEngineManager</a> is
the management interface for EnhancementEngines that can be used by components
to lookup enhancement engines based on their name. There is also OSGI
ServiceTracker like implementation that can be used to track only enhancement
engines registered for a specific set of names. </p>
+<h2 id="enhancementengine_implementations">EnhancementEngine
implementations</h2>
+<p>A list of EnhancementEngine implementations maintained directly by the
Apache Stanbol community can be found <a href="../../engines.html">here</a>.
+However the EnhancementEngine interface is designed in a way that it should be
possible for advanced Apache Stanbol users to implement own EnhancementEngine
implementations fulfilling their special needs.</p>
+<p>The Stanbol Community would be very happy if users decide to share thoughts
about possible enhancement engines or even would like to contribute addition
engines to the Apache Stanbol project.</p>
+ </div>
+
+ <div id="footer">
+ <div class="copyright">
+ <p>
+ Copyright © 2010 The Apache Software Foundation, Licensed under
+ the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache
License, Version 2.0</a>.
+ <br />
+ Apache, Stanbol and the Apache feather and Stanbol logos are
trademarks of The Apache Software Foundation.
+ </p>
+ </div>
+ </div>
+
+</body>
+</html>
Added:
websites/staging/stanbol/trunk/content/stanbol/docs/trunk/enhancer/engines/enhancementenginemanager.html
==============================================================================
---
websites/staging/stanbol/trunk/content/stanbol/docs/trunk/enhancer/engines/enhancementenginemanager.html
(added)
+++
websites/staging/stanbol/trunk/content/stanbol/docs/trunk/enhancer/engines/enhancementenginemanager.html
Fri Jan 27 08:06:37 2012
@@ -0,0 +1,121 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE- 2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+ <link href="/stanbol/css/stanbol.css" rel="stylesheet" type="text/css">
+ <title>Apache Stanbol - EnhancementEngineManager</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <link rel="icon" type="image/png"
href="/stanbol/images/stanbol-logo/stanbol-favicon.png"/>
+</head>
+
+<body>
+ <div id="navigation">
+ <a href="/stanbol/index.html"><img alt="Apache Stanbol" width="220"
height="101" border="0"
src="/stanbol/images/stanbol-logo/stanbol-2010-12-14.png"/></a>
+ <h1 id="stanbol">Stanbol</h1>
+<ul>
+<li><a href="/stanbol/index.html">Home</a></li>
+<li><a href="/stanbol/docs/trunk/tutorial.html">Tutorial</a></li>
+<li><a href="/stanbol/docs/trunk/">Documentation</a></li>
+<li><a href="/stanbol/docs/trunk/building.html">Building</a></li>
+</ul>
+<h1 id="project">Project</h1>
+<ul>
+<li><a href="/stanbol/docs/trunk/mailinglists.html">Mailing Lists</a></li>
+<li><a href="https://issues.apache.org/jira/browse/STANBOL">Issue
Tracker</a></li>
+<li><a href="/stanbol/team.html">Project Team</a></li>
+<li><a href="http://www.apache.org/licenses/LICENSE-2.0">License</a></li>
+</ul>
+<h1 id="downloads">Downloads</h1>
+<ul>
+<li><a href="http://dev.iks-project.eu/downloads/stanbol-launchers/">Pre-built
Launchers</a></li>
+</ul>
+<h1 id="the_asf">The ASF</h1>
+<ul>
+<li><a href="http://www.apache.org">Apache Software Foundation</a></li>
+<li><a href="http://www.apache.org/foundation/thanks.html">Thanks</a></li>
+<li><a href="http://www.apache.org/foundation/sponsorship.html">Become a
Sponsor</a></li>
+<li><a href="http://www.apache.org/security/">Security</a></li>
+</ul>
+ </div>
+
+ <div id="content">
+ <h1 class="title">EnhancementEngineManager</h1>
+ <p>The EnhancementEngineManager provides name based access to all active
<a href="enhancementengine.html">EnhancementEngine</a>s and their
ServiceReferences. This interface is typically used by components that need to
lookup EnhancementEngiens based on their name. However the EngineTracker
implementation can also be used to track specific EnhancementEngines.</p>
+<h3 id="enhancementenginemanager_interface">EnhancementEngineManager
interface</h3>
+<p>This is the Java API providing access to registered EnhancementEngines in
the ways as described above. This interface includes the following methods:</p>
+<div class="codehilite"><pre><span class="sr">/** Getter for all names with
active engines */</span>
+<span class="n">getActiveEngineNames</span><span class="p">()</span> <span
class="p">:</span> <span class="n">Set</span><span
class="sr"><String></span>
+<span class="o">/**</span> <span class="n">Getter</span> <span
class="k">for</span> <span class="n">the</span> <span
class="n">ServiceReference</span> <span class="n">to</span> <span
class="n">the</span> <span class="n">engine</span>
+ <span class="n">with</span> <span class="n">a</span> <span
class="n">given</span> <span class="n">name</span> <span class="o">*/</span>
+<span class="n">getReference</span><span class="p">(</span><span
class="n">String</span> <span class="n">name</span><span class="p">)</span>
<span class="p">:</span> <span class="n">ServiceReference</span>
+<span class="o">/**</span> <span class="n">Getter</span> <span
class="k">for</span> <span class="n">all</span> <span
class="n">ServiceReferences</span> <span class="n">to</span> <span
class="n">engines</span>
+ <span class="n">with</span> <span class="n">a</span> <span
class="n">given</span> <span class="n">name</span> <span
class="n">sorted</span> <span class="n">by</span> <span
class="n">service</span> <span class="n">ranking</span> <span
class="o">*/</span>
+<span class="n">getReferences</span><span class="p">(</span><span
class="n">String</span> <span class="n">name</span><span class="p">)</span>
+<span class="sr">/** Getter for the engine with a given name */</span>
+<span class="o">+</span> <span class="n">getEngine</span><span
class="p">(</span><span class="n">Stirng</span> <span
class="n">name</span><span class="p">)</span> <span class="p">:</span> <span
class="n">EnhancementEngine</span>
+<span class="o">/**</span> <span class="n">Getter</span> <span
class="k">for</span> <span class="n">all</span> <span class="n">engines</span>
<span class="n">with</span> <span class="n">a</span> <span
class="n">given</span> <span class="n">name</span> <span
class="n">sorted</span>
+ <span class="n">by</span> <span class="n">service</span> <span
class="n">ranking</span> <span class="o">*/</span>
+<span class="o">+</span> <span class="n">getEngines</span><span
class="p">(</span><span class="n">String</span> <span
class="n">name</span><span class="p">)</span> <span class="p">:</span> <span
class="n">List</span><span class="sr"><EnhancementEngine></span>
+<span class="sr">/** Getter for an engine based on a service reference
*/</span>
+<span class="o">+</span> <span class="n">getEngine</span><span
class="p">(</span><span class="n">ServiceReference</span> <span
class="nb">ref</span><span class="p">)</span> <span class="p">:</span> <span
class="n">EnhancementEgnie</span>
+<span class="sr">/** Checks if there is an engine for the given name */</span>
+<span class="o">+</span> <span class="n">isEngine</span><span
class="p">(</span><span class="n">String</span> <span
class="n">name</span><span class="p">)</span> <span class="p">:</span> <span
class="n">boolean</span>
+</pre></div>
+
+
+<p>There are two implementations of this interface available:</p>
+<h4 id="enhancementenginemanager_service">EnhancementEngineManager Service</h4>
+<p>This is an implementation of the EnhancementEngineManager interface that is
registered as OSGI service. It can be used e.g. by using the @Reference
annotation</p>
+<div class="codehilite"><pre><span class="nv">@Reference</span>
+<span class="n">EnhancementEngineManager</span> <span
class="n">engineManager</span>
+</pre></div>
+
+
+<p>This service is provided by the "org.apache.stanbol.enhancer.enginemanger"
module and is included in all Stanbol launchers.</p>
+<h4 id="enginestracker">EnginesTracker</h4>
+<p>This is an Utility similar to the standard OSGI ServiceTracker that allows
to track some/all EnhancementEngines. It also supports the usage of a
ServiceTrackerCustomizer so that users of that utility can directly react to
changes of tracked EnhancementEngines.</p>
+<div class="codehilite"><pre><span class="sr">//</span><span
class="n">track</span> <span class="n">only</span> <span
class="s">"myEngine"</span> <span class="ow">and</span> <span
class="s">"otherEngine"</span>
+<span class="n">EnginesTracker</span> <span class="n">tracker</span> <span
class="o">=</span> <span class="k">new</span> <span
class="n">EnginesTracker</span><span class="p">(</span>
+ <span class="n">context</span><span class="p">,</span> <span
class="s">"myEngine"</span><span class="p">,</span><span
class="s">"otherEngine"</span><span class="p">);</span>
+<span class="n">tracker</span><span class="o">.</span><span
class="nb">open</span><span class="p">();</span> <span
class="sr">//s</span><span class="n">tart</span> <span class="n">tracking</span>
+
+<span class="sr">//</span><span class="n">the</span> <span
class="n">tracker</span> <span class="n">need</span> <span class="n">to</span>
<span class="n">be</span> <span class="n">closed</span> <span
class="k">if</span> <span class="nb">no</span> <span class="n">longer</span>
<span class="n">needed</span>
+<span class="n">tracker</span><span class="o">.</span><span
class="nb">close</span><span class="p">()</span>
+<span class="n">tracker</span> <span class="o">=</span> <span
class="n">null</span><span class="p">;</span>
+</pre></div>
+
+
+<p>For most users the EnhancementEgingeManager service is sufficient and
preferable. Direct use of the EngineTracker is only recommended if one needs
only to track some specific engines and especially if one needs to get notified
an changes of such engines.</p>
+<p>The implementation of the <a
href="http://svn.apache.org/repos/asf/incubator/stanbol/trunk/enhancer/chain/weighted/src/main/java/org/apache/stanbol/enhancer/chain/weighted/impl/WeightedChain.java">WeightedChain</a>
is a good example for the intended usage of the EnginesTracker.</p>
+ </div>
+
+ <div id="footer">
+ <div class="copyright">
+ <p>
+ Copyright © 2010 The Apache Software Foundation, Licensed under
+ the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache
License, Version 2.0</a>.
+ <br />
+ Apache, Stanbol and the Apache feather and Stanbol logos are
trademarks of The Apache Software Foundation.
+ </p>
+ </div>
+ </div>
+
+</body>
+</html>