use of org.jboss.as.clustering.controller.OperationFunction 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;
}
use of org.jboss.as.clustering.controller.OperationFunction in project wildfly by wildfly.
the class CacheOperationExecutor method execute.
@Override
public ModelNode execute(OperationContext context, ModelNode op, Operation<C> operation) throws OperationFailedException {
ServiceName name = InfinispanCacheRequirement.CACHE.getServiceName(context, this.resolver);
FunctionExecutor<Cache<?, ?>> executor = this.executors.get(name);
return (executor != null) ? executor.execute(new OperationFunction<>(context, op, this, operation)) : null;
}
use of org.jboss.as.clustering.controller.OperationFunction in project wildfly by wildfly.
the class BackupOperationExecutor method execute.
@Override
public ModelNode execute(OperationContext context, ModelNode operation, Operation<Map.Entry<String, XSiteAdminOperations>> executable) throws OperationFailedException {
ServiceName name = InfinispanCacheRequirement.CACHE.getServiceName(context, BinaryCapabilityNameResolver.GRANDPARENT_PARENT);
Function<Cache<?, ?>, Map.Entry<String, XSiteAdminOperations>> mapper = new Function<Cache<?, ?>, Map.Entry<String, XSiteAdminOperations>>() {
@Override
public Map.Entry<String, XSiteAdminOperations> apply(Cache<?, ?> cache) {
String site = context.getCurrentAddressValue();
return new AbstractMap.SimpleImmutableEntry<>(site, cache.getAdvancedCache().getComponentRegistry().getLocalComponent(XSiteAdminOperations.class));
}
};
FunctionExecutor<Cache<?, ?>> executor = this.executors.get(name);
return (executor != null) ? executor.execute(new OperationFunction<>(context, operation, mapper, executable)) : null;
}
use of org.jboss.as.clustering.controller.OperationFunction in project wildfly by wildfly.
the class RemoteCacheOperationExecutor method execute.
@Override
public ModelNode execute(OperationContext context, ModelNode op, Operation<RemoteCacheClientStatisticsMXBean> operation) throws OperationFailedException {
ServiceName name = InfinispanClientRequirement.REMOTE_CONTAINER.getServiceName(context, UnaryCapabilityNameResolver.PARENT);
FunctionExecutor<RemoteCacheContainer> executor = this.executors.get(name);
return (executor != null) ? executor.execute(new OperationFunction<>(context, op, new RemoteCacheClientStatisticsFactory(context.getCurrentAddressValue()), operation)) : null;
}
use of org.jboss.as.clustering.controller.OperationFunction in project wildfly by wildfly.
the class ProxyOperationExecutor method execute.
@Override
public ModelNode execute(OperationContext context, ModelNode operation, Operation<ModClusterServiceMBean> executable) throws OperationFailedException {
ServiceName serviceName = ProxyConfigurationResourceDefinition.Capability.SERVICE.getDefinition().getCapabilityServiceName(context.getCurrentAddress());
FunctionExecutor<ModClusterServiceMBean> executor = this.executors.get(serviceName);
return (executor != null) ? executor.execute(new OperationFunction<>(context, operation, Function.identity(), executable)) : null;
}
Aggregations