use of org.jboss.as.controller.SimpleResourceDefinition in project wildfly by wildfly.
the class MessagingExtension method initialize.
public void initialize(ExtensionContext context) {
final SubsystemRegistration subsystemRegistration = context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION);
subsystemRegistration.registerXMLElementWriter(MessagingSubsystemParser_1_1.INSTANCE);
boolean registerRuntimeOnly = context.isRuntimeOnlyRegistrationValid();
// Root resource
final ManagementResourceRegistration subsystem = subsystemRegistration.registerSubsystemModel(MessagingSubsystemRootResourceDefinition.INSTANCE);
subsystem.registerOperationHandler(GenericSubsystemDescribeHandler.DEFINITION, GenericSubsystemDescribeHandler.INSTANCE);
// ActiveMQ Servers
final ManagementResourceRegistration server = subsystem.registerSubModel(new ServerDefinition(registerRuntimeOnly));
for (PathDefinition path : new PathDefinition[] { PathDefinition.JOURNAL_INSTANCE, PathDefinition.BINDINGS_INSTANCE, PathDefinition.LARGE_MESSAGES_INSTANCE, PathDefinition.PAGING_INSTANCE }) {
ManagementResourceRegistration pathRegistry = server.registerSubModel(path);
PathDefinition.registerResolveOperationHandler(context, pathRegistry);
}
subsystem.registerSubModel(JMSBridgeDefinition.INSTANCE);
if (registerRuntimeOnly) {
final ManagementResourceRegistration deployment = subsystemRegistration.registerDeploymentModel(new SimpleResourceDefinition(SUBSYSTEM_PATH, getResourceDescriptionResolver("deployed")));
final ManagementResourceRegistration deployedServer = deployment.registerSubModel(new SimpleResourceDefinition(SERVER_PATH, getResourceDescriptionResolver(SERVER)));
deployedServer.registerSubModel(new JMSQueueDefinition(true, registerRuntimeOnly));
deployedServer.registerSubModel(new JMSTopicDefinition(true, registerRuntimeOnly));
deployedServer.registerSubModel(PooledConnectionFactoryDefinition.DEPLOYMENT_INSTANCE);
}
if (context.isRegisterTransformers()) {
MessagingSubsystemRootResourceDefinition.registerTransformers(subsystemRegistration);
}
}
use of org.jboss.as.controller.SimpleResourceDefinition 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());
}
}
use of org.jboss.as.controller.SimpleResourceDefinition in project wildfly by wildfly.
the class EeLegacySubsystemTestCase method createAdditionalInitialization.
@Override
protected AdditionalInitialization createAdditionalInitialization() {
return new AdditionalInitialization() {
@Override
protected RunningMode getRunningMode() {
return RunningMode.ADMIN_ONLY;
}
@Override
protected void initializeExtraSubystemsAndModel(ExtensionRegistry extensionRegistry, Resource rootResource, ManagementResourceRegistration rootRegistration, RuntimeCapabilityRegistry capabilityRegistry) {
if (!extensionAdded) {
//extensionAdded = true;
//bean validation depends on EE, so we can't use the real subsystem here
final OperationDefinition removeExtension = new SimpleOperationDefinitionBuilder("remove", NonResolvingResourceDescriptionResolver.INSTANCE).build();
final OperationDefinition addExtension = new SimpleOperationDefinitionBuilder("add", NonResolvingResourceDescriptionResolver.INSTANCE).addParameter(new SimpleAttributeDefinition("module", ModelType.STRING, false)).build();
PathElement bvExtension = PathElement.pathElement(EXTENSION, "org.wildfly.extension.bean-validation");
ManagementResourceRegistration extensionRegistration = rootRegistration.registerSubModel(new SimpleResourceDefinition(bvExtension, NonResolvingResourceDescriptionResolver.INSTANCE));
extensionRegistration.registerReadOnlyAttribute(new SimpleAttributeDefinition("module", ModelType.STRING, false), new ReloadRequiredWriteAttributeHandler());
extensionRegistration.registerOperationHandler(removeExtension, new ReloadRequiredRemoveStepHandler());
extensionRegistration.registerOperationHandler(addExtension, new ReloadRequiredAddStepHandler(new SimpleAttributeDefinition("module", ModelType.STRING, false)));
final OperationDefinition removeSubsystem = new SimpleOperationDefinitionBuilder("remove", NonResolvingResourceDescriptionResolver.INSTANCE).build();
final OperationDefinition addSubsystem = new SimpleOperationDefinitionBuilder("add", NonResolvingResourceDescriptionResolver.INSTANCE).build();
PathElement bvSubsystem = PathElement.pathElement(SUBSYSTEM, "bean-validation");
ManagementResourceRegistration subsystemRegistration = rootRegistration.registerSubModel(new SimpleResourceDefinition(bvSubsystem, NonResolvingResourceDescriptionResolver.INSTANCE));
subsystemRegistration.registerOperationHandler(removeSubsystem, new ReloadRequiredRemoveStepHandler());
subsystemRegistration.registerOperationHandler(addSubsystem, new ReloadRequiredAddStepHandler());
}
}
};
}
use of org.jboss.as.controller.SimpleResourceDefinition in project wildfly by wildfly.
the class EJB3Extension method initialize.
/**
* {@inheritDoc}
*/
@Override
public void initialize(ExtensionContext context) {
final boolean registerRuntimeOnly = context.isRuntimeOnlyRegistrationValid();
final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION);
subsystem.registerXMLElementWriter(EJB3SubsystemXMLPersister.INSTANCE);
PathManager pathManager = context.getProcessType().isServer() ? context.getPathManager() : null;
subsystem.registerSubsystemModel(new EJB3SubsystemRootResourceDefinition(registerRuntimeOnly, pathManager));
if (registerRuntimeOnly) {
ResourceDefinition deploymentsDef = new SimpleResourceDefinition(PathElement.pathElement(ModelDescriptionConstants.SUBSYSTEM, SUBSYSTEM_NAME), getResourceDescriptionResolver("deployed"));
final ManagementResourceRegistration deploymentsRegistration = subsystem.registerDeploymentModel(deploymentsDef);
deploymentsRegistration.registerSubModel(MessageDrivenBeanResourceDefinition.INSTANCE);
deploymentsRegistration.registerSubModel(SingletonBeanDeploymentResourceDefinition.INSTANCE);
deploymentsRegistration.registerSubModel(StatelessSessionBeanDeploymentResourceDefinition.INSTANCE);
deploymentsRegistration.registerSubModel(StatefulSessionBeanDeploymentResourceDefinition.INSTANCE);
}
// Transformers
if (context.isRegisterTransformers()) {
EJB3SubsystemRootResourceDefinition.registerTransformers(subsystem);
}
}
Aggregations