Author: meric
Date: Thu Feb 28 14:29:28 2013
New Revision: 1451212

URL: http://svn.apache.org/r1451212
Log:
STANBOL-499 Class structures are changed to allow multiple SemanticIndex 
implementation

* In order to allow new index implementation, some abstract classes are created 
from SolrSemanticIndex.
  - AbstractSemanticIndex: Common functionalities except ldpath specific ones 
are moved to this class.
  - AbstractLDPathSemanticIndex: Common ldpath related functionalities are 
moved this class. It extends AbstractSemanticIndex
* pom versions are updated
* Default configuration is added for the creation of the default 
SolrSemanticIndex

Added:
    
stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/AbstractSemanticIndex.java
Modified:
    
stanbol/branches/contenthub-two-layered-structure/contenthub/defaults/pom.xml
    
stanbol/branches/contenthub-two-layered-structure/contenthub/defaults/src/main/resources/config/org.apache.stanbol.commons.solr.managed.impl.ManagedSolrServerImpl-contenthub.config
    
stanbol/branches/contenthub-two-layered-structure/contenthub/defaults/src/main/resources/config/org.apache.stanbol.contenthub.index.solr.SolrSemanticIndex-default.config
    stanbol/branches/contenthub-two-layered-structure/contenthub/index/pom.xml
    
stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/AbstractLDPathSemanticIndex.java
    
stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/SemanticIndexMetadataManager.java
    
stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/solr/LDPathUtils.java
    
stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/solr/SolrSemanticIndex.java
    
stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/solr/SolrSemanticIndexFactory.java

Modified: 
stanbol/branches/contenthub-two-layered-structure/contenthub/defaults/pom.xml
URL: 
http://svn.apache.org/viewvc/stanbol/branches/contenthub-two-layered-structure/contenthub/defaults/pom.xml?rev=1451212&r1=1451211&r2=1451212&view=diff
==============================================================================
--- 
stanbol/branches/contenthub-two-layered-structure/contenthub/defaults/pom.xml 
(original)
+++ 
stanbol/branches/contenthub-two-layered-structure/contenthub/defaults/pom.xml 
Thu Feb 28 14:29:28 2013
@@ -22,9 +22,9 @@
 
   <parent>
     <groupId>org.apache.stanbol</groupId>
-    <artifactId>org.apache.stanbol.contenthub.parent</artifactId>
-    <version>0.10.0-incubating-SNAPSHOT</version>
-    <relativePath>../parent</relativePath>
+    <artifactId>apache-stanbol-contenthub</artifactId>
+    <version>0.11.0-SNAPSHOT</version>
+    <relativePath>..</relativePath>
   </parent>
 
   <artifactId>org.apache.stanbol.contenthub.defaults</artifactId>

Modified: 
stanbol/branches/contenthub-two-layered-structure/contenthub/defaults/src/main/resources/config/org.apache.stanbol.commons.solr.managed.impl.ManagedSolrServerImpl-contenthub.config
URL: 
http://svn.apache.org/viewvc/stanbol/branches/contenthub-two-layered-structure/contenthub/defaults/src/main/resources/config/org.apache.stanbol.commons.solr.managed.impl.ManagedSolrServerImpl-contenthub.config?rev=1451212&r1=1451211&r2=1451212&view=diff
==============================================================================
--- 
stanbol/branches/contenthub-two-layered-structure/contenthub/defaults/src/main/resources/config/org.apache.stanbol.commons.solr.managed.impl.ManagedSolrServerImpl-contenthub.config
 (original)
+++ 
stanbol/branches/contenthub-two-layered-structure/contenthub/defaults/src/main/resources/config/org.apache.stanbol.commons.solr.managed.impl.ManagedSolrServerImpl-contenthub.config
 Thu Feb 28 14:29:28 2013
@@ -1,3 +1,3 @@
-org.apache.solr.core.CoreContainer.name="contenthub"
+org.apache.solr.core.CoreContainer.name="contenthubSolrSemanticIndex"
 service.ranking=I"0"
 org.apache.solr.core.CoreContainer.publishREST=B"true"
\ No newline at end of file

Modified: 
stanbol/branches/contenthub-two-layered-structure/contenthub/defaults/src/main/resources/config/org.apache.stanbol.contenthub.index.solr.SolrSemanticIndex-default.config
URL: 
http://svn.apache.org/viewvc/stanbol/branches/contenthub-two-layered-structure/contenthub/defaults/src/main/resources/config/org.apache.stanbol.contenthub.index.solr.SolrSemanticIndex-default.config?rev=1451212&r1=1451211&r2=1451212&view=diff
==============================================================================
--- 
stanbol/branches/contenthub-two-layered-structure/contenthub/defaults/src/main/resources/config/org.apache.stanbol.contenthub.index.solr.SolrSemanticIndex-default.config
 (original)
+++ 
stanbol/branches/contenthub-two-layered-structure/contenthub/defaults/src/main/resources/config/org.apache.stanbol.contenthub.index.solr.SolrSemanticIndex-default.config
 Thu Feb 28 14:29:28 2013
@@ -1,6 +1,6 @@
-Semantic-Index-Name="contenthub"
-Semantic-Index-Description="Default\ instance\ for\ the\ LDPathSemanticIndex"
-org.apache.stanbol.contenthub.index.ldpath.LDPathSemanticIndex.ldPathProgram="@prefix\
 dbp-ont:\ <http://dbpedia.org/ontology/>;\
+Semantic-Index-Name="contenthubSolrSemanticIndex"
+Semantic-Index-Description="Default\ instance\ for\ the\ SolrSemanticIndex"
+org.apache.stanbol.contenthub.index.AbstractLDPathSemanticIndex.ldPathProgram="@prefix\
 dbp-ont:\ <http://dbpedia.org/ontology/>;\
 @prefix\ dbp-prop:\ <http://dbpedia.org/property/>;\
 @prefix\ foaf\ :\ <http://xmlns.com/foaf/0.1/>;\
 \
@@ -21,9 +21,7 @@ place_leaders\ \=\ dbp-prop:leaderName/r
 \
 entity_given_names\ \=\ foaf:givenName\ ::\ xsd:string;\
 entity_captions\ \=\ dbp-prop:caption\ ::\ xsd:string;"
-org.apache.stanbol.contenthub.index.ldpath.LDPathSemanticIndex.indexContent=B"true"
-org.apache.stanbol.contenthub.index.ldpath.LDPathSemanticIndex.batchSize=I"10"
-org.apache.stanbol.contenthub.index.ldpath.LDPathSemanticIndex.indexingSourceName="contenthubFileStore"
-org.apache.stanbol.contenthub.index.ldpath.LDPathSemanticIndex.indexingSourceCheckPeriod=I"5"
-org.apache.stanbol.contenthub.index.ldpath.LDPathSemanticIndex.solrCheckTime=I"5"
+org.apache.stanbol.contenthub.index.AbstractSemanticIndex.batchSize=I"10"
+org.apache.stanbol.contenthub.index.AbstractSemanticIndex.indexingSourceName="contenthubFileStore"
+org.apache.stanbol.contenthub.index.AbstractSemanticIndex.indexingSourceCheckPeriod=I"5"
 service.ranking=I"0"
\ No newline at end of file

Modified: 
stanbol/branches/contenthub-two-layered-structure/contenthub/index/pom.xml
URL: 
http://svn.apache.org/viewvc/stanbol/branches/contenthub-two-layered-structure/contenthub/index/pom.xml?rev=1451212&r1=1451211&r2=1451212&view=diff
==============================================================================
--- stanbol/branches/contenthub-two-layered-structure/contenthub/index/pom.xml 
(original)
+++ stanbol/branches/contenthub-two-layered-structure/contenthub/index/pom.xml 
Thu Feb 28 14:29:28 2013
@@ -22,15 +22,15 @@
 
   <parent>
     <groupId>org.apache.stanbol</groupId>
-    <artifactId>org.apache.stanbol.contenthub.parent</artifactId>
-    <version>0.10.0-incubating-SNAPSHOT</version>
-    <relativePath>../parent</relativePath>
+    <artifactId>apache-stanbol-contenthub</artifactId>
+    <version>0.11.0-SNAPSHOT</version>
+    <relativePath>..</relativePath>
   </parent>
 
   <artifactId>org.apache.stanbol.contenthub.index</artifactId>
   <packaging>bundle</packaging>
 
-  <name>Apache Stanbol Contenthub LDPath Based Semantic Index</name>
+  <name>Apache Stanbol Contenthub Semantic Index</name>
 
   <build>
     <plugins>
@@ -49,42 +49,47 @@
     <dependency>
       <groupId>org.apache.stanbol</groupId>
       <artifactId>org.apache.stanbol.contenthub.servicesapi</artifactId>
-      <version>0.10.0-incubating-SNAPSHOT</version>
+      <version>0.11.0-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.apache.stanbol</groupId>
       <artifactId>org.apache.stanbol.contenthub.store.file</artifactId>
-      <version>0.10.0-incubating-SNAPSHOT</version>
+      <version>0.11.0-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.apache.stanbol</groupId>
       
<artifactId>org.apache.stanbol.commons.stanboltools.datafileprovider</artifactId>
-      <version>0.10.0-incubating-SNAPSHOT</version>
+      <version>0.10.0-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.apache.stanbol</groupId>
       <artifactId>org.apache.stanbol.commons.solr.core</artifactId>
-      <version>0.10.1-incubating-SNAPSHOT</version>
+      <version>0.10.1-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.apache.stanbol</groupId>
       <artifactId>org.apache.stanbol.commons.solr.managed</artifactId>
-      <version>0.10.0-incubating-SNAPSHOT</version>
+      <version>0.10.0-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.apache.stanbol</groupId>
       
<artifactId>org.apache.stanbol.commons.semanticindex.servicesapi</artifactId>
-      <version>0.10.0-incubating-SNAPSHOT</version>
+      <version>0.12.0-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.apache.stanbol</groupId>
       <artifactId>org.apache.stanbol.entityhub.ldpath</artifactId>
-      <version>0.11.0-incubating-SNAPSHOT</version>
+      <version>0.11.0</version>
     </dependency>
     <dependency>
       <groupId>org.apache.stanbol</groupId>
       <artifactId>org.apache.stanbol.enhancer.ldpath</artifactId>
-      <version>0.10.0-incubating-SNAPSHOT</version>
+      <version>0.10.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.clerezza</groupId>
+      <artifactId>rdf.jena.tdb.storage</artifactId>
+      <version>0.6-incubating-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>at.newmedialab.ldpath</groupId>

Modified: 
stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/AbstractLDPathSemanticIndex.java
URL: 
http://svn.apache.org/viewvc/stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/AbstractLDPathSemanticIndex.java?rev=1451212&r1=1451211&r2=1451212&view=diff
==============================================================================
--- 
stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/AbstractLDPathSemanticIndex.java
 (original)
+++ 
stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/AbstractLDPathSemanticIndex.java
 Thu Feb 28 14:29:28 2013
@@ -17,8 +17,6 @@
 package org.apache.stanbol.contenthub.index;
 
 import java.io.StringReader;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
 import java.util.Collection;
 import java.util.Dictionary;
 import java.util.HashMap;
@@ -34,10 +32,7 @@ import org.apache.felix.scr.annotations.
 import org.apache.felix.scr.annotations.Reference;
 import org.apache.stanbol.commons.semanticindex.index.IndexException;
 import org.apache.stanbol.commons.semanticindex.index.IndexManagementException;
-import org.apache.stanbol.commons.semanticindex.index.IndexState;
 import org.apache.stanbol.commons.semanticindex.index.SemanticIndex;
-import org.apache.stanbol.commons.semanticindex.store.ChangeSet;
-import org.apache.stanbol.commons.semanticindex.store.EpochException;
 import org.apache.stanbol.commons.semanticindex.store.IndexingSource;
 import org.apache.stanbol.commons.semanticindex.store.StoreException;
 import org.apache.stanbol.contenthub.index.solr.LDPathUtils;
@@ -51,10 +46,6 @@ import org.apache.stanbol.entityhub.ldpa
 import org.apache.stanbol.entityhub.servicesapi.model.Representation;
 import org.apache.stanbol.entityhub.servicesapi.model.ValueFactory;
 import org.apache.stanbol.entityhub.servicesapi.site.SiteManager;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
 import org.osgi.service.cm.ConfigurationException;
 import org.osgi.service.component.ComponentContext;
 import org.osgi.service.component.ComponentException;
@@ -80,60 +71,21 @@ import at.newmedialab.ldpath.model.progr
  * @author suat
  * 
  */
-@Properties(value = {
-                     @Property(name = SemanticIndex.PROP_NAME),
-                     @Property(name = SemanticIndex.PROP_DESCRIPTION),
-                     @Property(name = 
AbstractLDPathSemanticIndex.PROP_LD_PATH_PROGRAM),
-                     @Property(name = 
AbstractLDPathSemanticIndex.PROP_BATCH_SIZE, intValue = 10),
-                     @Property(name = 
AbstractLDPathSemanticIndex.PROP_INDEXING_SOURCE_NAME, value = 
"contenthubFileStore"),
-                     @Property(name = 
AbstractLDPathSemanticIndex.PROP_INDEXING_SOURCE_CHECK_PERIOD, intValue = 10),
-                     @Property(name = Constants.SERVICE_RANKING, intValue = 
0)})
-public abstract class AbstractLDPathSemanticIndex implements 
SemanticIndex<ContentItem> {
+@Properties(value = {@Property(name = 
AbstractLDPathSemanticIndex.PROP_LD_PATH_PROGRAM)})
+public abstract class AbstractLDPathSemanticIndex extends 
AbstractSemanticIndex {
 
     private static final Logger logger = 
LoggerFactory.getLogger(AbstractLDPathSemanticIndex.class);
 
     public static final String PROP_LD_PATH_PROGRAM = 
"org.apache.stanbol.contenthub.index.AbstractLDPathSemanticIndex.ldPathProgram";
-    public static final String PROP_INDEXING_SOURCE_CHECK_PERIOD = 
"org.apache.stanbol.contenthub.index.AbstractLDPathSemanticIndex.indexingSourceCheckPeriod";
-    public static final String PROP_INDEXING_SOURCE_NAME = 
"org.apache.stanbol.contenthub.index.AbstractLDPathSemanticIndex.indexingSourceName";
-    public static final String PROP_BATCH_SIZE = 
"org.apache.stanbol.contenthub.index.AbstractLDPathSemanticIndex.batchSize";
 
-    protected String name;
-    protected String description;
     protected String ldPathProgram;
     protected Program<Object> objectProgram;
-    protected int batchSize;
-    protected int indexingSourceCheckPeriod;
-    protected long epoch;
-    protected long revision = Long.MIN_VALUE;
-    protected volatile IndexState state = IndexState.UNINIT;
-    protected String pid;
-    protected ComponentContext componentContext;
-    private Integer indexingCount;
-    // store update check thread
-    private Thread pollingThread;
-    private volatile Boolean deactivate = new Boolean(false);
-    // reindexer thread
-    protected Thread reindexerThread;
-    protected IndexingSource<ContentItem> indexingSource;
     protected SemanticIndexMetadataManager semanticIndexMetadataManager;
 
     @Reference
     protected SiteManager siteManager;
 
     /**
-     * Updates metadata of the index persistently
-     * 
-     * @throws IndexException
-     */
-    protected abstract void updateIndexMetadata() throws IndexException;
-
-    /**
-     * Starts the reindexing operation within the index. This situation occurs 
when the LDPath of the index
-     * changes.
-     */
-    protected abstract void startReindexing();
-
-    /**
      * Initializes the common properties to be obtained from the {@link 
ComponentContext}. Furthermore, this
      * method tries to fetch the specified {@link IndexingSource} from the 
OSGi environment. This method is
      * expected to be called in the {@code activate} method of the actual 
implementation of this abstract
@@ -150,66 +102,14 @@ public abstract class AbstractLDPathSema
                                                               IndexException,
                                                               
IndexManagementException,
                                                               StoreException {
+        super.activate(componentContext);
         @SuppressWarnings("rawtypes")
         Dictionary properties = componentContext.getProperties();
-        this.name = (String) OsgiUtils.checkProperty(properties, 
SemanticIndex.PROP_NAME);
         this.ldPathProgram = (String) OsgiUtils.checkProperty(properties,
             AbstractLDPathSemanticIndex.PROP_LD_PATH_PROGRAM);
-        this.description = (String) OsgiUtils.checkProperty(properties, 
SemanticIndex.PROP_DESCRIPTION);
-        this.batchSize = (Integer) OsgiUtils.checkProperty(properties,
-            AbstractLDPathSemanticIndex.PROP_BATCH_SIZE);
-        this.indexingSourceCheckPeriod = (Integer) 
OsgiUtils.checkProperty(properties,
-            AbstractLDPathSemanticIndex.PROP_INDEXING_SOURCE_CHECK_PERIOD);
-        this.componentContext = componentContext;
-        this.indexingCount = 0;
-        this.pid = (String) properties.get(Constants.SERVICE_PID);
-
-        initializeIndexingSource((String) OsgiUtils.checkProperty(properties,
-            AbstractLDPathSemanticIndex.PROP_INDEXING_SOURCE_NAME), 
componentContext);
         initializeLDPathProgram();
     }
 
-    protected void deactivate(ComponentContext componentContext) {
-        // close store check thread and solr core tracker
-        deactivate = true;
-        if (pollingThread != null) {
-            pollingThread.interrupt();
-        }
-    }
-
-    @SuppressWarnings("unchecked")
-    private void initializeIndexingSource(String indexingSourceName, 
ComponentContext componentContext) throws ConfigurationException {
-        BundleContext bundleContext = componentContext.getBundleContext();
-        try {
-            ServiceReference[] indexingSources = 
bundleContext.getServiceReferences(
-                IndexingSource.class.getName(), null);
-            for (ServiceReference serviceReference : indexingSources) {
-                Object indexingSource = 
bundleContext.getService(serviceReference);
-                Type[] genericInterfaces = 
indexingSource.getClass().getGenericInterfaces();
-                if (genericInterfaces.length == 1 && genericInterfaces[0] 
instanceof ParameterizedType) {
-                    Type[] types = ((ParameterizedType) 
genericInterfaces[0]).getActualTypeArguments();
-                    try {
-                        @SuppressWarnings("unused")
-                        Class<ContentItem> contentItemClass = 
(Class<ContentItem>) types[0];
-                        if (((IndexingSource<ContentItem>) 
indexingSource).getName().equals(
-                            indexingSourceName)) {
-                            this.indexingSource = 
(IndexingSource<ContentItem>) indexingSource;
-                        }
-                    } catch (ClassCastException e) {
-                        // ignore
-                    }
-                }
-            }
-            if (this.indexingSource == null) {
-                throw new 
ConfigurationException(AbstractLDPathSemanticIndex.PROP_INDEXING_SOURCE_NAME,
-                        "There is no IndexingSource<ContentItem> for the given 
IndexingSource name: "
-                                + indexingSourceName);
-            }
-        } catch (InvalidSyntaxException e) {
-            // ignore as there is no filter
-        }
-    }
-
     private void initializeLDPathProgram() throws IndexException, 
IndexManagementException {
         // create program for EntityhubLDPath
         SiteManagerBackend backend = new SiteManagerBackend(siteManager);
@@ -223,39 +123,6 @@ public abstract class AbstractLDPathSema
         }
     }
 
-    @Override
-    public String getName() {
-        return this.name;
-    }
-
-    @Override
-    public Class<ContentItem> getIntdexType() {
-        return ContentItem.class;
-    }
-
-    @Override
-    public String getDescription() {
-        return this.description;
-    }
-
-    @Override
-    public IndexState getState() {
-        synchronized (state) {
-            return state;
-        }
-    }
-
-    @Override
-    public void persist(long revision) throws IndexException {
-        this.revision = revision;
-        updateIndexMetadata();
-    }
-
-    @Override
-    public long getRevision() {
-        return this.revision;
-    }
-
     /**
      * Checks whether the name of the associated {@link IndexingSource} or 
name of the index has been changed.
      * 
@@ -279,9 +146,8 @@ public abstract class AbstractLDPathSema
         }
 
         // name of the indexing source has changed
-        if (!indexingSourceName
-                
.equals(oldMetadata.get(AbstractLDPathSemanticIndex.PROP_INDEXING_SOURCE_NAME)))
 {
-            throw new 
ConfigurationException(AbstractLDPathSemanticIndex.PROP_INDEXING_SOURCE_NAME,
+        if 
(!indexingSourceName.equals(oldMetadata.get(AbstractSemanticIndex.PROP_INDEXING_SOURCE_NAME)))
 {
+            throw new 
ConfigurationException(AbstractSemanticIndex.PROP_INDEXING_SOURCE_NAME,
                     "For the time being, it is not allowed to change the name 
of the indexing source.");
         }
     }
@@ -305,39 +171,6 @@ public abstract class AbstractLDPathSema
     }
 
     /**
-     * Increases the counter e.g the {@link #indexingCount} by one. This means 
that a client is occupying the
-     * index for an indexing operation. For each separate request the counter 
is increased by one.
-     * Furthermore, this method sets the state of the index as {@link 
IndexState#INDEXING} and updates the
-     * metadata of the index persistently.
-     * 
-     * @throws IndexException
-     */
-    protected void semUp() throws IndexException {
-        synchronized (this.indexingCount) {
-            this.indexingCount++;
-            this.state = IndexState.INDEXING;
-            updateIndexMetadata();
-        }
-    }
-
-    /**
-     * Decreases the counter e.g the {@link #indexingCount} by one. This means 
that a client has finished the
-     * interaction with the index. Furthermore, this method sets the state of 
the index as
-     * {@link IndexState#ACTIVE} and updates the metadata of the index 
persistently.
-     * 
-     * @throws IndexException
-     */
-    protected void semDown() throws IndexException {
-        synchronized (this.indexingCount) {
-            this.indexingCount--;
-            if (this.indexingCount == 0) {
-                this.state = IndexState.ACTIVE;
-                updateIndexMetadata();
-            }
-        }
-    }
-
-    /**
      * This method executes the LDPath program, which was used to configure 
this index, on the enhancements of
      * submitted content by means of the Entityhub. In other words, additional 
information is gathered from
      * the Entityhub for each entity detected in the enhancements by querying 
the ldpath of this index.
@@ -395,7 +228,9 @@ public abstract class AbstractLDPathSema
             Map<String,Collection<?>> ciBackendResults = 
resourceProgram.execute(contentItemBackend,
                 ci.getUri());
             for (Entry<String,Collection<?>> result : 
ciBackendResults.entrySet()) {
-                if (results.containsKey(result.getKey())) {
+                if (result.getValue().isEmpty()) {
+                    continue;
+                } else if (results.containsKey(result.getKey())) {
                     @SuppressWarnings("unchecked")
                     Collection<Object> resultsValue = (Collection<Object>) 
results.get(result.getKey());
                     resultsValue.addAll(result.getValue());
@@ -411,97 +246,4 @@ public abstract class AbstractLDPathSema
         return results;
     }
 
-    /**
-     * Starts to poll the changes from the associated {@link IndexingSource} 
using a
-     * {@link IndexingSourceUpdateChecker}
-     */
-    protected void startIndexingSourceCheckThread() {
-        pollingThread = new Thread(new IndexingSourceUpdateChecker(), 
"IndexingSourceUpdateChecker");
-        pollingThread.start();
-    }
-
-    /**
-     * Separate thread to poll changes in the {@link IndexingSource}
-     * 
-     * @author meric
-     * 
-     */
-    private class IndexingSourceUpdateChecker implements Runnable {
-        @Override
-        public void run() {
-            while (!deactivate) {
-                logger.info("Pooling thread for index: {} will check the 
changes", name);
-                // if the polling thread is interrupted i.e the parent index 
component is deactivated,
-                // stop polling
-                if (Thread.currentThread().isInterrupted()) {
-                    return;
-                }
-
-                ChangeSet changeSet = null;
-                try {
-                    changeSet = indexingSource.changes(epoch, revision, 
batchSize);
-                } catch (StoreException e) {
-                    logger.error(
-                        String.format(
-                            "Failed to get changes from FileRevisionManager 
with start revision: %s and batch size: %s for IndexingSource: %s",
-                            revision, batchSize, indexingSource.getName()), e);
-                } catch (EpochException e) {
-                    if (e.getActiveEpoch() > e.getRequestEpoch()) {
-                        // epoch of the IndexingSource has increased. So, a 
reindexing is needed.
-                        // Start the reindexing thread and terminate this one
-                        logger.info(
-                            "Epoch of the IndexingSource: {} has increase. So, 
a reindexing will be in progress",
-                            indexingSource.getName());
-                        epoch = e.getActiveEpoch();
-                        state = IndexState.REINDEXING;
-                        startReindexing();
-                        return;
-                    }
-                }
-                if (changeSet != null) {
-                    Iterator<String> changedItems = changeSet.iterator();
-                    boolean persist = true;
-                    while (changedItems.hasNext()) {
-                        String changedItem = changedItems.next();
-                        ContentItem ci;
-                        try {
-                            ci = indexingSource.get(changedItem);
-                            if (ci != null) {
-                                index(ci);
-                                logger.info("ContentItem with Uri {} is 
indexed to {}", changedItem, name);
-                            } else {
-                                remove(changedItem);
-                            }
-
-                        } catch (StoreException e) {
-                            logger.error("Failed to retrieve contentitem with 
uri: {}", changedItem);
-                            persist = false;
-                            break;
-                        } catch (IndexException e) {
-                            logger.error("Failed to index contentitem with 
uri: {}", changedItem);
-                            persist = false;
-                            break;
-                        }
-                    }
-                    if (persist) {
-                        try {
-                            if (changeSet.iterator().hasNext()) {
-                                persist(changeSet.toRevision());
-                            }
-                        } catch (IndexException e) {
-                            logger.error("Index revision cannot be persist", 
e);
-                        }
-                    }
-                }
-                try {
-                    Thread.sleep(1000 * indexingSourceCheckPeriod);
-                } catch (InterruptedException e) {
-                    logger.info(
-                        "Indexing Source Checker for index: {} is interrupted 
while sleeping. Closing the thread",
-                        name);
-                    return;
-                }
-            }
-        }
-    }
 }

Added: 
stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/AbstractSemanticIndex.java
URL: 
http://svn.apache.org/viewvc/stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/AbstractSemanticIndex.java?rev=1451212&view=auto
==============================================================================
--- 
stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/AbstractSemanticIndex.java
 (added)
+++ 
stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/AbstractSemanticIndex.java
 Thu Feb 28 14:29:28 2013
@@ -0,0 +1,310 @@
+package org.apache.stanbol.contenthub.index;
+
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.util.Dictionary;
+import java.util.Iterator;
+
+import org.apache.felix.scr.annotations.Properties;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.stanbol.commons.semanticindex.index.IndexException;
+import org.apache.stanbol.commons.semanticindex.index.IndexManagementException;
+import org.apache.stanbol.commons.semanticindex.index.IndexState;
+import org.apache.stanbol.commons.semanticindex.index.SemanticIndex;
+import org.apache.stanbol.commons.semanticindex.store.ChangeSet;
+import org.apache.stanbol.commons.semanticindex.store.EpochException;
+import org.apache.stanbol.commons.semanticindex.store.IndexingSource;
+import org.apache.stanbol.commons.semanticindex.store.StoreException;
+import org.apache.stanbol.enhancer.servicesapi.ContentItem;
+import org.apache.stanbol.entityhub.core.utils.OsgiUtils;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.cm.ConfigurationException;
+import org.osgi.service.component.ComponentContext;
+import org.osgi.service.component.ComponentException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@Properties(value = {
+                     @Property(name = SemanticIndex.PROP_NAME),
+                     @Property(name = SemanticIndex.PROP_DESCRIPTION),
+                     @Property(name = AbstractSemanticIndex.PROP_BATCH_SIZE, 
intValue = 10),
+                     @Property(name = 
AbstractSemanticIndex.PROP_INDEXING_SOURCE_NAME, value = "contenthubFileStore"),
+                     @Property(name = 
AbstractSemanticIndex.PROP_INDEXING_SOURCE_CHECK_PERIOD, intValue = 10),
+                     @Property(name = Constants.SERVICE_RANKING, intValue = 
0)})
+public abstract class AbstractSemanticIndex implements 
SemanticIndex<ContentItem> {
+
+    private static final Logger logger = 
LoggerFactory.getLogger(AbstractSemanticIndex.class);
+
+    public static final String PROP_INDEXING_SOURCE_CHECK_PERIOD = 
"org.apache.stanbol.contenthub.index.AbstractSemanticIndex.indexingSourceCheckPeriod";
+    public static final String PROP_INDEXING_SOURCE_NAME = 
"org.apache.stanbol.contenthub.index.AbstractSemanticIndex.indexingSourceName";
+    public static final String PROP_BATCH_SIZE = 
"org.apache.stanbol.contenthub.index.AbstractSemanticIndex.batchSize";
+
+    protected String name;
+    protected String description;
+    protected long revision = Long.MIN_VALUE;
+    protected volatile IndexState state = IndexState.UNINIT;
+    protected int batchSize;
+    protected long epoch;
+    private volatile Boolean deactivate = new Boolean(false);
+    protected int indexingSourceCheckPeriod;
+    protected IndexingSource<ContentItem> indexingSource;
+    protected String pid;
+    protected ComponentContext componentContext;
+    private Integer indexingCount;
+    // store update check thread
+    private Thread pollingThread;
+    // reindexer thread
+    protected Thread reindexerThread;
+
+    @Override
+    public String getName() {
+        return this.name;
+    }
+
+    @Override
+    public Class<ContentItem> getIntdexType() {
+        return ContentItem.class;
+    }
+
+    @Override
+    public String getDescription() {
+        return this.description;
+    }
+
+    @Override
+    public IndexState getState() {
+        synchronized (state) {
+            return state;
+        }
+    }
+
+    @Override
+    public void persist(long revision) throws IndexException {
+        this.revision = revision;
+        updateIndexMetadata();
+    }
+
+    @Override
+    public long getRevision() {
+        return this.revision;
+    }
+
+    /**
+     * Initializes the common properties to be obtained from the {@link 
ComponentContext}. Furthermore, this
+     * method tries to fetch the specified {@link IndexingSource} from the 
OSGi environment. This method is
+     * expected to be called in the {@code activate} method of the actual 
implementation of this abstract
+     * class.
+     * 
+     * @param componentContext
+     *            {@link ComponentException} of the actual implementation of 
this abstract class
+     * @throws ConfigurationException
+     * @throws IndexException
+     * @throws IndexManagementException
+     * @throws StoreException
+     */
+    protected void activate(ComponentContext componentContext) throws 
ConfigurationException,
+                                                              IndexException,
+                                                              
IndexManagementException,
+                                                              StoreException {
+        @SuppressWarnings("rawtypes")
+        Dictionary properties = componentContext.getProperties();
+        this.name = (String) OsgiUtils.checkProperty(properties, 
SemanticIndex.PROP_NAME);
+        this.description = (String) OsgiUtils.checkProperty(properties, 
SemanticIndex.PROP_DESCRIPTION);
+        this.batchSize = (Integer) OsgiUtils.checkProperty(properties, 
AbstractSemanticIndex.PROP_BATCH_SIZE);
+        this.indexingSourceCheckPeriod = (Integer) 
OsgiUtils.checkProperty(properties,
+            AbstractSemanticIndex.PROP_INDEXING_SOURCE_CHECK_PERIOD);
+        this.componentContext = componentContext;
+        this.indexingCount = 0;
+        this.pid = (String) properties.get(Constants.SERVICE_PID);
+
+        initializeIndexingSource(
+            (String) OsgiUtils.checkProperty(properties, 
AbstractSemanticIndex.PROP_INDEXING_SOURCE_NAME),
+            componentContext);
+    }
+
+    protected void deactivate(ComponentContext componentContext) {
+        // close store check thread and solr core tracker
+        deactivate = true;
+        if (pollingThread != null) {
+            pollingThread.interrupt();
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    private void initializeIndexingSource(String indexingSourceName, 
ComponentContext componentContext) throws ConfigurationException {
+        BundleContext bundleContext = componentContext.getBundleContext();
+        try {
+            ServiceReference[] indexingSources = 
bundleContext.getServiceReferences(
+                IndexingSource.class.getName(), null);
+            for (ServiceReference serviceReference : indexingSources) {
+                Object indexingSource = 
bundleContext.getService(serviceReference);
+                Type[] genericInterfaces = 
indexingSource.getClass().getGenericInterfaces();
+                if (genericInterfaces.length == 1 && genericInterfaces[0] 
instanceof ParameterizedType) {
+                    Type[] types = ((ParameterizedType) 
genericInterfaces[0]).getActualTypeArguments();
+                    try {
+                        @SuppressWarnings("unused")
+                        Class<ContentItem> contentItemClass = 
(Class<ContentItem>) types[0];
+                        if (((IndexingSource<ContentItem>) 
indexingSource).getName().equals(
+                            indexingSourceName)) {
+                            this.indexingSource = 
(IndexingSource<ContentItem>) indexingSource;
+                        }
+                    } catch (ClassCastException e) {
+                        // ignore
+                    }
+                }
+            }
+            if (this.indexingSource == null) {
+                throw new 
ConfigurationException(AbstractSemanticIndex.PROP_INDEXING_SOURCE_NAME,
+                        "There is no IndexingSource<ContentItem> for the given 
IndexingSource name: "
+                                + indexingSourceName);
+            }
+        } catch (InvalidSyntaxException e) {
+            // ignore as there is no filter
+        }
+    }
+
+    /**
+     * Updates metadata of the index persistently
+     * 
+     * @throws IndexException
+     */
+    protected abstract void updateIndexMetadata() throws IndexException;
+
+    /**
+     * Starts the reindexing operation within the index. This situation occurs 
when the LDPath of the index
+     * changes.
+     */
+    protected abstract void startReindexing();
+
+    /**
+     * Starts to poll the changes from the associated {@link IndexingSource} 
using a
+     * {@link IndexingSourceUpdateChecker}
+     */
+    protected void startIndexingSourceCheckThread() {
+        pollingThread = new Thread(new IndexingSourceUpdateChecker(), 
"IndexingSourceUpdateChecker");
+        pollingThread.start();
+    }
+
+    /**
+     * Increases the counter e.g the {@link #indexingCount} by one. This means 
that a client is occupying the
+     * index for an indexing operation. For each separate request the counter 
is increased by one.
+     * Furthermore, this method sets the state of the index as {@link 
IndexState#INDEXING} and updates the
+     * metadata of the index persistently.
+     * 
+     * @throws IndexException
+     */
+    protected void semUp() throws IndexException {
+        synchronized (this.indexingCount) {
+            this.indexingCount++;
+            this.state = IndexState.INDEXING;
+            updateIndexMetadata();
+        }
+    }
+
+    /**
+     * Decreases the counter e.g the {@link #indexingCount} by one. This means 
that a client has finished the
+     * interaction with the index. Furthermore, this method sets the state of 
the index as
+     * {@link IndexState#ACTIVE} and updates the metadata of the index 
persistently.
+     * 
+     * @throws IndexException
+     */
+    protected void semDown() throws IndexException {
+        synchronized (this.indexingCount) {
+            this.indexingCount--;
+            if (this.indexingCount == 0) {
+                this.state = IndexState.ACTIVE;
+                updateIndexMetadata();
+            }
+        }
+    }
+
+    /**
+     * Separate thread to poll changes in the {@link IndexingSource}
+     * 
+     * @author meric
+     * 
+     */
+    private class IndexingSourceUpdateChecker implements Runnable {
+        @Override
+        public void run() {
+            while (!deactivate) {
+                logger.debug("Polling thread for index: {} will check the 
changes", name);
+                // if the polling thread is interrupted i.e the parent index
+                // component is deactivated,
+                // stop polling
+                if (Thread.currentThread().isInterrupted()) {
+                    return;
+                }
+
+                ChangeSet changeSet = null;
+                try {
+                    changeSet = indexingSource.changes(epoch, revision, 
batchSize);
+                } catch (StoreException e) {
+                    logger.error(
+                        String.format(
+                            "Failed to get changes from FileRevisionManager 
with start revision: %s and batch size: %s for IndexingSource: %s",
+                            revision, batchSize, indexingSource.getName()), e);
+                } catch (EpochException e) {
+                    if (e.getActiveEpoch() > e.getRequestEpoch()) {
+                        // epoch of the IndexingSource has increased. So, a
+                        // reindexing is needed.
+                        // Start the reindexing thread and terminate this one
+                        logger.info(
+                            "Epoch of the IndexingSource: {} has increase. So, 
a reindexing will be in progress",
+                            indexingSource.getName());
+                        epoch = e.getActiveEpoch();
+                        state = IndexState.REINDEXING;
+                        startReindexing();
+                        return;
+                    }
+                }
+                if (changeSet != null) {
+                    Iterator<String> changedItems = changeSet.iterator();
+                    boolean persist = true;
+                    while (changedItems.hasNext()) {
+                        String changedItem = changedItems.next();
+                        ContentItem ci;
+                        try {
+                            ci = indexingSource.get(changedItem);
+                            if (ci != null) {
+                                index(ci);
+                                logger.info("ContentItem with Uri {} is 
indexed to {}", changedItem, name);
+                            } else {
+                                remove(changedItem);
+                            }
+
+                        } catch (StoreException e) {
+                            logger.error("Failed to retrieve contentitem with 
uri: {}", changedItem);
+                            persist = false;
+                            break;
+                        } catch (IndexException e) {
+                            logger.error("Failed to index contentitem with 
uri: {}", changedItem);
+                            persist = false;
+                            break;
+                        }
+                    }
+                    if (persist) {
+                        try {
+                            if (changeSet.iterator().hasNext()) {
+                                persist(changeSet.toRevision());
+                            }
+                        } catch (IndexException e) {
+                            logger.error("Index revision cannot be persist", 
e);
+                        }
+                    }
+                }
+                try {
+                    Thread.sleep(1000 * indexingSourceCheckPeriod);
+                } catch (InterruptedException e) {
+                    logger.info(
+                        "Indexing Source Checker for index: {} is interrupted 
while sleeping. Closing the thread",
+                        name);
+                    return;
+                }
+            }
+        }
+    }
+}

Modified: 
stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/SemanticIndexMetadataManager.java
URL: 
http://svn.apache.org/viewvc/stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/SemanticIndexMetadataManager.java?rev=1451212&r1=1451211&r2=1451212&view=diff
==============================================================================
--- 
stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/SemanticIndexMetadataManager.java
 (original)
+++ 
stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/SemanticIndexMetadataManager.java
 Thu Feb 28 14:29:28 2013
@@ -85,10 +85,10 @@ public class SemanticIndexMetadataManage
                         configFile.getAbsolutePath());
                 } catch (FileNotFoundException e) {
                     logger.error("IndexMetadata file cannot be found");
-                    throw new IndexManagementException("IndexMetadata file 
cannot be found");
+                    throw new IndexManagementException("IndexMetadata file 
cannot be found", e);
                 } catch (IOException e) {
                     logger.error("Failed to read from input stream");
-                    throw new IndexManagementException("Failed to read from 
input stream");
+                    throw new IndexManagementException("Failed to read from 
input stream", e);
                 } finally {
                     IOUtils.closeQuietly(is);
                 }
@@ -153,7 +153,7 @@ public class SemanticIndexMetadataManage
             } catch (IOException e) {
                 logger.error("Failed to write indexMetadataFilePath to the 
specified output stream");
                 throw new IndexManagementException(
-                        "Failed to write indexMetadataFilePath to the 
specified output stream");
+                        "Failed to write indexMetadataFilePath to the 
specified output stream", e);
             } finally {
                 IOUtils.closeQuietly(out);
             }

Modified: 
stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/solr/LDPathUtils.java
URL: 
http://svn.apache.org/viewvc/stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/solr/LDPathUtils.java?rev=1451212&r1=1451211&r2=1451212&view=diff
==============================================================================
--- 
stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/solr/LDPathUtils.java
 (original)
+++ 
stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/solr/LDPathUtils.java
 Thu Feb 28 14:29:28 2013
@@ -274,7 +274,9 @@ public class LDPathUtils {
 
     private InputStream getSolrTemplateStream() throws 
IndexManagementException {
         String solrCorePath = SOLR_CORE_PATH;
-        if (!solrCorePath.endsWith(File.separator)) solrCorePath += 
File.separator;
+        if (!solrCorePath.endsWith(File.separator)) {
+            solrCorePath += File.separator;
+        }
         String templateZip = solrCorePath + SOLR_TEMPLATE_ZIP;
 
         URL resource = bundle.getEntry(templateZip);

Modified: 
stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/solr/SolrSemanticIndex.java
URL: 
http://svn.apache.org/viewvc/stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/solr/SolrSemanticIndex.java?rev=1451212&r1=1451211&r2=1451212&view=diff
==============================================================================
--- 
stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/solr/SolrSemanticIndex.java
 (original)
+++ 
stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/solr/SolrSemanticIndex.java
 Thu Feb 28 14:29:28 2013
@@ -30,8 +30,6 @@ import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
 
-import javax.ws.rs.core.MediaType;
-
 import org.apache.clerezza.rdf.core.Resource;
 import org.apache.clerezza.rdf.core.Triple;
 import org.apache.clerezza.rdf.core.UriRef;
@@ -62,6 +60,7 @@ import org.apache.stanbol.commons.solr.R
 import org.apache.stanbol.commons.solr.managed.IndexMetadata;
 import org.apache.stanbol.commons.solr.managed.ManagedSolrServer;
 import org.apache.stanbol.contenthub.index.AbstractLDPathSemanticIndex;
+import org.apache.stanbol.contenthub.index.AbstractSemanticIndex;
 import 
org.apache.stanbol.contenthub.servicesapi.index.search.featured.FeaturedSearch;
 import org.apache.stanbol.contenthub.servicesapi.index.search.solr.SolrSearch;
 import 
org.apache.stanbol.contenthub.servicesapi.store.vocabulary.SolrVocabulary.SolrFieldName;
@@ -79,7 +78,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * LDPath based {@link SemanticIndex} implementation. This implementations 
creates the underlying Solr core by
+ * Solr based {@link SemanticIndex} implementation. This implementations 
creates the underlying Solr core by
  * parsing the provided LDPath program. Several LDPath based semantic indexes 
can be created through the
  * associated RESTful services deployed under 
{stanbolhost}/contenthub/index/ldpath or through the Felix Web
  * Console.
@@ -121,14 +120,14 @@ public class SolrSemanticIndex extends A
     private static final Logger logger = 
LoggerFactory.getLogger(SolrSemanticIndex.class);
 
     private static final Set<String> SUPPORTED_MIMETYPES = 
Collections.unmodifiableSet(new HashSet<String>(
-            Arrays.asList(MediaType.TEXT_HTML, MediaType.TEXT_PLAIN, 
MediaType.TEXT_XML)));
+            Arrays.asList("text/html", "text/plain", "text/xml")));
 
     private boolean indexContent;
 
     @Reference
     private SolrSemanticIndexFactory solrSemanticIndexFactory;
 
-    @Reference(target = "(org.apache.solr.core.CoreContainer.name=contenthub)")
+    @Reference(target = 
"(org.apache.solr.core.CoreContainer.name=contenthubSolrSemanticIndex)")
     private ManagedSolrServer managedSolrServer;
 
     private int solrCheckTime;
@@ -332,7 +331,9 @@ public class SolrSemanticIndex extends A
 
     private void performRemove(String ciURI) throws IndexException {
         if (ciURI == null || ciURI.isEmpty()) {
-            return;
+            String msg = "URI of ContentItem cannot be null or empty";
+            logger.error(msg);
+            throw new IndexException(msg);
         }
 
         SolrServer solrServer = null;
@@ -503,13 +504,13 @@ public class SolrSemanticIndex extends A
             properties.get(AbstractLDPathSemanticIndex.PROP_LD_PATH_PROGRAM));
         propertiesSubset.put(SolrSemanticIndex.PROP_INDEX_CONTENT,
             properties.get(SolrSemanticIndex.PROP_INDEX_CONTENT));
-        propertiesSubset.put(AbstractLDPathSemanticIndex.PROP_BATCH_SIZE,
-            properties.get(AbstractLDPathSemanticIndex.PROP_BATCH_SIZE));
-        
propertiesSubset.put(AbstractLDPathSemanticIndex.PROP_INDEXING_SOURCE_NAME,
-            
properties.get(AbstractLDPathSemanticIndex.PROP_INDEXING_SOURCE_NAME));
+        propertiesSubset.put(AbstractSemanticIndex.PROP_BATCH_SIZE,
+            properties.get(AbstractSemanticIndex.PROP_BATCH_SIZE));
+        propertiesSubset.put(AbstractSemanticIndex.PROP_INDEXING_SOURCE_NAME,
+            properties.get(AbstractSemanticIndex.PROP_INDEXING_SOURCE_NAME));
         propertiesSubset.put(PROP_SOLR_CHECK_TIME, 
properties.get(PROP_SOLR_CHECK_TIME));
-        
propertiesSubset.put(AbstractLDPathSemanticIndex.PROP_INDEXING_SOURCE_CHECK_PERIOD,
-            
properties.get(AbstractLDPathSemanticIndex.PROP_INDEXING_SOURCE_CHECK_PERIOD));
+        
propertiesSubset.put(AbstractSemanticIndex.PROP_INDEXING_SOURCE_CHECK_PERIOD,
+            
properties.get(AbstractSemanticIndex.PROP_INDEXING_SOURCE_CHECK_PERIOD));
         propertiesSubset.put(Constants.SERVICE_PID, 
properties.get(Constants.SERVICE_PID));
         propertiesSubset.put(Constants.SERVICE_RANKING, 
properties.get(Constants.SERVICE_RANKING));
         propertiesSubset.put(PROP_REVISION, this.revision);

Modified: 
stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/solr/SolrSemanticIndexFactory.java
URL: 
http://svn.apache.org/viewvc/stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/solr/SolrSemanticIndexFactory.java?rev=1451212&r1=1451211&r2=1451212&view=diff
==============================================================================
--- 
stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/solr/SolrSemanticIndexFactory.java
 (original)
+++ 
stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/solr/SolrSemanticIndexFactory.java
 Thu Feb 28 14:29:28 2013
@@ -64,7 +64,7 @@ public class SolrSemanticIndexFactory ex
 
     private BundleContext bundleContext;
 
-    @Reference(target = "(org.apache.solr.core.CoreContainer.name=contenthub)")
+    @Reference(target = 
"(org.apache.solr.core.CoreContainer.name=contenthubSolrSemanticIndex)")
     private ManagedSolrServer managedSolrServer;
 
     @Reference
@@ -272,7 +272,7 @@ public class SolrSemanticIndexFactory ex
             logger.info("Semantic Index: {} was removed successfully", 
indexName);
         } catch (IOException e) {
             throw new IndexManagementException(String.format(
-                "Failed to remove configuration for the Semantic Index: %s", 
indexName));
+                "Failed to remove configuration for the Semantic Index: %s", 
indexName), e);
         }
     }
 }


Reply via email to