use of org.jboss.msc.service.ServiceTarget in project wildfly by wildfly.
the class TracerAdd method performRuntime.
@Override
protected void performRuntime(final OperationContext context, final ModelNode operation, final ModelNode model) throws OperationFailedException {
final boolean enabled = TracerDefinition.TracerParameters.TRACER_ENABLED.getAttribute().resolveModelAttribute(context, model).asBoolean();
ServiceName serviceName = ConnectorServices.TRACER_CONFIG_SERVICE;
ServiceName jcaConfigServiceName = ConnectorServices.CONNECTOR_CONFIG_SERVICE;
final ServiceTarget serviceTarget = context.getServiceTarget();
final TracerService.Tracer config = new TracerService.Tracer(enabled);
final TracerService service = new TracerService(config);
serviceTarget.addService(serviceName, service).setInitialMode(ServiceController.Mode.ACTIVE).addDependency(jcaConfigServiceName, JcaSubsystemConfiguration.class, service.getJcaConfigInjector()).install();
}
use of org.jboss.msc.service.ServiceTarget in project wildfly by wildfly.
the class CDConfigPropertyAdd method performRuntime.
@Override
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode recoveryEnvModel) throws OperationFailedException {
final String configPropertyValue = CONFIG_PROPERTY_VALUE.resolveModelAttribute(context, recoveryEnvModel).asString();
final ModelNode address = operation.require(OP_ADDR);
PathAddress path = PathAddress.pathAddress(address);
final String archiveName = path.getElement(path.size() - 3).getValue();
final String cfName = path.getElement(path.size() - 2).getValue();
final String configPropertyName = PathAddress.pathAddress(address).getLastElement().getValue();
ServiceName serviceName = ServiceName.of(ConnectorServices.RA_SERVICE, archiveName, cfName, configPropertyName);
ServiceName cfServiceName = ServiceName.of(ConnectorServices.RA_SERVICE, archiveName, cfName);
final ServiceTarget serviceTarget = context.getServiceTarget();
final CDConfigPropertiesService service = new CDConfigPropertiesService(configPropertyName, configPropertyValue);
serviceTarget.addService(serviceName, service).setInitialMode(ServiceController.Mode.ACTIVE).addDependency(cfServiceName, ModifiableConnDef.class, service.getRaInjector()).install();
}
use of org.jboss.msc.service.ServiceTarget in project wildfly by wildfly.
the class JcaSubsystemAdd method performBoottime.
protected void performBoottime(OperationContext context, ModelNode operation, ModelNode model) {
final boolean appclient = context.getProcessType() == ProcessType.APPLICATION_CLIENT;
final RaDeploymentActivator raDeploymentActivator = new RaDeploymentActivator(appclient);
context.addStep(new AbstractDeploymentChainStep() {
protected void execute(DeploymentProcessorTarget processorTarget) {
raDeploymentActivator.activateProcessors(processorTarget);
}
}, OperationContext.Stage.RUNTIME);
ServiceTarget serviceTarget = context.getServiceTarget();
TransactionIntegrationService tiService = new TransactionIntegrationService();
serviceTarget.addService(ConnectorServices.TRANSACTION_INTEGRATION_SERVICE, tiService).addDependency(TxnServices.JBOSS_TXN_TRANSACTION_MANAGER, TransactionManager.class, tiService.getTmInjector()).addDependency(TxnServices.JBOSS_TXN_SYNCHRONIZATION_REGISTRY, TransactionSynchronizationRegistry.class, tiService.getTsrInjector()).addDependency(TxnServices.JBOSS_TXN_USER_TRANSACTION_REGISTRY, org.jboss.tm.usertx.UserTransactionRegistry.class, tiService.getUtrInjector()).addDependency(TxnServices.JBOSS_TXN_CONTEXT_XA_TERMINATOR, JBossContextXATerminator.class, tiService.getTerminatorInjector()).addDependency(TxnServices.JBOSS_TXN_ARJUNA_RECOVERY_MANAGER, XAResourceRecoveryRegistry.class, tiService.getRrInjector()).setInitialMode(ServiceController.Mode.ACTIVE).install();
final JcaSubsystemConfiguration config = new JcaSubsystemConfiguration();
final JcaConfigService connectorConfigService = new JcaConfigService(config);
serviceTarget.addService(ConnectorServices.CONNECTOR_CONFIG_SERVICE, connectorConfigService).setInitialMode(Mode.ACTIVE).install();
final IdleRemoverService idleRemoverService = new IdleRemoverService();
serviceTarget.addService(ConnectorServices.IDLE_REMOVER_SERVICE, idleRemoverService).setInitialMode(Mode.ACTIVE).install();
final ConnectionValidatorService connectionValidatorService = new ConnectionValidatorService();
serviceTarget.addService(ConnectorServices.CONNECTION_VALIDATOR_SERVICE, connectionValidatorService).setInitialMode(Mode.ACTIVE).install();
// TODO does the install of this and the DriverProcessor
// belong in DataSourcesSubsystemAdd?
final DriverRegistryService driverRegistryService = new DriverRegistryService();
serviceTarget.addService(ConnectorServices.JDBC_DRIVER_REGISTRY_SERVICE, driverRegistryService).install();
raDeploymentActivator.activateServices(serviceTarget);
}
use of org.jboss.msc.service.ServiceTarget in project wildfly by wildfly.
the class ArchiveValidationAdd method performBoottime.
@Override
protected void performBoottime(final OperationContext context, final ModelNode operation, final ModelNode model) throws OperationFailedException {
final boolean enabled = JcaArchiveValidationDefinition.ArchiveValidationParameters.ARCHIVE_VALIDATION_ENABLED.getAttribute().resolveModelAttribute(context, model).asBoolean();
final boolean failOnError = JcaArchiveValidationDefinition.ArchiveValidationParameters.ARCHIVE_VALIDATION_FAIL_ON_ERROR.getAttribute().resolveModelAttribute(context, model).asBoolean();
final boolean failOnWarn = JcaArchiveValidationDefinition.ArchiveValidationParameters.ARCHIVE_VALIDATION_FAIL_ON_WARN.getAttribute().resolveModelAttribute(context, model).asBoolean();
ServiceName serviceName = ConnectorServices.ARCHIVE_VALIDATION_CONFIG_SERVICE;
ServiceName jcaConfigServiceName = ConnectorServices.CONNECTOR_CONFIG_SERVICE;
final ServiceTarget serviceTarget = context.getServiceTarget();
final ArchiveValidationService.ArchiveValidation config = new ArchiveValidationService.ArchiveValidation(enabled, failOnError, failOnWarn);
final ArchiveValidationService service = new ArchiveValidationService(config);
ServiceController<?> controller = serviceTarget.addService(serviceName, service).setInitialMode(ServiceController.Mode.ACTIVE).addDependency(jcaConfigServiceName, JcaSubsystemConfiguration.class, service.getJcaConfigInjector()).install();
}
use of org.jboss.msc.service.ServiceTarget in project wildfly by wildfly.
the class BeanValidationAdd method performBoottime.
@Override
protected void performBoottime(final OperationContext context, final ModelNode operation, final ModelNode model) throws OperationFailedException {
final boolean enabled = JcaBeanValidationDefinition.BeanValidationParameters.BEAN_VALIDATION_ENABLED.getAttribute().resolveModelAttribute(context, model).asBoolean();
ServiceName serviceName = ConnectorServices.BEAN_VALIDATION_CONFIG_SERVICE;
ServiceName jcaConfigServiceName = ConnectorServices.CONNECTOR_CONFIG_SERVICE;
final ServiceTarget serviceTarget = context.getServiceTarget();
final BeanValidationService.BeanValidation config = new BeanValidationService.BeanValidation(enabled);
final BeanValidationService service = new BeanValidationService(config);
ServiceController<?> controller = serviceTarget.addService(serviceName, service).setInitialMode(ServiceController.Mode.ACTIVE).addDependency(jcaConfigServiceName, JcaSubsystemConfiguration.class, service.getJcaConfigInjector()).install();
}
Aggregations