Search in sources :

Example 1 with ClusteredSingletonServiceCreator

use of org.jboss.as.ejb3.clustering.ClusteredSingletonServiceCreator in project wildfly by wildfly.

the class EJB3SubsystemAdd method addClusteringServices.

private static void addClusteringServices(final OperationContext context, final boolean appclient) {
    ServiceTarget target = context.getServiceTarget();
    target.addService(RegistryCollectorService.SERVICE_NAME, new RegistryCollectorService<>()).setInitialMode(ServiceController.Mode.ON_DEMAND).install();
    if (appclient) {
        return;
    }
    if (context.hasOptionalCapability(SingletonDefaultRequirement.SINGLETON_POLICY.getName(), CLUSTERED_SINGLETON_CAPABILITY.getName(), null)) {
        final ClusteredSingletonServiceCreator singletonBarrierCreator = new ClusteredSingletonServiceCreator();
        target.addService(CLUSTERED_SINGLETON_CAPABILITY.getCapabilityServiceName().append("creator"), singletonBarrierCreator).addDependency(context.getCapabilityServiceName(SingletonDefaultRequirement.SINGLETON_POLICY.getName(), SingletonDefaultRequirement.SINGLETON_POLICY.getType()), SingletonPolicy.class, singletonBarrierCreator.getSingletonPolicy()).install();
    }
}
Also used : ClusteredSingletonServiceCreator(org.jboss.as.ejb3.clustering.ClusteredSingletonServiceCreator) SingletonPolicy(org.wildfly.clustering.singleton.SingletonPolicy) ServiceTarget(org.jboss.msc.service.ServiceTarget)

Aggregations

ClusteredSingletonServiceCreator (org.jboss.as.ejb3.clustering.ClusteredSingletonServiceCreator)1 ServiceTarget (org.jboss.msc.service.ServiceTarget)1 SingletonPolicy (org.wildfly.clustering.singleton.SingletonPolicy)1