Search in sources :

Example 1 with StatefulBeanConfiguration

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);
}
Also used : StatefulBeanConfiguration(org.wildfly.clustering.ejb.StatefulBeanConfiguration) CapabilityServiceConfigurator(org.jboss.as.clustering.controller.CapabilityServiceConfigurator) StatefulTimeoutInfo(org.jboss.as.ejb3.component.stateful.StatefulTimeoutInfo)

Aggregations

CapabilityServiceConfigurator (org.jboss.as.clustering.controller.CapabilityServiceConfigurator)1 StatefulTimeoutInfo (org.jboss.as.ejb3.component.stateful.StatefulTimeoutInfo)1 StatefulBeanConfiguration (org.wildfly.clustering.ejb.StatefulBeanConfiguration)1