Apache Lucene open-source search software
LUCENE-2510: Added bw compat support for ResourceLoader/Aware
Christopher John Male5898dc5a83ac
diff --git a/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java b/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.javaindex df4b7904177..27e05e58839 100644--- a/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java+++ b/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java@@ -30,6 +30,8 @@ import java.net.URLClassLoader;import java.util.*;import java.util.concurrent.ConcurrentHashMap;+import org.apache.lucene.analysis.util.ResourceLoaderAware;+import org.apache.solr.common.ResourceLoader;import org.apache.solr.handler.admin.CoreAdminHandler;import org.apache.solr.handler.component.ShardHandlerFactory;import org.slf4j.Logger;@@ -49,14 +51,12 @@ import org.apache.solr.analysis.CharFilterFactory;import org.apache.solr.analysis.TokenFilterFactory;import org.apache.solr.analysis.TokenizerFactory;import org.apache.solr.util.FileUtils;-import org.apache.lucene.analysis.util.ResourceLoader;import org.apache.solr.common.SolrException;import org.apache.solr.handler.component.SearchComponent;import org.apache.solr.request.SolrRequestHandler;import org.apache.solr.response.QueryResponseWriter;import org.apache.solr.schema.FieldType;import org.apache.solr.update.processor.UpdateRequestProcessorFactory;-import org.apache.lucene.analysis.util.ResourceLoaderAware;import org.apache.solr.util.plugin.SolrCoreAware;import org.apache.solr.search.QParserPlugin;@@ -447,6 +447,10 @@ public class SolrResourceLoader implements ResourceLoaderassertAwareCompatibility( SolrCoreAware.class, obj );waitingForCore.add( (SolrCoreAware)obj );}+ if (org.apache.solr.util.plugin.ResourceLoaderAware.class.isInstance(obj)) {+ log.warn("Class [{}] uses org.apache.solr.util.plugin.ResourceLoaderAware " ++ "which is deprecated. Change to org.apache.lucene.analysis.util.ResourceLoaderAware.", cname);+ }if( obj instanceof ResourceLoaderAware ) {assertAwareCompatibility( ResourceLoaderAware.class, obj );waitingForResources.add( (ResourceLoaderAware)obj );@@ -479,6 +483,10 @@ public class SolrResourceLoader implements ResourceLoaderif (!live) {//TODO: Does SolrCoreAware make sense here since in a multi-core context// which core are we talking about ?+ if (org.apache.solr.util.plugin.ResourceLoaderAware.class.isInstance(obj)) {+ log.warn("Class [{}] uses org.apache.solr.util.plugin.ResourceLoaderAware " ++ "which is deprecated. Change to org.apache.lucene.analysis.util.ResourceLoaderAware.", cname);+ }if( obj instanceof ResourceLoaderAware ) {assertAwareCompatibility( ResourceLoaderAware.class, obj );waitingForResources.add( (ResourceLoaderAware)obj );@@ -513,6 +521,10 @@ public class SolrResourceLoader implements ResourceLoaderassertAwareCompatibility( SolrCoreAware.class, obj );waitingForCore.add( (SolrCoreAware)obj );}+ if (org.apache.solr.util.plugin.ResourceLoaderAware.class.isInstance(obj)) {+ log.warn("Class [{}] uses org.apache.solr.util.plugin.ResourceLoaderAware " ++ "which is deprecated. Change to org.apache.lucene.analysis.util.ResourceLoaderAware.", cName);+ }if( obj instanceof ResourceLoaderAware ) {assertAwareCompatibility( ResourceLoaderAware.class, obj );waitingForResources.add( (ResourceLoaderAware)obj );diff --git a/solr/core/src/java/org/apache/solr/util/plugin/ResourceLoaderAware.java b/solr/core/src/java/org/apache/solr/util/plugin/ResourceLoaderAware.javanew file mode 100644index 00000000000..c9f4ab8df31--- /dev/null+++ b/solr/core/src/java/org/apache/solr/util/plugin/ResourceLoaderAware.java@@ -0,0 +1,26 @@+package org.apache.solr.util.plugin;++/*+ * 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.+ */++/**+ * @deprecated This interface has ben kept for backwards compatibility and will+ * be removed in (5.0). Use {@link org.apache.lucene.analysis.util.ResourceLoaderAware}.+ */+@Deprecated+public interface ResourceLoaderAware extends org.apache.lucene.analysis.util.ResourceLoaderAware {+}diff --git a/solr/solrj/src/java/org/apache/solr/common/ResourceLoader.java b/solr/solrj/src/java/org/apache/solr/common/ResourceLoader.javanew file mode 100644index 00000000000..92153adda86--- /dev/null+++ b/solr/solrj/src/java/org/apache/solr/common/ResourceLoader.java@@ -0,0 +1,26 @@+package org.apache.solr.common;++/*+ * 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.+ */++/**+ * @deprecated This interface has ben kept for backwards compatibility and will+ * be removed in (5.0). Use {@link org.apache.lucene.analysis.util.ResourceLoader}+ */+@Deprecated+public interface ResourceLoader extends org.apache.lucene.analysis.util.ResourceLoader {+}