You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@clerezza.apache.org by ha...@apache.org on 2010/01/06 21:13:48 UTC
svn commit: r896650 -
/incubator/clerezza/issues/CLEREZZA-60/org.apache.clerezza.platform.concept/org.apache.clerezza.platform.concept.core/src/main/java/org/apache/clerezza/platform/concept/core/
Author: hasan
Date: Wed Jan 6 20:13:43 2010
New Revision: 896650
URL: http://svn.apache.org/viewvc?rev=896650&view=rev
Log:
CLEREZZA-60: added interface ConceptProviderManager, updated and improved its implementation SimpleConceptProviderManager
Added:
incubator/clerezza/issues/CLEREZZA-60/org.apache.clerezza.platform.concept/org.apache.clerezza.platform.concept.core/src/main/java/org/apache/clerezza/platform/concept/core/ConceptProviderManager.java
Modified:
incubator/clerezza/issues/CLEREZZA-60/org.apache.clerezza.platform.concept/org.apache.clerezza.platform.concept.core/src/main/java/org/apache/clerezza/platform/concept/core/ConceptsFinder.java
incubator/clerezza/issues/CLEREZZA-60/org.apache.clerezza.platform.concept/org.apache.clerezza.platform.concept.core/src/main/java/org/apache/clerezza/platform/concept/core/SimpleConceptProviderManager.java
Added: incubator/clerezza/issues/CLEREZZA-60/org.apache.clerezza.platform.concept/org.apache.clerezza.platform.concept.core/src/main/java/org/apache/clerezza/platform/concept/core/ConceptProviderManager.java
URL: http://svn.apache.org/viewvc/incubator/clerezza/issues/CLEREZZA-60/org.apache.clerezza.platform.concept/org.apache.clerezza.platform.concept.core/src/main/java/org/apache/clerezza/platform/concept/core/ConceptProviderManager.java?rev=896650&view=auto
==============================================================================
--- incubator/clerezza/issues/CLEREZZA-60/org.apache.clerezza.platform.concept/org.apache.clerezza.platform.concept.core/src/main/java/org/apache/clerezza/platform/concept/core/ConceptProviderManager.java (added)
+++ incubator/clerezza/issues/CLEREZZA-60/org.apache.clerezza.platform.concept/org.apache.clerezza.platform.concept.core/src/main/java/org/apache/clerezza/platform/concept/core/ConceptProviderManager.java Wed Jan 6 20:13:43 2010
@@ -0,0 +1,39 @@
+/*
+ * 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.
+ */
+package org.apache.clerezza.platform.concept.core;
+
+import java.util.List;
+
+/**
+ * An implementation of this class manages {@link ConceptProvider}s.
+ *
+ * @author hasan
+ */
+public interface ConceptProviderManager {
+
+ /**
+ * Returns a list of {@link ConceptProvider}s. The list order determines
+ * the priority of a {@link ConceptProvider}. The meaning of the priority
+ * is left to the implementation and application.
+ *
+ * @return
+ * a list of managed {@link ConceptProvider}s.
+ */
+ public List<ConceptProvider> getConceptProviders();
+}
Modified: incubator/clerezza/issues/CLEREZZA-60/org.apache.clerezza.platform.concept/org.apache.clerezza.platform.concept.core/src/main/java/org/apache/clerezza/platform/concept/core/ConceptsFinder.java
URL: http://svn.apache.org/viewvc/incubator/clerezza/issues/CLEREZZA-60/org.apache.clerezza.platform.concept/org.apache.clerezza.platform.concept.core/src/main/java/org/apache/clerezza/platform/concept/core/ConceptsFinder.java?rev=896650&r1=896649&r2=896650&view=diff
==============================================================================
--- incubator/clerezza/issues/CLEREZZA-60/org.apache.clerezza.platform.concept/org.apache.clerezza.platform.concept.core/src/main/java/org/apache/clerezza/platform/concept/core/ConceptsFinder.java (original)
+++ incubator/clerezza/issues/CLEREZZA-60/org.apache.clerezza.platform.concept/org.apache.clerezza.platform.concept.core/src/main/java/org/apache/clerezza/platform/concept/core/ConceptsFinder.java Wed Jan 6 20:13:43 2010
@@ -61,7 +61,7 @@
public class ConceptsFinder {
@Reference
- protected SimpleConceptProviderManager conceptProviderManager;
+ protected ConceptProviderManager conceptProviderManager;
/**
* Searches concepts for a specified search term. The actual search task
Modified: incubator/clerezza/issues/CLEREZZA-60/org.apache.clerezza.platform.concept/org.apache.clerezza.platform.concept.core/src/main/java/org/apache/clerezza/platform/concept/core/SimpleConceptProviderManager.java
URL: http://svn.apache.org/viewvc/incubator/clerezza/issues/CLEREZZA-60/org.apache.clerezza.platform.concept/org.apache.clerezza.platform.concept.core/src/main/java/org/apache/clerezza/platform/concept/core/SimpleConceptProviderManager.java?rev=896650&r1=896649&r2=896650&view=diff
==============================================================================
--- incubator/clerezza/issues/CLEREZZA-60/org.apache.clerezza.platform.concept/org.apache.clerezza.platform.concept.core/src/main/java/org/apache/clerezza/platform/concept/core/SimpleConceptProviderManager.java (original)
+++ incubator/clerezza/issues/CLEREZZA-60/org.apache.clerezza.platform.concept/org.apache.clerezza.platform.concept.core/src/main/java/org/apache/clerezza/platform/concept/core/SimpleConceptProviderManager.java Wed Jan 6 20:13:43 2010
@@ -75,11 +75,11 @@
@Component
@Services({
@Service(Object.class),
- @Service(SimpleConceptProviderManager.class)
+ @Service(ConceptProviderManager.class)
})
@Property(name = "javax.ws.rs", boolValue = true)
@Path("/concepts/provider-manager")
-public class SimpleConceptProviderManager {
+public class SimpleConceptProviderManager implements ConceptProviderManager {
private FileServer fileServer;
@@ -122,6 +122,10 @@
instantiateConceptProviders();
}
+ protected void deactivate(ComponentContext context) {
+ conceptProviderList.clear();
+ }
+
private void instantiateConceptProviders() {
conceptProviderList.clear();
MGraph contentGraph = cgProvider.getContentGraph();
@@ -303,7 +307,8 @@
return node;
}
- List<ConceptProvider> getConceptProviders() {
+ @Override
+ public List<ConceptProvider> getConceptProviders() {
return conceptProviderList;
}