use of org.wildfly.clustering.ejb.StatefulBeanConfiguration in project wildfly by wildfly.
the class DistributableCacheFactoryBuilderServiceConfigurator method getServiceConfigurator.
@Override
public CapabilityServiceConfigurator getServiceConfigurator(DeploymentUnit unit, StatefulComponentDescription description, ComponentConfiguration configuration) {
StatefulBeanConfiguration context = new StatefulBeanConfiguration() {
@Override
public String getName() {
return configuration.getComponentName();
}
@Override
public ServiceName getDeploymentUnitServiceName() {
return unit.getServiceName();
}
@Override
public Module getModule() {
return unit.getAttachment(Attachments.MODULE);
}
@Override
public Duration getTimeout() {
StatefulTimeoutInfo info = description.getStatefulTimeout();
// A value of -1 means the bean will never be removed due to timeout
return (info != null && info.getValue() >= 0) ? Duration.of(info.getValue(), info.getTimeUnit().toChronoUnit()) : null;
}
};
CapabilityServiceConfigurator configurator = this.factory.getBeanManagerFactoryServiceConfigurator(context);
return new DistributableCacheFactoryServiceConfigurator<K, V>(description.getCacheFactoryServiceName(), configurator);
}
Aggregations