org.jboss.as.clustering.controller.CapabilityNameResolverConfigurator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of wildfly-clustering-common Show documentation
Show all versions of wildfly-clustering-common Show documentation
The code in this module is not explicitly related to clustering, but rather contains resuable code used by clustering modules
and any modules that integrate with clustering.
/*
* Copyright The WildFly Authors
* SPDX-License-Identifier: Apache-2.0
*/
package org.jboss.as.clustering.controller;
import java.util.function.Function;
import java.util.function.UnaryOperator;
import org.jboss.as.controller.PathAddress;
import org.jboss.as.controller.capability.RuntimeCapability;
/**
* Operator that configures a runtime capability with a given capability name resolver.
* @author Paul Ferraro
*/
public class CapabilityNameResolverConfigurator implements UnaryOperator> {
private final Function resolver;
/**
* Creates a new capability name resolver configurator
* @param mapper a capability name resolver
*/
public CapabilityNameResolverConfigurator(Function resolver) {
this.resolver = resolver;
}
@Override
public RuntimeCapability.Builder apply(RuntimeCapability.Builder builder) {
return builder.setDynamicNameMapper(this.resolver);
}
}