@Override public ServiceBuilder<?> build(ServiceTarget target) { ServiceName name = this.getServiceName(); ServiceBuilder<?> builder = target.addService(name); Consumer<CacheFactory<K, V>> factory = new CompositeDependency(this.environment, this.executor).register(builder).provides(name); Service service = Service.newInstance(factory, this); return builder.setInstance(service); }
@Override public CapabilityServiceConfigurator getServiceConfigurator(ServiceName name, StatefulComponentDescription description, ComponentConfiguration configuration) { return new SimpleCacheFactoryServiceConfigurator<>(name, description, new ServiceSupplierDependency<>(this.getExpirationSchedulerServiceName(description.getDeploymentUnitServiceName()))); }