use of org.jboss.msc.Service in project wildfly by wildfly.
the class InfinispanSSOManagerFactoryServiceConfigurator method build.
@Override
public ServiceBuilder<?> build(ServiceTarget target) {
this.configurationConfigurator.build(target).install();
this.cacheConfigurator.build(target).install();
ServiceBuilder<?> builder = target.addService(this.getServiceName());
Consumer<SSOManagerFactory<A, D, S, TransactionBatch>> factory = this.affinityFactory.register(builder).provides(this.getServiceName());
this.cache = builder.requires(this.cacheConfigurator.getServiceName());
Service service = Service.newInstance(factory, new InfinispanSSOManagerFactory<>(this));
return builder.setInstance(service).setInitialMode(ServiceController.Mode.ON_DEMAND);
}
use of org.jboss.msc.Service in project wildfly by wildfly.
the class DistributableCacheFactoryServiceConfigurator method build.
@Override
public ServiceBuilder<?> build(ServiceTarget target) {
this.configurator.build(target).install();
ServiceName name = this.getServiceName();
ServiceBuilder<?> builder = target.addService(name);
Consumer<CacheFactory<K, V>> factory = new CompositeDependency(this.factory, this.tsr).register(builder).provides(name);
Service service = Service.newInstance(factory, this);
return builder.setInstance(service);
}
use of org.jboss.msc.Service in project wildfly by wildfly.
the class SimpleCacheFactoryBuilderServiceConfigurator method build.
@Override
public ServiceBuilder<?> build(ServiceTarget target) {
ServiceName name = this.getServiceName();
ServiceBuilder<?> builder = target.addService(name);
Consumer<CacheFactoryBuilder<K, V>> cacheFactoryBuilder = builder.provides(name);
Service service = Service.newInstance(cacheFactoryBuilder, this);
return builder.setInstance(service).setInitialMode(ServiceController.Mode.ON_DEMAND);
}
use of org.jboss.msc.Service in project wildfly by wildfly.
the class BroadcastCommandDispatcherFactoryInstaller method accept.
@Override
public void accept(OperationContext context, String channelName) {
ServiceName name = MessagingServices.getBroadcastCommandDispatcherFactoryServiceName(channelName);
// N.B. BroadcastCommandDispatcherFactory implementations are shared across multiple server resources
if (this.names.add(name)) {
ServiceBuilder<?> builder = context.getServiceTarget().addService(name);
Consumer<BroadcastCommandDispatcherFactory> injector = builder.provides(name);
Supplier<CommandDispatcherFactory> factory = builder.requires(ClusteringRequirement.COMMAND_DISPATCHER_FACTORY.getServiceName(context, channelName));
Service service = new FunctionalService<>(injector, ConcurrentBroadcastCommandDispatcherFactory::new, factory);
builder.setInstance(service).setInitialMode(ServiceController.Mode.ON_DEMAND).install();
}
}
use of org.jboss.msc.Service in project wildfly by wildfly.
the class ContainerEventHandlerServiceConfigurator method build.
@Override
public ServiceBuilder<?> build(ServiceTarget target) {
ServiceBuilder<?> builder = new AsyncServiceConfigurator(this.getServiceName()).build(target);
Consumer<ModClusterService> modClusterService = this.configuration.register(builder).provides(this.getServiceName());
Service service = new FunctionalService<>(modClusterService, Function.identity(), this, this);
return builder.setInstance(service);
}
Aggregations