use of org.jboss.as.ejb3.component.DefaultAccessTimeoutService in project wildfly by wildfly.
the class DefaultSessionBeanAccessTimeoutWriteHandler method applyModelToRuntime.
private void applyModelToRuntime(OperationContext context, final ModelNode model) throws OperationFailedException {
long timeout = attribute.resolveModelAttribute(context, model).asLong();
final ServiceRegistry serviceRegistry = context.getServiceRegistry(true);
ServiceController<DefaultAccessTimeoutService> controller = (ServiceController<DefaultAccessTimeoutService>) serviceRegistry.getService(serviceName);
if (controller != null) {
DefaultAccessTimeoutService service = controller.getValue();
if (service != null) {
service.setDefaultAccessTimeout(timeout);
}
}
}
use of org.jboss.as.ejb3.component.DefaultAccessTimeoutService in project wildfly by wildfly.
the class DefaultStatefulBeanAccessTimeoutWriteHandler method updateOrCreateDefaultStatefulBeanAccessTimeoutService.
void updateOrCreateDefaultStatefulBeanAccessTimeoutService(final OperationContext context, final ModelNode model) throws OperationFailedException {
final long defaultAccessTimeout = EJB3SubsystemRootResourceDefinition.DEFAULT_STATEFUL_BEAN_ACCESS_TIMEOUT.resolveModelAttribute(context, model).asLong();
final ServiceName serviceName = DefaultAccessTimeoutService.STATEFUL_SERVICE_NAME;
final ServiceRegistry registry = context.getServiceRegistry(true);
final ServiceController<?> sc = registry.getService(serviceName);
if (sc != null) {
final DefaultAccessTimeoutService defaultAccessTimeoutService = DefaultAccessTimeoutService.class.cast(sc.getValue());
defaultAccessTimeoutService.setDefaultAccessTimeout(defaultAccessTimeout);
} else {
// create and install the service
final DefaultAccessTimeoutService defaultAccessTimeoutService = new DefaultAccessTimeoutService(defaultAccessTimeout);
final ServiceController<?> newService = context.getServiceTarget().addService(serviceName, defaultAccessTimeoutService).install();
}
}
use of org.jboss.as.ejb3.component.DefaultAccessTimeoutService in project wildfly by wildfly.
the class DefaultSingletonBeanAccessTimeoutWriteHandler method updateOrCreateDefaultSingletonBeanAccessTimeoutService.
void updateOrCreateDefaultSingletonBeanAccessTimeoutService(final OperationContext context, final ModelNode model) throws OperationFailedException {
final long defaultAccessTimeout = EJB3SubsystemRootResourceDefinition.DEFAULT_SINGLETON_BEAN_ACCESS_TIMEOUT.resolveModelAttribute(context, model).asLong();
final ServiceName serviceName = DefaultAccessTimeoutService.SINGLETON_SERVICE_NAME;
final ServiceRegistry registry = context.getServiceRegistry(true);
final ServiceController<?> sc = registry.getService(serviceName);
if (sc != null) {
final DefaultAccessTimeoutService defaultAccessTimeoutService = DefaultAccessTimeoutService.class.cast(sc.getValue());
defaultAccessTimeoutService.setDefaultAccessTimeout(defaultAccessTimeout);
} else {
// create and install the service
final DefaultAccessTimeoutService defaultAccessTimeoutService = new DefaultAccessTimeoutService(defaultAccessTimeout);
final ServiceController<?> newService = context.getServiceTarget().addService(serviceName, defaultAccessTimeoutService).install();
}
}
Aggregations