All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jboss.as.clustering.controller.CapabilityNameResolverConfigurator Maven / Gradle / Ivy

Go to download

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.

The newest version!
/*
 * 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);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy