Search in sources :

Example 1 with SubsystemRegistration

use of org.jboss.as.controller.SubsystemRegistration 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 SubsystemRegistration

use of org.jboss.as.controller.SubsystemRegistration 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 SubsystemRegistration

use of org.jboss.as.controller.SubsystemRegistration 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 SubsystemRegistration

use of org.jboss.as.controller.SubsystemRegistration 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 SubsystemRegistration

use of org.jboss.as.controller.SubsystemRegistration 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

SubsystemRegistration (org.jboss.as.controller.SubsystemRegistration)42 ManagementResourceRegistration (org.jboss.as.controller.registry.ManagementResourceRegistration)32 RequirementCapability (org.jboss.as.clustering.controller.RequirementCapability)3 ResourceDescriptor (org.jboss.as.clustering.controller.ResourceDescriptor)3 ResourceServiceHandler (org.jboss.as.clustering.controller.ResourceServiceHandler)3 SubsystemResourceDefinition (org.jboss.as.clustering.controller.SubsystemResourceDefinition)3 ModelVersion (org.jboss.as.controller.ModelVersion)3 PathElement (org.jboss.as.controller.PathElement)3 SimpleResourceDefinition (org.jboss.as.controller.SimpleResourceDefinition)3 ModelDescriptionConstants (org.jboss.as.controller.descriptions.ModelDescriptionConstants)3 ResourceTransformationDescriptionBuilder (org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder)3 TransformationDescription (org.jboss.as.controller.transform.description.TransformationDescription)3 TransformationDescriptionBuilder (org.jboss.as.controller.transform.description.TransformationDescriptionBuilder)3 EnumMap (java.util.EnumMap)2 EnumSet (java.util.EnumSet)2 Map (java.util.Map)2 CapabilityReference (org.jboss.as.clustering.controller.CapabilityReference)2 DeploymentChainContributingResourceRegistration (org.jboss.as.clustering.controller.DeploymentChainContributingResourceRegistration)2 CapabilityReferenceRecorder (org.jboss.as.controller.CapabilityReferenceRecorder)2 ResourceDefinition (org.jboss.as.controller.ResourceDefinition)2