Search in sources :

Example 1 with XSiteAdminOperations

use of org.infinispan.xsite.XSiteAdminOperations 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;
}
Also used : OperationFunction(org.jboss.as.clustering.controller.OperationFunction) Function(java.util.function.Function) OperationFunction(org.jboss.as.clustering.controller.OperationFunction) ServiceName(org.jboss.msc.service.ServiceName) XSiteAdminOperations(org.infinispan.xsite.XSiteAdminOperations) AbstractMap(java.util.AbstractMap) Map(java.util.Map) Cache(org.infinispan.Cache)

Aggregations

AbstractMap (java.util.AbstractMap)1 Map (java.util.Map)1 Function (java.util.function.Function)1 Cache (org.infinispan.Cache)1 XSiteAdminOperations (org.infinispan.xsite.XSiteAdminOperations)1 OperationFunction (org.jboss.as.clustering.controller.OperationFunction)1 ServiceName (org.jboss.msc.service.ServiceName)1