diff --git a/server/src/main/java/org/elasticsearch/action/support/TransportAction.java b/server/src/main/java/org/elasticsearch/action/support/TransportAction.java index 22740ea6bf7..fcb4905b959 100644 --- a/server/src/main/java/org/elasticsearch/action/support/TransportAction.java +++ b/server/src/main/java/org/elasticsearch/action/support/TransportAction.java @@ -18,24 +18,28 @@ */ package org.elasticsearch.action.support; - +import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionResponse; -import org.elasticsearch.common.component.AbstractComponent; import org.elasticsearch.tasks.Task; import org.elasticsearch.tasks.TaskListener; import org.elasticsearch.tasks.TaskManager; import java.util.concurrent.atomic.AtomicInteger; -public abstract class TransportAction extends AbstractComponent { +public abstract class TransportAction { protected final String actionName; private final ActionFilter[] filters; protected final TaskManager taskManager; + /** + * @deprecated declare your own logger. + */ + @Deprecated + protected Logger logger = LogManager.getLogger(getClass()); protected TransportAction(String actionName, ActionFilters actionFilters, TaskManager taskManager) { this.actionName = actionName; diff --git a/server/src/main/java/org/elasticsearch/common/component/AbstractComponent.java b/server/src/main/java/org/elasticsearch/common/component/AbstractComponent.java deleted file mode 100644 index 1e0310c0247..00000000000 --- a/server/src/main/java/org/elasticsearch/common/component/AbstractComponent.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch 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.elasticsearch.common.component; - -import org.apache.logging.log4j.Logger; -import org.apache.logging.log4j.LogManager; - -/** - * @deprecated declare your own logger - */ -@Deprecated -public abstract class AbstractComponent { - - protected final Logger logger; - - public AbstractComponent() { - this.logger = LogManager.getLogger(getClass()); - } -} diff --git a/server/src/main/java/org/elasticsearch/rest/BaseRestHandler.java b/server/src/main/java/org/elasticsearch/rest/BaseRestHandler.java index 36189381c5b..9e86b3a6f94 100644 --- a/server/src/main/java/org/elasticsearch/rest/BaseRestHandler.java +++ b/server/src/main/java/org/elasticsearch/rest/BaseRestHandler.java @@ -18,13 +18,13 @@ */ package org.elasticsearch.rest; - +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.apache.lucene.search.spell.LevenshteinDistance; import org.apache.lucene.util.CollectionUtil; import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.CheckedConsumer; import org.elasticsearch.common.collect.Tuple; -import org.elasticsearch.common.component.AbstractComponent; import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Setting.Property; import org.elasticsearch.common.settings.Settings; @@ -51,12 +51,17 @@ import java.util.stream.Collectors; * are copied, but a selected few. It is possible to control what headers are copied over by returning them in * {@link ActionPlugin#getRestHeaders()}. */ -public abstract class BaseRestHandler extends AbstractComponent implements RestHandler { +public abstract class BaseRestHandler implements RestHandler { public static final Setting MULTI_ALLOW_EXPLICIT_INDEX = Setting.boolSetting("rest.action.multi.allow_explicit_index", true, Property.NodeScope); private final LongAdder usageCount = new LongAdder(); + /** + * @deprecated declare your own logger. + */ + @Deprecated + protected Logger logger = LogManager.getLogger(getClass()); /** * Parameter that controls whether certain REST apis should include type names in their requests or responses.