Search in sources :

Example 1 with DeploymentChainContributingResourceRegistration

use of org.jboss.as.clustering.controller.DeploymentChainContributingResourceRegistration in project wildfly by wildfly.

the class InfinispanSubsystemResourceDefinition 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()).addCapabilities(LOCAL_CLUSTERING_CAPABILITIES.values()).addCapabilities(CLUSTERING_CAPABILITIES.values());
    ResourceServiceHandler handler = new InfinispanSubsystemServiceHandler();
    new DeploymentChainContributingResourceRegistration(descriptor, handler, target -> target.addDeploymentProcessor(InfinispanExtension.SUBSYSTEM_NAME, Phase.DEPENDENCIES, Phase.DEPENDENCIES_CLUSTERING, new ClusteringDependencyProcessor())).register(registration);
    new CacheContainerResourceDefinition(this.pathManager, this.allowRuntimeOnlyRegistration).register(registration);
}
Also used : SubsystemResourceDefinition(org.jboss.as.clustering.controller.SubsystemResourceDefinition) SubsystemRegistration(org.jboss.as.controller.SubsystemRegistration) ResourceTransformationDescriptionBuilder(org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder) Map(java.util.Map) ClusteringDependencyProcessor(org.jboss.as.clustering.infinispan.deployment.ClusteringDependencyProcessor) ModelVersion(org.jboss.as.controller.ModelVersion) ModelDescriptionConstants(org.jboss.as.controller.descriptions.ModelDescriptionConstants) EnumSet(java.util.EnumSet) RuntimeCapability(org.jboss.as.controller.capability.RuntimeCapability) EnumMap(java.util.EnumMap) PathAddress(org.jboss.as.controller.PathAddress) ResourceDescriptor(org.jboss.as.clustering.controller.ResourceDescriptor) PathElement(org.jboss.as.controller.PathElement) DeploymentChainContributingResourceRegistration(org.jboss.as.clustering.controller.DeploymentChainContributingResourceRegistration) PathManager(org.jboss.as.controller.services.path.PathManager) TransformationDescription(org.jboss.as.controller.transform.description.TransformationDescription) ManagementResourceRegistration(org.jboss.as.controller.registry.ManagementResourceRegistration) ClusteringRequirement(org.wildfly.clustering.spi.ClusteringRequirement) TransformationDescriptionBuilder(org.jboss.as.controller.transform.description.TransformationDescriptionBuilder) ResourceServiceHandler(org.jboss.as.clustering.controller.ResourceServiceHandler) UnaryRequirementCapability(org.jboss.as.clustering.controller.UnaryRequirementCapability) LocalGroupBuilderProvider(org.wildfly.clustering.spi.LocalGroupBuilderProvider) RequirementCapability(org.jboss.as.clustering.controller.RequirementCapability) GenericSubsystemDescribeHandler(org.jboss.as.controller.operations.common.GenericSubsystemDescribeHandler) Phase(org.jboss.as.server.deployment.Phase) ManagementResourceRegistration(org.jboss.as.controller.registry.ManagementResourceRegistration) DeploymentChainContributingResourceRegistration(org.jboss.as.clustering.controller.DeploymentChainContributingResourceRegistration) ClusteringDependencyProcessor(org.jboss.as.clustering.infinispan.deployment.ClusteringDependencyProcessor) ResourceServiceHandler(org.jboss.as.clustering.controller.ResourceServiceHandler) ResourceDescriptor(org.jboss.as.clustering.controller.ResourceDescriptor)

Example 2 with DeploymentChainContributingResourceRegistration

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

DeploymentChainContributingResourceRegistration (org.jboss.as.clustering.controller.DeploymentChainContributingResourceRegistration)2 RequirementCapability (org.jboss.as.clustering.controller.RequirementCapability)2 ResourceDescriptor (org.jboss.as.clustering.controller.ResourceDescriptor)2 ResourceServiceHandler (org.jboss.as.clustering.controller.ResourceServiceHandler)2 SubsystemResourceDefinition (org.jboss.as.clustering.controller.SubsystemResourceDefinition)2 ModelVersion (org.jboss.as.controller.ModelVersion)2 PathElement (org.jboss.as.controller.PathElement)2 SubsystemRegistration (org.jboss.as.controller.SubsystemRegistration)2 ModelDescriptionConstants (org.jboss.as.controller.descriptions.ModelDescriptionConstants)2 GenericSubsystemDescribeHandler (org.jboss.as.controller.operations.common.GenericSubsystemDescribeHandler)2 ManagementResourceRegistration (org.jboss.as.controller.registry.ManagementResourceRegistration)2 ResourceTransformationDescriptionBuilder (org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder)2 TransformationDescription (org.jboss.as.controller.transform.description.TransformationDescription)2 TransformationDescriptionBuilder (org.jboss.as.controller.transform.description.TransformationDescriptionBuilder)2 Phase (org.jboss.as.server.deployment.Phase)2 EnumMap (java.util.EnumMap)1 EnumSet (java.util.EnumSet)1 Map (java.util.Map)1 CapabilityProvider (org.jboss.as.clustering.controller.CapabilityProvider)1 CapabilityReference (org.jboss.as.clustering.controller.CapabilityReference)1