Search in sources :

Example 1 with ManagementResourceRegistration

use of org.jboss.as.controller.registry.ManagementResourceRegistration in project wildfly by wildfly.

the class JPAExtension method initialize.

@Override
public void initialize(ExtensionContext context) {
    SubsystemRegistration registration = context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION);
    final ManagementResourceRegistration nodeRegistration = registration.registerSubsystemModel(JPADefinition.INSTANCE);
    nodeRegistration.registerOperationHandler(GenericSubsystemDescribeHandler.DEFINITION, GenericSubsystemDescribeHandler.INSTANCE);
    registration.registerXMLElementWriter(parser1_1);
    try {
        PersistenceProviderLoader.loadDefaultProvider();
    } catch (ModuleLoadException e) {
        ROOT_LOGGER.errorPreloadingDefaultProvider(e);
    }
    if (context.isRuntimeOnlyRegistrationValid()) {
        registration.registerDeploymentModel(JPADefinition.INSTANCE);
    }
}
Also used : ModuleLoadException(org.jboss.modules.ModuleLoadException) ManagementResourceRegistration(org.jboss.as.controller.registry.ManagementResourceRegistration) SubsystemRegistration(org.jboss.as.controller.SubsystemRegistration)

Example 2 with ManagementResourceRegistration

use of org.jboss.as.controller.registry.ManagementResourceRegistration in project wildfly by wildfly.

the class JSR77ManagementExtension method initialize.

/**
     * {@inheritDoc}
     */
@Override
public void initialize(ExtensionContext context) {
    final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION);
    // Register the root subsystem resource.
    final ManagementResourceRegistration rootResource = subsystem.registerSubsystemModel(new JSR77ManagementRootResource(context.getProcessType() == ProcessType.APPLICATION_CLIENT));
    // Mandatory describe operation
    rootResource.registerOperationHandler(GenericSubsystemDescribeHandler.DEFINITION, GenericSubsystemDescribeHandler.INSTANCE);
    subsystem.registerXMLElementWriter(parser);
}
Also used : ManagementResourceRegistration(org.jboss.as.controller.registry.ManagementResourceRegistration) SubsystemRegistration(org.jboss.as.controller.SubsystemRegistration)

Example 3 with ManagementResourceRegistration

use of org.jboss.as.controller.registry.ManagementResourceRegistration in project wildfly by wildfly.

the class CmpExtension method initializeLegacyModel.

@Override
protected Set<ManagementResourceRegistration> initializeLegacyModel(final ExtensionContext context) {
    final SubsystemRegistration subsystemRegistration = context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION);
    subsystemRegistration.registerXMLElementWriter(CmpSubsystem11Parser.INSTANCE);
    final ManagementResourceRegistration subsystem = subsystemRegistration.registerSubsystemModel(CMPSubsystemRootResourceDefinition.INSTANCE);
    subsystem.registerSubModel(UUIDKeyGeneratorResourceDefinition.INSTANCE);
    subsystem.registerSubModel(HiLoKeyGeneratorResourceDefinition.INSTANCE);
    if (context.isRegisterTransformers()) {
        registerTransformers(subsystemRegistration);
    }
    return Collections.singleton(subsystem);
}
Also used : ManagementResourceRegistration(org.jboss.as.controller.registry.ManagementResourceRegistration) SubsystemRegistration(org.jboss.as.controller.SubsystemRegistration)

Example 4 with ManagementResourceRegistration

use of org.jboss.as.controller.registry.ManagementResourceRegistration in project wildfly by wildfly.

the class MailExtension method initialize.

@Override
public void initialize(ExtensionContext context) {
    final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION);
    final ManagementResourceRegistration subsystemRegistration = subsystem.registerSubsystemModel(MailSubsystemResource.INSTANCE);
    subsystemRegistration.registerOperationHandler(GenericSubsystemDescribeHandler.DEFINITION, GenericSubsystemDescribeHandler.INSTANCE);
    if (context.isRegisterTransformers()) {
        registerTransformers(subsystem);
    }
    subsystem.registerXMLElementWriter(MailSubsystemParser2_1.INSTANCE);
}
Also used : ManagementResourceRegistration(org.jboss.as.controller.registry.ManagementResourceRegistration) SubsystemRegistration(org.jboss.as.controller.SubsystemRegistration)

Example 5 with ManagementResourceRegistration

use of org.jboss.as.controller.registry.ManagementResourceRegistration 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);
    }
}
Also used : JMSTopicDefinition(org.wildfly.extension.messaging.activemq.jms.JMSTopicDefinition) SimpleResourceDefinition(org.jboss.as.controller.SimpleResourceDefinition) ManagementResourceRegistration(org.jboss.as.controller.registry.ManagementResourceRegistration) JMSQueueDefinition(org.wildfly.extension.messaging.activemq.jms.JMSQueueDefinition) SubsystemRegistration(org.jboss.as.controller.SubsystemRegistration)

Aggregations

ManagementResourceRegistration (org.jboss.as.controller.registry.ManagementResourceRegistration)79 SubsystemRegistration (org.jboss.as.controller.SubsystemRegistration)32 ResourceDescriptor (org.jboss.as.clustering.controller.ResourceDescriptor)30 ResourceServiceHandler (org.jboss.as.clustering.controller.ResourceServiceHandler)26 SimpleResourceRegistration (org.jboss.as.clustering.controller.SimpleResourceRegistration)25 SimpleResourceServiceHandler (org.jboss.as.clustering.controller.SimpleResourceServiceHandler)16 PathElement (org.jboss.as.controller.PathElement)12 SimpleAliasEntry (org.jboss.as.clustering.controller.SimpleAliasEntry)9 PathAddress (org.jboss.as.controller.PathAddress)9 ModelNode (org.jboss.dmr.ModelNode)8 OperationStepHandler (org.jboss.as.controller.OperationStepHandler)7 Resource (org.jboss.as.controller.registry.Resource)7 Map (java.util.Map)6 Locale (java.util.Locale)5 UnaryRequirementCapability (org.jboss.as.clustering.controller.UnaryRequirementCapability)5 OperationContext (org.jboss.as.controller.OperationContext)5 EnumMap (java.util.EnumMap)4 EnumSet (java.util.EnumSet)4 AttributeDefinition (org.jboss.as.controller.AttributeDefinition)4 SimpleAttributeDefinitionBuilder (org.jboss.as.controller.SimpleAttributeDefinitionBuilder)4