Extend AbstractComponent and remove logger

This commit is contained in:
Jim Hooker 2015-08-29 07:43:17 +01:00
parent 57a83fce07
commit 05aa1d90b8
1 changed files with 3 additions and 5 deletions

View File

@ -19,27 +19,25 @@
package org.elasticsearch.action.support;
import org.elasticsearch.common.component.AbstractComponent;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.logging.ESLogger;
import org.elasticsearch.common.logging.Loggers;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.node.settings.NodeSettingsService;
/**
* Helper for dealing with destructive operations and wildcard usage.
*/
public final class DestructiveOperations implements NodeSettingsService.Listener {
public final class DestructiveOperations extends AbstractComponent implements NodeSettingsService.Listener {
/**
* Setting which controls whether wildcard usage (*, prefix*, _all) is allowed.
*/
public static final String REQUIRES_NAME = "action.destructive_requires_name";
private final ESLogger logger = Loggers.getLogger(DestructiveOperations.class);
private volatile boolean destructiveRequiresName;
@Inject
public DestructiveOperations(Settings settings, NodeSettingsService nodeSettingsService) {
super(settings);
destructiveRequiresName = settings.getAsBoolean(DestructiveOperations.REQUIRES_NAME, false);
nodeSettingsService.addListener(this);
}