Search in sources :

Example 1 with BatchJobExecutionResourceDefinition

use of org.wildfly.extension.batch.jberet.deployment.BatchJobExecutionResourceDefinition in project wildfly by wildfly.

the class BatchSubsystemExtension method initialize.

@Override
public void initialize(final ExtensionContext context) {
    final SubsystemRegistration subsystem = context.registerSubsystem(BatchSubsystemDefinition.NAME, CURRENT_MODEL_VERSION);
    subsystem.registerSubsystemModel(new BatchSubsystemDefinition(context.isRuntimeOnlyRegistrationValid()));
    subsystem.registerXMLElementWriter(new BatchSubsystemWriter());
    // Register the deployment resources
    if (context.isRuntimeOnlyRegistrationValid()) {
        final ManagementResourceRegistration deployments = subsystem.registerDeploymentModel(new BatchDeploymentResourceDefinition());
        final ManagementResourceRegistration jobRegistration = deployments.registerSubModel(BatchJobResourceDefinition.INSTANCE);
        jobRegistration.registerSubModel(new BatchJobExecutionResourceDefinition());
    }
}
Also used : BatchDeploymentResourceDefinition(org.wildfly.extension.batch.jberet.deployment.BatchDeploymentResourceDefinition) BatchJobExecutionResourceDefinition(org.wildfly.extension.batch.jberet.deployment.BatchJobExecutionResourceDefinition) ManagementResourceRegistration(org.jboss.as.controller.registry.ManagementResourceRegistration) SubsystemRegistration(org.jboss.as.controller.SubsystemRegistration)

Example 2 with BatchJobExecutionResourceDefinition

use of org.wildfly.extension.batch.jberet.deployment.BatchJobExecutionResourceDefinition in project wildfly by wildfly.

the class BatchSubsystemExtension method initialize.

@Override
public void initialize(ExtensionContext context) {
    final SubsystemRegistration subsystem = context.registerSubsystem(BatchSubsystemDefinition.NAME, CURRENT_MODEL_VERSION);
    subsystem.registerSubsystemModel(BatchSubsystemDefinition.INSTANCE);
    subsystem.registerXMLElementWriter(BatchSubsystemParser.INSTANCE);
    // Register the deployment resources
    if (context.isRuntimeOnlyRegistrationValid()) {
        final SimpleResourceDefinition deploymentResource = new SimpleResourceDefinition(new SimpleResourceDefinition.Parameters(BatchSubsystemDefinition.SUBSYSTEM_PATH, BatchResourceDescriptionResolver.getResourceDescriptionResolver("deployment")).setRuntime());
        final ManagementResourceRegistration deployments = subsystem.registerDeploymentModel(deploymentResource);
        final ManagementResourceRegistration jobRegistration = deployments.registerSubModel(BatchJobResourceDefinition.INSTANCE);
        jobRegistration.registerSubModel(new BatchJobExecutionResourceDefinition());
    }
}
Also used : BatchJobExecutionResourceDefinition(org.wildfly.extension.batch.jberet.deployment.BatchJobExecutionResourceDefinition) SimpleResourceDefinition(org.jboss.as.controller.SimpleResourceDefinition) ManagementResourceRegistration(org.jboss.as.controller.registry.ManagementResourceRegistration) SubsystemRegistration(org.jboss.as.controller.SubsystemRegistration)

Aggregations

SubsystemRegistration (org.jboss.as.controller.SubsystemRegistration)2 ManagementResourceRegistration (org.jboss.as.controller.registry.ManagementResourceRegistration)2 BatchJobExecutionResourceDefinition (org.wildfly.extension.batch.jberet.deployment.BatchJobExecutionResourceDefinition)2 SimpleResourceDefinition (org.jboss.as.controller.SimpleResourceDefinition)1 BatchDeploymentResourceDefinition (org.wildfly.extension.batch.jberet.deployment.BatchDeploymentResourceDefinition)1