Search in sources :

Example 1 with ChildResourceProvider

use of org.jboss.as.clustering.controller.ChildResourceProvider in project wildfly by wildfly.

the class RemoteCacheContainerResource method register.

@Override
public Registration register(String cache) {
    ChildResourceProvider handler = this.apply(CHILD_TYPE);
    handler.getChildren().add(cache);
    return new Registration() {

        @Override
        public void close() {
            handler.getChildren().remove(cache);
        }
    };
}
Also used : ChildResourceProvider(org.jboss.as.clustering.controller.ChildResourceProvider) SimpleChildResourceProvider(org.jboss.as.clustering.controller.SimpleChildResourceProvider) Registration(org.wildfly.clustering.Registration)

Example 2 with ChildResourceProvider

use of org.jboss.as.clustering.controller.ChildResourceProvider in project wildfly by wildfly.

the class CacheContainerResource method register.

@Override
public Registration register(String cache) {
    ChildResourceProvider provider = this.apply(CHILD_TYPE);
    provider.getChildren().add(cache);
    return new Registration() {

        @Override
        public void close() {
            provider.getChildren().remove(cache);
        }
    };
}
Also used : ChildResourceProvider(org.jboss.as.clustering.controller.ChildResourceProvider) Registration(org.wildfly.clustering.Registration)

Example 3 with ChildResourceProvider

use of org.jboss.as.clustering.controller.ChildResourceProvider in project wildfly by wildfly.

the class SingletonPolicyResource method createProviders.

private static Map<String, ChildResourceProvider> createProviders() {
    Map<String, ChildResourceProvider> providers = new HashMap<>();
    providers.put(DEPLOYMENT_CHILD_TYPE, new SimpleChildResourceProvider(ConcurrentHashMap.newKeySet()));
    providers.put(SERVICE_CHILD_TYPE, new SimpleChildResourceProvider(ConcurrentHashMap.newKeySet()));
    return Collections.unmodifiableMap(providers);
}
Also used : ChildResourceProvider(org.jboss.as.clustering.controller.ChildResourceProvider) SimpleChildResourceProvider(org.jboss.as.clustering.controller.SimpleChildResourceProvider) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashMap(java.util.HashMap) SimpleChildResourceProvider(org.jboss.as.clustering.controller.SimpleChildResourceProvider)

Example 4 with ChildResourceProvider

use of org.jboss.as.clustering.controller.ChildResourceProvider in project wildfly by wildfly.

the class SingletonPolicyResource method register.

@Override
public Registration register(ServiceName service) {
    boolean deployment = Services.JBOSS_DEPLOYMENT.isParentOf(service);
    ChildResourceProvider provider = this.apply(deployment ? DEPLOYMENT_CHILD_TYPE : SERVICE_CHILD_TYPE);
    String name = (deployment ? SingletonDeploymentResourceDefinition.pathElement(service) : SingletonServiceResourceDefinition.pathElement(service)).getValue();
    provider.getChildren().add(name);
    return new Registration() {

        @Override
        public void close() {
            provider.getChildren().remove(name);
        }
    };
}
Also used : ChildResourceProvider(org.jboss.as.clustering.controller.ChildResourceProvider) SimpleChildResourceProvider(org.jboss.as.clustering.controller.SimpleChildResourceProvider) Registration(org.wildfly.clustering.Registration)

Aggregations

ChildResourceProvider (org.jboss.as.clustering.controller.ChildResourceProvider)4 SimpleChildResourceProvider (org.jboss.as.clustering.controller.SimpleChildResourceProvider)3 Registration (org.wildfly.clustering.Registration)3 HashMap (java.util.HashMap)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1