Search in sources :

Example 1 with RemoteCacheManagerMXBean

use of org.infinispan.client.hotrod.jmx.RemoteCacheManagerMXBean in project wildfly by wildfly.

the class RemoteClusterOperationExecutor method execute.

@Override
public ModelNode execute(OperationContext context, ModelNode op, Operation<Map.Entry<String, RemoteCacheManagerMXBean>> operation) throws OperationFailedException {
    ServiceName name = InfinispanClientRequirement.REMOTE_CONTAINER.getServiceName(context, UnaryCapabilityNameResolver.PARENT);
    FunctionExecutor<RemoteCacheContainer> executor = this.executors.get(name);
    Function<RemoteCacheContainer, Map.Entry<String, RemoteCacheManagerMXBean>> mapper = new Function<RemoteCacheContainer, Map.Entry<String, RemoteCacheManagerMXBean>>() {

        @Override
        public Map.Entry<String, RemoteCacheManagerMXBean> apply(RemoteCacheContainer container) {
            String cluster = context.getCurrentAddressValue();
            return new AbstractMap.SimpleImmutableEntry<>(cluster, container);
        }
    };
    return (executor != null) ? executor.execute(new OperationFunction<>(context, op, mapper, operation)) : null;
}
Also used : OperationFunction(org.jboss.as.clustering.controller.OperationFunction) Function(java.util.function.Function) RemoteCacheManagerMXBean(org.infinispan.client.hotrod.jmx.RemoteCacheManagerMXBean) RemoteCacheContainer(org.wildfly.clustering.infinispan.client.RemoteCacheContainer) OperationFunction(org.jboss.as.clustering.controller.OperationFunction) ServiceName(org.jboss.msc.service.ServiceName) AbstractMap(java.util.AbstractMap) Map(java.util.Map)

Aggregations

AbstractMap (java.util.AbstractMap)1 Map (java.util.Map)1 Function (java.util.function.Function)1 RemoteCacheManagerMXBean (org.infinispan.client.hotrod.jmx.RemoteCacheManagerMXBean)1 OperationFunction (org.jboss.as.clustering.controller.OperationFunction)1 ServiceName (org.jboss.msc.service.ServiceName)1 RemoteCacheContainer (org.wildfly.clustering.infinispan.client.RemoteCacheContainer)1