void updateOrCreateDefaultSingletonBeanAccessTimeoutService(final OperationContext context, final ModelNode model, List<ServiceController<?>> newControllers) 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)