public void configureDependency(ServiceBuilder<?> builder, StatefulSessionComponentCreateService service) throws DeploymentUnitProcessingException {
builder.addDependency(this.getServiceName(service), CacheFactory.class, service.getCacheFactoryInjector());
}
private ServiceName getServiceName(StatefulSessionComponentCreateService service) {
CacheInfo cache = service.getCache();
if (cache != null) {
return CacheFactoryService.getServiceName(cache.getName());
}
return (service.getClustering() == null) ? CacheFactoryService.DEFAULT_SFSB_CACHE_SERVICE_NAME : CacheFactoryService.DEFAULT_CLUSTERED_SFSB_CACHE_SERVICE_NAME;
}
});
return new StatefulSessionComponentCreateService(configuration, this.ejbJarConfiguration);