jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r734375 - in /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core: SearchManager.java config/SearchConfig.java query/AbstractQueryHandler.java query/QueryHandler.java
Date Wed, 14 Jan 2009 12:59:49 GMT
Author: thomasm
Date: Wed Jan 14 04:59:29 2009
New Revision: 734375

URL: http://svn.apache.org/viewvc?rev=734375&view=rev
Log:
JCR-1922 Validate the SearchIndex configuration

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SearchManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/SearchConfig.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/AbstractQueryHandler.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryHandler.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SearchManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SearchManager.java?rev=734375&r1=734374&r2=734375&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SearchManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SearchManager.java
Wed Jan 14 04:59:29 2009
@@ -91,16 +91,6 @@
     private static final String PARAM_QUERY_IMPL = "queryClass";
 
     /**
-     * Name of the parameter that specifies the idle time for a query handler.
-     */
-    private static final String PARAM_IDLE_TIME = "idleTime";
-
-    /**
-     * Name of the default query implementation class.
-     */
-    private static final String DEFAULT_QUERY_IMPL_CLASS = QueryImpl.class.getName();
-
-    /**
      * The search configuration.
      */
     private final SearchConfig config;
@@ -158,12 +148,6 @@
     private Path excludePath;
 
     /**
-     * Fully qualified name of the query implementation class.
-     * This class must extend {@link org.apache.jackrabbit.core.query.AbstractQueryImpl}!
-     */
-    private final String queryImplClassName;
-
-    /**
      * Creates a new <code>SearchManager</code>.
      *
      * @param config         the search configuration.
@@ -221,14 +205,6 @@
         // at this point the 'fn' prefix shouldn't be assigned anymore
         safeRegisterNamespace(NS_FN_PREFIX, NS_FN_URI);
 
-        Properties params = config.getParameters();
-        queryImplClassName = params.getProperty(PARAM_QUERY_IMPL, DEFAULT_QUERY_IMPL_CLASS);
-        if (params.containsKey(PARAM_IDLE_TIME)) {
-            String msg = "Parameter 'idleTime' is not supported anymore. "
-                + "Please use 'maxIdleTime' in the repository configuration.";
-            log.warn(msg);
-        }
-
         if (excludedNodeId != null) {
             HierarchyManagerImpl hmgr =
                 new HierarchyManagerImpl(rootNodeId, itemMgr);
@@ -524,6 +500,7 @@
      */
     protected AbstractQueryImpl createQueryInstance() throws RepositoryException {
         try {
+            String queryImplClassName = handler.getQueryClass();
             Object obj = Class.forName(queryImplClassName).newInstance();
             if (obj instanceof AbstractQueryImpl) {
                 return (AbstractQueryImpl) obj;
@@ -532,7 +509,7 @@
                         + " is not of type " + AbstractQueryImpl.class.getName());
             }
         } catch (Throwable t) {
-            throw new RepositoryException("Unable to create query: " + t.toString());
+            throw new RepositoryException("Unable to create query: " + t.toString(), t);
         }
     }
 

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/SearchConfig.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/SearchConfig.java?rev=734375&r1=734374&r2=734375&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/SearchConfig.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/SearchConfig.java
Wed Jan 14 04:59:29 2009
@@ -50,7 +50,6 @@
     public SearchConfig(
             String className, Properties properties, FileSystemFactory fsf) {
         super(className, properties);
-        setValidate(false); // JCR-1920: SearchManager uses getParameters()
         this.fsf = fsf;
     }
 

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/AbstractQueryHandler.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/AbstractQueryHandler.java?rev=734375&r1=734374&r2=734375&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/AbstractQueryHandler.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/AbstractQueryHandler.java
Wed Jan 14 04:59:29 2009
@@ -18,6 +18,8 @@
 
 import org.apache.jackrabbit.core.NodeIdIterator;
 import org.apache.jackrabbit.core.state.NodeStateIterator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import javax.jcr.RepositoryException;
 import java.io.IOException;
@@ -28,6 +30,11 @@
 public abstract class AbstractQueryHandler implements QueryHandler {
 
     /**
+     * Logger instance for this class
+     */
+    private static final Logger log = LoggerFactory.getLogger(AbstractQueryHandler.class);
+
+    /**
      * The context for this query handler.
      */
     private QueryHandlerContext context;
@@ -40,7 +47,7 @@
     /**
      * The name of a class that extends {@link AbstractQueryImpl}.
      */
-    private String queryClass;
+    private String queryClass = QueryImpl.class.getName();
 
     /**
      * The max idle time for this query handler until it is stopped. This
@@ -143,17 +150,23 @@
 
     /**
      * Sets the query handler idle time.
-     *
+     * @deprecated
+     * This parameter is not supported any more.
+     * Please use 'maxIdleTime' in the repository configuration.
+     * 
      * @param idleTime the query handler idle time.
      */
     public void setIdleTime(String idleTime) {
+        log.warn("Parameter 'idleTime' is not supported anymore. "
+                + "Please use 'maxIdleTime' in the repository configuration.");
         this.idleTime = idleTime;
     }
 
     /**
-     * @return the query handler idle tim.
+     * @return the query handler idle time.
      */
     public String getIdleTime() {
         return idleTime;
     }
+        
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryHandler.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryHandler.java?rev=734375&r1=734374&r2=734375&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryHandler.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryHandler.java
Wed Jan 14 04:59:29 2009
@@ -126,4 +126,10 @@
                                           ItemManager itemMgr,
                                           QueryObjectModelTree qomTree)
             throws InvalidQueryException;
+    
+    /**
+     * @return the name of the query class to use.
+     */
+    String getQueryClass();
+    
 }



Mime
View raw message