Search in sources :

Example 66 with ModelNode

use of org.jboss.dmr.ModelNode in project wildfly by wildfly.

the class ResourceAdaptersSubsystemTestCase method testRejectingTransformer300.

private void testRejectingTransformer300(String subsystemXml, ModelTestControllerVersion controllerVersion, ModelVersion modelVersion) throws Exception {
    //Use the non-runtime version of the extension which will happen on the HC
    KernelServicesBuilder builder = createKernelServicesBuilder(AdditionalInitialization.MANAGEMENT);
    //.setSubsystemXmlResource(subsystemXml);
    // Add legacy subsystems
    builder.createLegacyKernelServicesBuilder(null, controllerVersion, modelVersion).addMavenResourceURL("org.jboss.as:jboss-as-connector:" + controllerVersion.getMavenGavVersion()).addMavenResourceURL("org.jboss.ironjacamar:ironjacamar-spec-api:1.1.4.Final").addMavenResourceURL("org.jboss.ironjacamar:ironjacamar-common-api:1.1.4.Final").setExtensionClassName("org.jboss.as.connector.subsystems.resourceadapters.ResourceAdaptersExtension").addOperationValidationResolve("add", PathAddress.pathAddress(PathElement.pathElement(SUBSYSTEM, getMainSubsystemName()), PathElement.pathElement("resource-adapter", "*"), PathElement.pathElement("connection-definitions", "*"))).excludeFromParent(SingleClassFilter.createFilter(ConnectorLogger.class)).skipReverseControllerCheck();
    KernelServices mainServices = builder.build();
    org.junit.Assert.assertTrue(mainServices.isSuccessfulBoot());
    KernelServices legacyServices = mainServices.getLegacyServices(modelVersion);
    org.junit.Assert.assertTrue(legacyServices.isSuccessfulBoot());
    org.junit.Assert.assertNotNull(legacyServices);
    List<ModelNode> ops = builder.parseXmlResource(subsystemXml);
    PathAddress subsystemAddress = PathAddress.pathAddress(ResourceAdaptersExtension.SUBSYSTEM_PATH);
    ModelTestUtils.checkFailedTransformedBootOperations(mainServices, modelVersion, ops, new FailedOperationTransformationConfig().addFailedAttribute(subsystemAddress.append(PathElement.pathElement(RESOURCEADAPTER_NAME), ConnectionDefinitionResourceDefinition.PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE));
}
Also used : FailedOperationTransformationConfig(org.jboss.as.model.test.FailedOperationTransformationConfig) PathAddress(org.jboss.as.controller.PathAddress) KernelServices(org.jboss.as.subsystem.test.KernelServices) ModelNode(org.jboss.dmr.ModelNode) KernelServicesBuilder(org.jboss.as.subsystem.test.KernelServicesBuilder)

Example 67 with ModelNode

use of org.jboss.dmr.ModelNode in project wildfly by wildfly.

the class ResourceAdaptersSubsystemTestCase method testRejectingTransformerElytronEnabled.

/**
     * Tests transformation of model from current to passed one
     *
     * @throws Exception
     */
private void testRejectingTransformerElytronEnabled(String subsystemXml, ModelTestControllerVersion controllerVersion, ModelVersion modelVersion) throws Exception {
    //Use the non-runtime version of the extension which will happen on the HC
    KernelServicesBuilder builder = createKernelServicesBuilder(AdditionalInitialization.MANAGEMENT);
    //.setSubsystemXmlResource(subsystemXml);
    // Add legacy subsystems
    builder.createLegacyKernelServicesBuilder(null, controllerVersion, modelVersion).addMavenResourceURL("org.jboss.as:jboss-as-connector:" + controllerVersion.getMavenGavVersion()).addMavenResourceURL("org.jboss.ironjacamar:ironjacamar-spec-api:1.1.4.Final").addMavenResourceURL("org.jboss.ironjacamar:ironjacamar-common-api:1.1.4.Final").setExtensionClassName("org.jboss.as.connector.subsystems.resourceadapters.ResourceAdaptersExtension").addOperationValidationResolve("add", PathAddress.pathAddress(PathElement.pathElement(SUBSYSTEM, getMainSubsystemName()), PathElement.pathElement("resource-adapter", "*"), PathElement.pathElement("connection-definitions", "*"))).excludeFromParent(SingleClassFilter.createFilter(ConnectorLogger.class)).skipReverseControllerCheck();
    KernelServices mainServices = builder.build();
    org.junit.Assert.assertTrue(mainServices.isSuccessfulBoot());
    KernelServices legacyServices = mainServices.getLegacyServices(modelVersion);
    org.junit.Assert.assertTrue(legacyServices.isSuccessfulBoot());
    org.junit.Assert.assertNotNull(legacyServices);
    List<ModelNode> ops = builder.parseXmlResource(subsystemXml);
    PathAddress subsystemAddress = PathAddress.pathAddress(ResourceAdaptersExtension.SUBSYSTEM_PATH);
    ModelTestUtils.checkFailedTransformedBootOperations(mainServices, modelVersion, ops, new FailedOperationTransformationConfig().addFailedAttribute(subsystemAddress.append(PathElement.pathElement(RESOURCEADAPTER_NAME)), new FailedOperationTransformationConfig.AttributesPathAddressConfig(WM_SECURITY.getName(), WM_SECURITY_MAPPING_REQUIRED.getName(), WM_ELYTRON_SECURITY_DOMAIN.getName(), MODULE.getName(), STATISTICS_ENABLED.getName()) {

        @Override
        protected boolean isAttributeWritable(String attributeName) {
            return false;
        }

        @Override
        protected boolean checkValue(String attrName, ModelNode attribute, boolean isWriteAttribute) {
            if (attribute.isDefined()) {
                return true;
            } else {
                return false;
            }
        }

        @Override
        protected ModelNode correctValue(ModelNode toResolve, boolean isWriteAttribute) {
            return new ModelNode();
        }
    }).addFailedAttribute(subsystemAddress.append(PathElement.pathElement(RESOURCEADAPTER_NAME), ConnectionDefinitionResourceDefinition.PATH), FailedOperationTransformationConfig.ChainedConfig.createBuilder(Constants.CONNECTABLE, Constants.TRACKING).addConfig(new FailedOperationTransformationConfig.RejectExpressionsConfig(Constants.CONNECTABLE) {

        @Override
        protected boolean checkValue(String attrName, ModelNode attribute, boolean isWriteAttribute) {
            if (super.checkValue(attrName, attribute, isWriteAttribute)) {
                return true;
            }
            return attribute.asBoolean();
        }

        @Override
        protected ModelNode correctValue(ModelNode toResolve, boolean isWriteAttribute) {
            return new ModelNode(false);
        }
    }).addConfig(new FailedOperationTransformationConfig.AttributesPathAddressConfig(TRACKING.getName(), ELYTRON_ENABLED.getName(), AUTHENTICATION_CONTEXT.getName(), MCP.getName(), RECOVERY_ELYTRON_ENABLED.getName(), RECOVERY_AUTHENTICATION_CONTEXT.getName(), RECOVERY_CREDENTIAL_REFERENCE.getName()) {

        @Override
        protected boolean isAttributeWritable(String attributeName) {
            return false;
        }

        @Override
        protected boolean checkValue(String attrName, ModelNode attribute, boolean isWriteAttribute) {
            if (attribute.isDefined()) {
                return true;
            } else {
                return false;
            }
        }

        @Override
        protected ModelNode correctValue(ModelNode toResolve, boolean isWriteAttribute) {
            return new ModelNode();
        }
    }).build()));
}
Also used : FailedOperationTransformationConfig(org.jboss.as.model.test.FailedOperationTransformationConfig) PathAddress(org.jboss.as.controller.PathAddress) KernelServices(org.jboss.as.subsystem.test.KernelServices) ModelNode(org.jboss.dmr.ModelNode) KernelServicesBuilder(org.jboss.as.subsystem.test.KernelServicesBuilder)

Example 68 with ModelNode

use of org.jboss.dmr.ModelNode in project wildfly by wildfly.

the class EESubsystemXmlPersister method writeContent.

/**
     * {@inheritDoc}
     */
@Override
public void writeContent(XMLExtendedStreamWriter writer, SubsystemMarshallingContext context) throws XMLStreamException {
    context.startSubsystemElement(Namespace.CURRENT.getUriString(), false);
    ModelNode eeSubSystem = context.getModelNode();
    GlobalModulesDefinition.INSTANCE.marshallAsElement(eeSubSystem, writer);
    EeSubsystemRootResource.EAR_SUBDEPLOYMENTS_ISOLATED.marshallAsElement(eeSubSystem, writer);
    EeSubsystemRootResource.SPEC_DESCRIPTOR_PROPERTY_REPLACEMENT.marshallAsElement(eeSubSystem, writer);
    EeSubsystemRootResource.JBOSS_DESCRIPTOR_PROPERTY_REPLACEMENT.marshallAsElement(eeSubSystem, writer);
    EeSubsystemRootResource.ANNOTATION_PROPERTY_REPLACEMENT.marshallAsElement(eeSubSystem, writer);
    writeConcurrentElement(writer, eeSubSystem);
    writeDefaultBindingsElement(writer, eeSubSystem);
    writer.writeEndElement();
}
Also used : ModelNode(org.jboss.dmr.ModelNode)

Example 69 with ModelNode

use of org.jboss.dmr.ModelNode in project wildfly by wildfly.

the class EeSubsystemAdd method performBoottime.

protected void performBoottime(final OperationContext context, final ModelNode operation, final Resource resource) throws OperationFailedException {
    ModelNode model = resource.getModel();
    final EEJndiViewExtension extension = new EEJndiViewExtension();
    context.getServiceTarget().addService(EEJndiViewExtension.SERVICE_NAME, extension).addDependency(JndiViewExtensionRegistry.SERVICE_NAME, JndiViewExtensionRegistry.class, extension.getRegistryInjector()).install();
    final boolean appclient = context.getProcessType() == ProcessType.APPLICATION_CLIENT;
    final ModelNode globalModules = GlobalModulesDefinition.INSTANCE.resolveModelAttribute(context, model);
    // see if the ear subdeployment isolation flag is set. By default, we don't isolate subdeployments, so that
    // they can see each other's classes.
    final boolean earSubDeploymentsIsolated = EeSubsystemRootResource.EAR_SUBDEPLOYMENTS_ISOLATED.resolveModelAttribute(context, model).asBoolean();
    final boolean specDescriptorPropertyReplacement = EeSubsystemRootResource.SPEC_DESCRIPTOR_PROPERTY_REPLACEMENT.resolveModelAttribute(context, model).asBoolean();
    final boolean jbossDescriptorPropertyReplacement = EeSubsystemRootResource.JBOSS_DESCRIPTOR_PROPERTY_REPLACEMENT.resolveModelAttribute(context, model).asBoolean();
    final boolean ejbAnnotationPropertyReplacement = EeSubsystemRootResource.ANNOTATION_PROPERTY_REPLACEMENT.resolveModelAttribute(context, model).asBoolean();
    moduleDependencyProcessor.setGlobalModules(GlobalModulesDefinition.createModuleList(context, globalModules));
    isolationProcessor.setEarSubDeploymentsIsolated(earSubDeploymentsIsolated);
    specDescriptorPropertyReplacementProcessor.setDescriptorPropertyReplacement(specDescriptorPropertyReplacement);
    jbossDescriptorPropertyReplacementProcessor.setDescriptorPropertyReplacement(jbossDescriptorPropertyReplacement);
    ejbAnnotationPropertyReplacementProcessor.setDescriptorPropertyReplacement(ejbAnnotationPropertyReplacement);
    context.addStep(new AbstractDeploymentChainStep() {

        protected void execute(DeploymentProcessorTarget processorTarget) {
            ROOT_LOGGER.debug("Activating EE subsystem");
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, Phase.STRUCTURE_EE_DEPLOYMENT_PROPERTIES, new DeploymentPropertiesProcessor());
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, Phase.STRUCTURE_EE_DEPLOYMENT_PROPERTY_RESOLVER, new DeploymentPropertyResolverProcessor());
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, Phase.STRUCTURE_EE_VAULT_PROPERTY_RESOLVER, new VaultPropertyResolverProcessor());
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, Phase.STRUCTURE_EE_SYSTEM_PROPERTY_RESOLVER, new SystemPropertyResolverProcessor());
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, Phase.STRUCTURE_EE_PROPERTY_RESOLVER, new PropertyResolverProcessor());
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, Phase.STRUCTURE_REGISTER_JBOSS_ALL_EE_APP, new JBossAllXmlParserRegisteringProcessor<JBossAppMetaData>(AppJBossAllParser.ROOT_ELEMENT, AppJBossAllParser.ATTACHMENT_KEY, new AppJBossAllParser()));
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, Phase.STRUCTURE_EE_SPEC_DESC_PROPERTY_REPLACEMENT, specDescriptorPropertyReplacementProcessor);
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, Phase.STRUCTURE_EE_JBOSS_DESC_PROPERTY_REPLACEMENT, jbossDescriptorPropertyReplacementProcessor);
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, Phase.STRUCTURE_EE_EJB_ANNOTATION_PROPERTY_REPLACEMENT, ejbAnnotationPropertyReplacementProcessor);
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, Phase.STRUCTURE_EAR_DEPLOYMENT_INIT, new EarInitializationProcessor());
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, Phase.STRUCTURE_EAR_APP_XML_PARSE, new EarMetaDataParsingProcessor());
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, Phase.STRUCTURE_JBOSS_EJB_CLIENT_XML_PARSE, new EJBClientDescriptorParsingProcessor());
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, Phase.STRUCTURE_EJB_EAR_APPLICATION_NAME, new EarApplicationNameProcessor());
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, Phase.STRUCTURE_EAR, new EarStructureProcessor());
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, Phase.STRUCTURE_EJB_JAR_IN_EAR, new EjbJarDeploymentProcessor());
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, Phase.STRUCTURE_APPLICATION_CLIENT_IN_EAR, new ApplicationClientDeploymentProcessor());
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, Phase.STRUCTURE_MANAGED_BEAN_JAR_IN_EAR, new ManagedBeanSubDeploymentMarkingProcessor());
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, Phase.STRUCTURE_EAR_SUB_DEPLYOMENTS_ISOLATED, isolationProcessor);
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, Phase.STRUCTURE_EE_MODULE_INIT, new EEModuleInitialProcessor(context.getProcessType() == ProcessType.APPLICATION_CLIENT));
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, Phase.STRUCTURE_EE_RESOURCE_INJECTION_REGISTRY, new ResourceReferenceRegistrySetupProcessor());
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, Phase.STRUCTURE_GLOBAL_MODULES, moduleDependencyProcessor);
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.PARSE, Phase.PARSE_EE_MODULE_NAME, new EEModuleNameProcessor());
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.PARSE, Phase.PARSE_EE_ANNOTATIONS, new EEAnnotationProcessor());
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.PARSE, Phase.PARSE_LIFECYCLE_ANNOTATION, new LifecycleAnnotationParsingProcessor());
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.PARSE, Phase.PARSE_AROUNDINVOKE_ANNOTATION, new AroundInvokeAnnotationParsingProcessor());
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.PARSE, Phase.PARSE_DISTINCT_NAME, new EEDistinctNameProcessor());
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.PARSE, Phase.PARSE_EAR_MESSAGE_DESTINATIONS, new EarMessageDestinationProcessor());
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.PARSE, Phase.PARSE_MANAGED_BEAN_ANNOTATION, new ManagedBeanAnnotationProcessor());
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.PARSE, Phase.PARSE_DESCRIPTOR_LIFECYCLE_METHOD_RESOLUTION, new DescriptorEnvironmentLifecycleMethodProcessor());
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.DEPENDENCIES, Phase.DEPENDENCIES_EE_PERMISSIONS, new EEDefaultPermissionsProcessor());
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.DEPENDENCIES, Phase.DEPENDENCIES_MANAGED_BEAN, new JavaEEDependencyProcessor());
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.DEPENDENCIES, Phase.DEPENDENCIES_EE_CLASS_DESCRIPTIONS, new ApplicationClassesAggregationProcessor());
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.POST_MODULE, Phase.POST_MODULE_EAR_DEPENDENCY, new EarDependencyProcessor());
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.POST_MODULE, Phase.POST_INITIALIZE_IN_ORDER, new InitializeInOrderProcessor());
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.POST_MODULE, Phase.POST_MODULE_INJECTION_ANNOTATION, new ResourceInjectionAnnotationParsingProcessor());
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.POST_MODULE, Phase.POST_MODULE_ENV_ENTRY, new ResourceReferenceProcessor());
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.POST_MODULE, Phase.POST_MODULE_INTERCEPTOR_ANNOTATIONS, new InterceptorAnnotationProcessor());
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.POST_MODULE, Phase.POST_MODULE_NAMING_CONTEXT, new ModuleContextProcessor());
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.POST_MODULE, Phase.POST_MODULE_IN_APP_CLIENT, new InApplicationClientBindingProcessor(appclient));
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.POST_MODULE, Phase.POST_MODULE_EE_INSTANCE_NAME, new InstanceNameBindingProcessor());
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.POST_MODULE, Phase.POST_MODULE_APP_NAMING_CONTEXT, new ApplicationContextProcessor());
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.POST_MODULE, Phase.POST_MODULE_EE_CONCURRENT_CONTEXT, new EEConcurrentContextProcessor());
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.INSTALL, Phase.INSTALL_RESOLVE_MESSAGE_DESTINATIONS, new MessageDestinationResolutionProcessor());
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.INSTALL, Phase.INSTALL_COMPONENT_AGGREGATION, new ComponentAggregationProcessor());
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.INSTALL, Phase.INSTALL_DEFAULT_BINDINGS_EE_CONCURRENCY, new EEConcurrentDefaultBindingProcessor());
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.INSTALL, Phase.INSTALL_MODULE_JNDI_BINDINGS, new ModuleJndiBindingProcessor());
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.INSTALL, Phase.INSTALL_EE_MODULE_CONFIG, new EEModuleConfigurationProcessor());
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.INSTALL, Phase.INSTALL_EE_COMPONENT, new ComponentInstallProcessor());
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.CLEANUP, Phase.CLEANUP_EE, new EECleanUpProcessor());
        }
    }, OperationContext.Stage.RUNTIME);
    context.getServiceTarget().addService(ReflectiveClassIntrospector.SERVICE_NAME, new ReflectiveClassIntrospector()).install();
}
Also used : EarMetaDataParsingProcessor(org.jboss.as.ee.structure.EarMetaDataParsingProcessor) ApplicationClientDeploymentProcessor(org.jboss.as.ee.structure.ApplicationClientDeploymentProcessor) DescriptorEnvironmentLifecycleMethodProcessor(org.jboss.as.ee.component.deployers.DescriptorEnvironmentLifecycleMethodProcessor) InterceptorAnnotationProcessor(org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor) LifecycleAnnotationParsingProcessor(org.jboss.as.ee.component.deployers.LifecycleAnnotationParsingProcessor) JndiViewExtensionRegistry(org.jboss.as.naming.management.JndiViewExtensionRegistry) EarInitializationProcessor(org.jboss.as.ee.structure.EarInitializationProcessor) EEModuleInitialProcessor(org.jboss.as.ee.component.deployers.EEModuleInitialProcessor) MessageDestinationResolutionProcessor(org.jboss.as.ee.component.deployers.MessageDestinationResolutionProcessor) JavaEEDependencyProcessor(org.jboss.as.ee.managedbean.processors.JavaEEDependencyProcessor) ResourceReferenceRegistrySetupProcessor(org.jboss.as.ee.component.deployers.ResourceReferenceRegistrySetupProcessor) VaultPropertyResolverProcessor(org.jboss.as.ee.metadata.property.VaultPropertyResolverProcessor) ComponentInstallProcessor(org.jboss.as.ee.component.deployers.ComponentInstallProcessor) ResourceInjectionAnnotationParsingProcessor(org.jboss.as.ee.component.deployers.ResourceInjectionAnnotationParsingProcessor) AbstractDeploymentChainStep(org.jboss.as.server.AbstractDeploymentChainStep) EEDefaultPermissionsProcessor(org.jboss.as.ee.component.deployers.EEDefaultPermissionsProcessor) ModelNode(org.jboss.dmr.ModelNode) InitializeInOrderProcessor(org.jboss.as.ee.structure.InitializeInOrderProcessor) ModuleContextProcessor(org.jboss.as.ee.naming.ModuleContextProcessor) EEAnnotationProcessor(org.jboss.as.ee.component.deployers.EEAnnotationProcessor) SystemPropertyResolverProcessor(org.jboss.as.ee.metadata.property.SystemPropertyResolverProcessor) EarApplicationNameProcessor(org.jboss.as.ee.component.deployers.EarApplicationNameProcessor) EEModuleNameProcessor(org.jboss.as.ee.component.deployers.EEModuleNameProcessor) EEModuleConfigurationProcessor(org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor) InstanceNameBindingProcessor(org.jboss.as.ee.naming.InstanceNameBindingProcessor) ModuleJndiBindingProcessor(org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor) ApplicationContextProcessor(org.jboss.as.ee.naming.ApplicationContextProcessor) ComponentAggregationProcessor(org.jboss.as.ee.structure.ComponentAggregationProcessor) EjbJarDeploymentProcessor(org.jboss.as.ee.structure.EjbJarDeploymentProcessor) EJBClientDescriptorParsingProcessor(org.jboss.as.ee.structure.EJBClientDescriptorParsingProcessor) EEDistinctNameProcessor(org.jboss.as.ee.component.deployers.EEDistinctNameProcessor) ApplicationClassesAggregationProcessor(org.jboss.as.ee.component.deployers.ApplicationClassesAggregationProcessor) DeploymentPropertiesProcessor(org.jboss.as.ee.metadata.property.DeploymentPropertiesProcessor) JBossAllXmlParserRegisteringProcessor(org.jboss.as.server.deployment.jbossallxml.JBossAllXmlParserRegisteringProcessor) ManagedBeanSubDeploymentMarkingProcessor(org.jboss.as.ee.managedbean.processors.ManagedBeanSubDeploymentMarkingProcessor) EarMessageDestinationProcessor(org.jboss.as.ee.component.deployers.EarMessageDestinationProcessor) ReflectiveClassIntrospector(org.jboss.as.ee.component.ReflectiveClassIntrospector) ResourceReferenceProcessor(org.jboss.as.ee.component.deployers.ResourceReferenceProcessor) EEConcurrentDefaultBindingProcessor(org.jboss.as.ee.concurrent.deployers.EEConcurrentDefaultBindingProcessor) SystemPropertyResolverProcessor(org.jboss.as.ee.metadata.property.SystemPropertyResolverProcessor) PropertyResolverProcessor(org.jboss.as.ee.metadata.property.PropertyResolverProcessor) DeploymentPropertyResolverProcessor(org.jboss.as.ee.metadata.property.DeploymentPropertyResolverProcessor) VaultPropertyResolverProcessor(org.jboss.as.ee.metadata.property.VaultPropertyResolverProcessor) AppJBossAllParser(org.jboss.as.ee.structure.AppJBossAllParser) EarStructureProcessor(org.jboss.as.ee.structure.EarStructureProcessor) EEConcurrentContextProcessor(org.jboss.as.ee.concurrent.deployers.EEConcurrentContextProcessor) DeploymentProcessorTarget(org.jboss.as.server.DeploymentProcessorTarget) EarDependencyProcessor(org.jboss.as.ee.structure.EarDependencyProcessor) EECleanUpProcessor(org.jboss.as.ee.component.deployers.EECleanUpProcessor) AroundInvokeAnnotationParsingProcessor(org.jboss.as.ee.component.deployers.AroundInvokeAnnotationParsingProcessor) ManagedBeanAnnotationProcessor(org.jboss.as.ee.managedbean.processors.ManagedBeanAnnotationProcessor) DeploymentPropertyResolverProcessor(org.jboss.as.ee.metadata.property.DeploymentPropertyResolverProcessor) InApplicationClientBindingProcessor(org.jboss.as.ee.naming.InApplicationClientBindingProcessor)

Example 70 with ModelNode

use of org.jboss.dmr.ModelNode in project wildfly by wildfly.

the class GlobalModulesDefinition method createModuleList.

public static List<GlobalModule> createModuleList(final OperationContext context, final ModelNode globalMods) throws OperationFailedException {
    final List<GlobalModule> ret = new ArrayList<>();
    if (globalMods.isDefined()) {
        for (final ModelNode module : globalMods.asList()) {
            String name = NAME_AD.resolveModelAttribute(context, module).asString();
            String slot = SLOT_AD.resolveModelAttribute(context, module).asString();
            boolean annotations = ANNOTATIONS_AD.resolveModelAttribute(context, module).asBoolean();
            boolean services = SERVICES_AD.resolveModelAttribute(context, module).asBoolean();
            boolean metaInf = META_INF_AD.resolveModelAttribute(context, module).asBoolean();
            ret.add(new GlobalModule(ModuleIdentifier.create(name, slot), annotations, services, metaInf));
        }
    }
    return ret;
}
Also used : ArrayList(java.util.ArrayList) ModelNode(org.jboss.dmr.ModelNode)

Aggregations

ModelNode (org.jboss.dmr.ModelNode)1634 PathAddress (org.jboss.as.controller.PathAddress)351 Test (org.junit.Test)344 KernelServices (org.jboss.as.subsystem.test.KernelServices)102 Property (org.jboss.dmr.Property)92 OperationFailedException (org.jboss.as.controller.OperationFailedException)89 OperationContext (org.jboss.as.controller.OperationContext)68 ParseUtils.unexpectedElement (org.jboss.as.controller.parsing.ParseUtils.unexpectedElement)68 ArrayList (java.util.ArrayList)58 Resource (org.jboss.as.controller.registry.Resource)54 PathElement (org.jboss.as.controller.PathElement)53 ParseUtils.unexpectedAttribute (org.jboss.as.controller.parsing.ParseUtils.unexpectedAttribute)52 ParseUtils.requireNoNamespaceAttribute (org.jboss.as.controller.parsing.ParseUtils.requireNoNamespaceAttribute)50 IOException (java.io.IOException)49 ServiceName (org.jboss.msc.service.ServiceName)49 ResourceTransformationDescriptionBuilder (org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder)47 AttributeDefinition (org.jboss.as.controller.AttributeDefinition)44 OperationStepHandler (org.jboss.as.controller.OperationStepHandler)42 OperationBuilder (org.jboss.as.controller.client.OperationBuilder)42 Map (java.util.Map)38