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();
}
}
Aggregations