Search in sources :

Example 1 with SingletonDeploymentParsingProcessor

use of org.wildfly.extension.clustering.singleton.deployment.SingletonDeploymentParsingProcessor in project wildfly by wildfly.

the class SingletonResourceDefinition method register.

@Override
public void register(SubsystemRegistration parentRegistration) {
    ManagementResourceRegistration registration = parentRegistration.registerSubsystemModel(this);
    registration.registerOperationHandler(GenericSubsystemDescribeHandler.DEFINITION, GenericSubsystemDescribeHandler.INSTANCE);
    ResourceDescriptor descriptor = new ResourceDescriptor(this.getResourceDescriptionResolver()).addAttributes(Attribute.class).addCapabilities(Capability.class);
    ResourceServiceHandler handler = new SingletonServiceHandler();
    new DeploymentChainContributingResourceRegistration(descriptor, handler, target -> {
        for (SingletonDeploymentSchema schema : SingletonDeploymentSchema.values()) {
            target.addDeploymentProcessor(SingletonExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, Phase.STRUCTURE_REGISTER_JBOSS_ALL_SINGLETON_DEPLOYMENT, new JBossAllXmlParserRegisteringProcessor<>(schema.getRoot(), SingletonDeploymentDependencyProcessor.CONFIGURATION_KEY, new SingletonDeploymentXMLReader(schema)));
        }
        target.addDeploymentProcessor(SingletonExtension.SUBSYSTEM_NAME, Phase.PARSE, Phase.PARSE_SINGLETON_DEPLOYMENT, new SingletonDeploymentParsingProcessor());
        target.addDeploymentProcessor(SingletonExtension.SUBSYSTEM_NAME, Phase.DEPENDENCIES, Phase.DEPENDENCIES_SINGLETON_DEPLOYMENT, new SingletonDeploymentDependencyProcessor());
        target.addDeploymentProcessor(SingletonExtension.SUBSYSTEM_NAME, Phase.CONFIGURE_MODULE, Phase.CONFIGURE_SINGLETON_DEPLOYMENT, new SingletonDeploymentProcessor());
    }).register(registration);
    new SingletonPolicyResourceDefinition().register(registration);
}
Also used : SingletonDeploymentParsingProcessor(org.wildfly.extension.clustering.singleton.deployment.SingletonDeploymentParsingProcessor) SubsystemResourceDefinition(org.jboss.as.clustering.controller.SubsystemResourceDefinition) SimpleAttributeDefinitionBuilder(org.jboss.as.controller.SimpleAttributeDefinitionBuilder) SingletonDefaultRequirement(org.wildfly.clustering.singleton.SingletonDefaultRequirement) CapabilityReference(org.jboss.as.clustering.controller.CapabilityReference) SingletonDeploymentXMLReader(org.wildfly.extension.clustering.singleton.deployment.SingletonDeploymentXMLReader) SubsystemRegistration(org.jboss.as.controller.SubsystemRegistration) SingletonDeploymentProcessor(org.wildfly.extension.clustering.singleton.deployment.SingletonDeploymentProcessor) ResourceTransformationDescriptionBuilder(org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder) ModelVersion(org.jboss.as.controller.ModelVersion) SingletonRequirement(org.wildfly.clustering.singleton.SingletonRequirement) Requirement(org.wildfly.clustering.service.Requirement) ModelDescriptionConstants(org.jboss.as.controller.descriptions.ModelDescriptionConstants) CapabilityReferenceRecorder(org.jboss.as.controller.CapabilityReferenceRecorder) JBossAllXmlParserRegisteringProcessor(org.jboss.as.server.deployment.jbossallxml.JBossAllXmlParserRegisteringProcessor) SimpleAttributeDefinition(org.jboss.as.controller.SimpleAttributeDefinition) SingletonDeploymentDependencyProcessor(org.wildfly.extension.clustering.singleton.deployment.SingletonDeploymentDependencyProcessor) ResourceDescriptor(org.jboss.as.clustering.controller.ResourceDescriptor) PathElement(org.jboss.as.controller.PathElement) DeploymentChainContributingResourceRegistration(org.jboss.as.clustering.controller.DeploymentChainContributingResourceRegistration) Flag(org.jboss.as.controller.registry.AttributeAccess.Flag) TransformationDescription(org.jboss.as.controller.transform.description.TransformationDescription) ManagementResourceRegistration(org.jboss.as.controller.registry.ManagementResourceRegistration) TransformationDescriptionBuilder(org.jboss.as.controller.transform.description.TransformationDescriptionBuilder) ResourceServiceHandler(org.jboss.as.clustering.controller.ResourceServiceHandler) SingletonDeploymentSchema(org.wildfly.extension.clustering.singleton.deployment.SingletonDeploymentSchema) CapabilityProvider(org.jboss.as.clustering.controller.CapabilityProvider) RequirementCapability(org.jboss.as.clustering.controller.RequirementCapability) GenericSubsystemDescribeHandler(org.jboss.as.controller.operations.common.GenericSubsystemDescribeHandler) Phase(org.jboss.as.server.deployment.Phase) ModelType(org.jboss.dmr.ModelType) JBossAllXmlParserRegisteringProcessor(org.jboss.as.server.deployment.jbossallxml.JBossAllXmlParserRegisteringProcessor) SingletonDeploymentProcessor(org.wildfly.extension.clustering.singleton.deployment.SingletonDeploymentProcessor) SingletonDeploymentParsingProcessor(org.wildfly.extension.clustering.singleton.deployment.SingletonDeploymentParsingProcessor) SingletonDeploymentSchema(org.wildfly.extension.clustering.singleton.deployment.SingletonDeploymentSchema) ManagementResourceRegistration(org.jboss.as.controller.registry.ManagementResourceRegistration) DeploymentChainContributingResourceRegistration(org.jboss.as.clustering.controller.DeploymentChainContributingResourceRegistration) SingletonDeploymentDependencyProcessor(org.wildfly.extension.clustering.singleton.deployment.SingletonDeploymentDependencyProcessor) ResourceServiceHandler(org.jboss.as.clustering.controller.ResourceServiceHandler) SingletonDeploymentXMLReader(org.wildfly.extension.clustering.singleton.deployment.SingletonDeploymentXMLReader) ResourceDescriptor(org.jboss.as.clustering.controller.ResourceDescriptor)

Aggregations

CapabilityProvider (org.jboss.as.clustering.controller.CapabilityProvider)1 CapabilityReference (org.jboss.as.clustering.controller.CapabilityReference)1 DeploymentChainContributingResourceRegistration (org.jboss.as.clustering.controller.DeploymentChainContributingResourceRegistration)1 RequirementCapability (org.jboss.as.clustering.controller.RequirementCapability)1 ResourceDescriptor (org.jboss.as.clustering.controller.ResourceDescriptor)1 ResourceServiceHandler (org.jboss.as.clustering.controller.ResourceServiceHandler)1 SubsystemResourceDefinition (org.jboss.as.clustering.controller.SubsystemResourceDefinition)1 CapabilityReferenceRecorder (org.jboss.as.controller.CapabilityReferenceRecorder)1 ModelVersion (org.jboss.as.controller.ModelVersion)1 PathElement (org.jboss.as.controller.PathElement)1 SimpleAttributeDefinition (org.jboss.as.controller.SimpleAttributeDefinition)1 SimpleAttributeDefinitionBuilder (org.jboss.as.controller.SimpleAttributeDefinitionBuilder)1 SubsystemRegistration (org.jboss.as.controller.SubsystemRegistration)1 ModelDescriptionConstants (org.jboss.as.controller.descriptions.ModelDescriptionConstants)1 GenericSubsystemDescribeHandler (org.jboss.as.controller.operations.common.GenericSubsystemDescribeHandler)1 Flag (org.jboss.as.controller.registry.AttributeAccess.Flag)1 ManagementResourceRegistration (org.jboss.as.controller.registry.ManagementResourceRegistration)1 ResourceTransformationDescriptionBuilder (org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder)1 TransformationDescription (org.jboss.as.controller.transform.description.TransformationDescription)1 TransformationDescriptionBuilder (org.jboss.as.controller.transform.description.TransformationDescriptionBuilder)1