Search in sources :

Example 1 with CacheFactory

use of org.jboss.as.ejb3.cache.CacheFactory 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);
}
Also used : ServiceName(org.jboss.msc.service.ServiceName) Service(org.jboss.msc.Service) CompositeDependency(org.wildfly.clustering.service.CompositeDependency) CacheFactory(org.jboss.as.ejb3.cache.CacheFactory)

Example 2 with CacheFactory

use of org.jboss.as.ejb3.cache.CacheFactory in project wildfly by wildfly.

the class SimpleCacheFactoryServiceConfigurator method build.

@Override
public ServiceBuilder<?> build(ServiceTarget target) {
    ServiceName name = this.getServiceName();
    ServiceBuilder<?> builder = target.addService(name);
    Consumer<CacheFactory<K, V>> factory = this.environment.register(builder).provides(name);
    Service service = Service.newInstance(factory, this);
    return builder.setInstance(service);
}
Also used : ServiceName(org.jboss.msc.service.ServiceName) Service(org.jboss.msc.Service) ServerEnvironmentService(org.jboss.as.server.ServerEnvironmentService) CacheFactory(org.jboss.as.ejb3.cache.CacheFactory)

Aggregations

CacheFactory (org.jboss.as.ejb3.cache.CacheFactory)2 Service (org.jboss.msc.Service)2 ServiceName (org.jboss.msc.service.ServiceName)2 ServerEnvironmentService (org.jboss.as.server.ServerEnvironmentService)1 CompositeDependency (org.wildfly.clustering.service.CompositeDependency)1