void updatePoolService(final OperationContext context, final ModelNode model) throws OperationFailedException { final ModelNode poolName = poolAttribute.resolveModelAttribute(context, model); final ServiceRegistry serviceRegistry = context.getServiceRegistry(true); ServiceController<?> existingDefaultPoolConfigService = serviceRegistry.getService(poolConfigServiceName); // if a default MDB pool is already installed, then remove it first if (existingDefaultPoolConfigService != null) { context.removeService(existingDefaultPoolConfigService); } if (poolName.isDefined()) { // now install default pool config service which points to an existing pool config service final ValueInjectionService<PoolConfig> newDefaultPoolConfigService = new ValueInjectionService<PoolConfig>(); ServiceController<?> newController = context.getServiceTarget().addService(poolConfigServiceName, newDefaultPoolConfigService) .addDependency(StrictMaxPoolConfigService.EJB_POOL_CONFIG_BASE_SERVICE_NAME.append(poolName.asString()), PoolConfig.class, newDefaultPoolConfigService.getInjector()) .install(); } } }
void updateDefaultLocalEJBReceiverService(final OperationContext context, final ModelNode model) throws OperationFailedException { final ModelNode passByValueModel = this.attributeDefinition.resolveModelAttribute(context, model); final ServiceRegistry registry = context.getServiceRegistry(true); final ServiceName localTransportProviderServiceName; if (passByValueModel.isDefined()) { final boolean passByValue = passByValueModel.asBoolean(true); if (passByValue) { localTransportProviderServiceName = LocalTransportProvider.BY_VALUE_SERVICE_NAME; } else { localTransportProviderServiceName = LocalTransportProvider.BY_REFERENCE_SERVICE_NAME; } } else { localTransportProviderServiceName = LocalTransportProvider.BY_VALUE_SERVICE_NAME; } // uninstall the existing default local EJB receiver service final ServiceController<?> existingDefaultLocalEJBReceiverServiceController = registry.getService(LocalTransportProvider.DEFAULT_LOCAL_TRANSPORT_PROVIDER_SERVICE_NAME); if (existingDefaultLocalEJBReceiverServiceController != null) { context.removeService(existingDefaultLocalEJBReceiverServiceController); } final ServiceTarget serviceTarget = context.getServiceTarget(); // now install the new default local EJB receiver service which points to an existing Local EJB receiver service final ValueInjectionService<LocalTransportProvider> newDefaultLocalTransportProviderService = new ValueInjectionService<LocalTransportProvider>(); final ServiceBuilder<LocalTransportProvider> defaultLocalEJBReceiverServiceBuilder = serviceTarget.addService(LocalTransportProvider.DEFAULT_LOCAL_TRANSPORT_PROVIDER_SERVICE_NAME, newDefaultLocalTransportProviderService); defaultLocalEJBReceiverServiceBuilder.addDependency(localTransportProviderServiceName, LocalTransportProvider.class, newDefaultLocalTransportProviderService.getInjector()); // install the service defaultLocalEJBReceiverServiceBuilder.install(); }
ValueInjectionService<Driver> driverDemanderService = new ValueInjectionService<Driver>(); .addDependency(driverServiceName, Driver.class, driverDemanderService.getInjector()); driverDemanderBuilder.setInitialMode(ServiceController.Mode.ACTIVE);
void updatePoolService(final OperationContext context, final ModelNode model, List<ServiceController<?>> newControllers) throws OperationFailedException { final ModelNode poolName = poolAttribute.resolveModelAttribute(context, model); final ServiceRegistry serviceRegistry = context.getServiceRegistry(true); ServiceController existingDefaultPoolConfigService = serviceRegistry.getService(poolConfigServiceName); // if a default MDB pool is already installed, then remove it first if (existingDefaultPoolConfigService != null) { context.removeService(existingDefaultPoolConfigService); } if (poolName.isDefined()) { // now install default pool config service which points to an existing pool config service final ValueInjectionService<PoolConfig> newDefaultPoolConfigService = new ValueInjectionService<PoolConfig>(); ServiceController<?> newController = context.getServiceTarget().addService(poolConfigServiceName, newDefaultPoolConfigService) .addDependency(PoolConfigService.EJB_POOL_CONFIG_BASE_SERVICE_NAME.append(poolName.asString()), PoolConfig.class, newDefaultPoolConfigService.getInjector()) .install(); if (newControllers != null) { newControllers.add(newController); } } } }
void updateDefaultLocalEJBReceiverService(final OperationContext context, final ModelNode model, List<ServiceController<?>> newControllers) throws OperationFailedException { final ModelNode passByValueModel = this.attributeDefinition.resolveModelAttribute(context, model); final ServiceRegistry registry = context.getServiceRegistry(true); final ServiceName localEJBReceiverServiceName; if (passByValueModel.isDefined()) { final boolean passByValue = passByValueModel.asBoolean(true); if (passByValue) { localEJBReceiverServiceName = LocalEjbReceiver.BY_VALUE_SERVICE_NAME; } else { localEJBReceiverServiceName = LocalEjbReceiver.BY_REFERENCE_SERVICE_NAME; } } else { localEJBReceiverServiceName = LocalEjbReceiver.BY_VALUE_SERVICE_NAME; } // uninstall the existing default local EJB receiver service final ServiceController<?> existingDefaultLocalEJBReceiverServiceController = registry.getService(LocalEjbReceiver.DEFAULT_LOCAL_EJB_RECEIVER_SERVICE_NAME); if (existingDefaultLocalEJBReceiverServiceController != null) { context.removeService(existingDefaultLocalEJBReceiverServiceController); } final ServiceTarget serviceTarget = context.getServiceTarget(); // now install the new default local EJB receiver service which points to a existing Local EJB receiver service final ValueInjectionService<LocalEjbReceiver> newDefaultLocalEJBReceiverService = new ValueInjectionService<LocalEjbReceiver>(); final ServiceBuilder defaultLocalEJBReceiverServiceBuilder = serviceTarget.addService(LocalEjbReceiver.DEFAULT_LOCAL_EJB_RECEIVER_SERVICE_NAME, newDefaultLocalEJBReceiverService); defaultLocalEJBReceiverServiceBuilder.addDependency(localEJBReceiverServiceName, LocalEjbReceiver.class, newDefaultLocalEJBReceiverService.getInjector()); // install the service final ServiceController defaultLocalEJBReceiverServiceController = defaultLocalEJBReceiverServiceBuilder.install(); if (newControllers != null) { newControllers.add(defaultLocalEJBReceiverServiceController); } }
ValueInjectionService driverDemanderService = new ValueInjectionService<Driver>(); .addService(driverDemanderServiceName, driverDemanderService) .addDependency(driverServiceName, Driver.class, driverDemanderService.getInjector()); driverDemanderBuilder.addListener(verificationHandler); driverDemanderBuilder.setInitialMode(ServiceController.Mode.ACTIVE);
ValueInjectionService<Driver> driverDemanderService = new ValueInjectionService<Driver>(); .addDependency(driverServiceName, Driver.class, driverDemanderService.getInjector()); driverDemanderBuilder.setInitialMode(ServiceController.Mode.ACTIVE);