Search in sources :

Example 6 with DeploymentProcessorTarget

use of org.jboss.as.server.DeploymentProcessorTarget in project wildfly by wildfly.

the class DefaultBindingsAdd method performBoottime.

@Override
protected void performBoottime(OperationContext context, ModelNode operation, Resource resource) throws OperationFailedException {
    ModelNode model = resource.getModel();
    if (model.hasDefined(DefaultBindingsResourceDefinition.CONTEXT_SERVICE)) {
        final String contextService = DefaultBindingsResourceDefinition.CONTEXT_SERVICE_AD.resolveModelAttribute(context, model).asString();
        defaultBindingsConfigurationProcessor.setContextService(contextService);
    }
    if (model.hasDefined(DefaultBindingsResourceDefinition.DATASOURCE)) {
        final String dataSource = DefaultBindingsResourceDefinition.DATASOURCE_AD.resolveModelAttribute(context, model).asString();
        defaultBindingsConfigurationProcessor.setDataSource(dataSource);
    }
    if (model.hasDefined(DefaultBindingsResourceDefinition.JMS_CONNECTION_FACTORY)) {
        final String jmsConnectionFactory = DefaultBindingsResourceDefinition.JMS_CONNECTION_FACTORY_AD.resolveModelAttribute(context, model).asString();
        defaultBindingsConfigurationProcessor.setJmsConnectionFactory(jmsConnectionFactory);
    }
    if (model.hasDefined(DefaultBindingsResourceDefinition.MANAGED_EXECUTOR_SERVICE)) {
        final String managedExecutorService = DefaultBindingsResourceDefinition.MANAGED_EXECUTOR_SERVICE_AD.resolveModelAttribute(context, model).asString();
        defaultBindingsConfigurationProcessor.setManagedExecutorService(managedExecutorService);
    }
    if (model.hasDefined(DefaultBindingsResourceDefinition.MANAGED_SCHEDULED_EXECUTOR_SERVICE)) {
        final String managedScheduledExecutorService = DefaultBindingsResourceDefinition.MANAGED_SCHEDULED_EXECUTOR_SERVICE_AD.resolveModelAttribute(context, model).asString();
        defaultBindingsConfigurationProcessor.setManagedScheduledExecutorService(managedScheduledExecutorService);
    }
    if (model.hasDefined(DefaultBindingsResourceDefinition.MANAGED_THREAD_FACTORY)) {
        final String managedThreadFactory = DefaultBindingsResourceDefinition.MANAGED_THREAD_FACTORY_AD.resolveModelAttribute(context, model).asString();
        defaultBindingsConfigurationProcessor.setManagedThreadFactory(managedThreadFactory);
    }
    context.addStep(new AbstractDeploymentChainStep() {

        protected void execute(DeploymentProcessorTarget processorTarget) {
            processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, STRUCTURE_EE_DEFAULT_BINDINGS_CONFIG, defaultBindingsConfigurationProcessor);
        }
    }, OperationContext.Stage.RUNTIME);
}
Also used : DeploymentProcessorTarget(org.jboss.as.server.DeploymentProcessorTarget) AbstractDeploymentChainStep(org.jboss.as.server.AbstractDeploymentChainStep) ModelNode(org.jboss.dmr.ModelNode)

Example 7 with DeploymentProcessorTarget

use of org.jboss.as.server.DeploymentProcessorTarget in project wildfly by wildfly.

the class JPASubSystemAdd method performBoottime.

protected void performBoottime(final OperationContext context, final ModelNode operation, final ModelNode model) throws OperationFailedException {
    context.addStep(new AbstractDeploymentChainStep() {

        protected void execute(DeploymentProcessorTarget processorTarget) {
            // set Hibernate persistence provider as the default provider
            javax.persistence.spi.PersistenceProviderResolverHolder.setPersistenceProviderResolver(PersistenceProviderResolverImpl.getInstance());
            final boolean appclient = context.getProcessType() == ProcessType.APPLICATION_CLIENT;
            PlatformImpl platform;
            if (appclient) {
                // we do not yet support a second level cache in the client container
                platform = new PlatformImpl(Classification.NONE);
            } else {
                // Infinispan can be used in server container
                platform = new PlatformImpl(Classification.INFINISPAN, Classification.INFINISPAN);
            }
            processorTarget.addDeploymentProcessor(JPAExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, Phase.STRUCTURE_REGISTER_JBOSS_ALL_JPA, new JBossAllXmlParserRegisteringProcessor<>(JPAJarJBossAllParser.ROOT_ELEMENT, JpaAttachments.DEPLOYMENT_SETTINGS_KEY, new JPAJarJBossAllParser()));
            // handles parsing of persistence.xml
            processorTarget.addDeploymentProcessor(JPAExtension.SUBSYSTEM_NAME, Phase.PARSE, Phase.PARSE_PERSISTENCE_UNIT, new PersistenceUnitParseProcessor(appclient));
            // handles persistence unit / context annotations in components
            processorTarget.addDeploymentProcessor(JPAExtension.SUBSYSTEM_NAME, Phase.DEPENDENCIES, Phase.DEPENDENCIES_PERSISTENCE_ANNOTATION, new JPAAnnotationProcessor());
            // injects Jakarta Persistence dependencies into an application
            processorTarget.addDeploymentProcessor(JPAExtension.SUBSYSTEM_NAME, Phase.DEPENDENCIES, Phase.DEPENDENCIES_JPA, new JPADependencyProcessor());
            // Inject Hibernate Search dependencies into an application
            processorTarget.addDeploymentProcessor(JPAExtension.SUBSYSTEM_NAME, Phase.DEPENDENCIES, Phase.DEPENDENCIES_HIBERNATE_SEARCH, new HibernateSearchProcessor());
            // handle ClassFileTransformer
            processorTarget.addDeploymentProcessor(JPAExtension.SUBSYSTEM_NAME, Phase.FIRST_MODULE_USE, Phase.FIRST_MODULE_USE_PERSISTENCE_CLASS_FILE_TRANSFORMER, new JPAClassFileTransformerProcessor());
            final CapabilityServiceSupport capabilities = context.getCapabilityServiceSupport();
            if (capabilities.hasCapability("org.wildfly.ejb3")) {
                // registers listeners/interceptors on session beans
                processorTarget.addDeploymentProcessor(JPAExtension.SUBSYSTEM_NAME, Phase.FIRST_MODULE_USE, Phase.FIRST_MODULE_USE_INTERCEPTORS, new JPAInterceptorProcessor());
            }
            // begin pu service install and deploying a persistence provider
            processorTarget.addDeploymentProcessor(JPAExtension.SUBSYSTEM_NAME, Phase.FIRST_MODULE_USE, Phase.FIRST_MODULE_USE_PERSISTENCE_PREPARE, new PersistenceBeginInstallProcessor(platform));
            // handles persistence unit / context references from deployment descriptors
            processorTarget.addDeploymentProcessor(JPAExtension.SUBSYSTEM_NAME, Phase.POST_MODULE, Phase.POST_MODULE_PERSISTENCE_REF, new PersistenceRefProcessor());
            // handles pu deployment (completes pu service installation)
            processorTarget.addDeploymentProcessor(JPAExtension.SUBSYSTEM_NAME, Phase.INSTALL, Phase.INSTALL_PERSISTENTUNIT, new PersistenceCompleteInstallProcessor(platform));
        }
    }, OperationContext.Stage.RUNTIME);
    final String dataSourceName = DEFAULT_DATASOURCE.resolveModelAttribute(context, model).asStringOrNull();
    final ExtendedPersistenceInheritance defaultExtendedPersistenceInheritance = ExtendedPersistenceInheritance.valueOf(DEFAULT_EXTENDEDPERSISTENCE_INHERITANCE.resolveModelAttribute(context, model).asString());
    final ServiceTarget target = context.getServiceTarget();
    JPAService.addService(target, dataSourceName, defaultExtendedPersistenceInheritance);
    JPAUserTransactionListenerService.addService(target);
}
Also used : JBossAllXmlParserRegisteringProcessor(org.jboss.as.server.deployment.jbossallxml.JBossAllXmlParserRegisteringProcessor) ServiceTarget(org.jboss.msc.service.ServiceTarget) PersistenceRefProcessor(org.jboss.as.jpa.processor.PersistenceRefProcessor) JPAInterceptorProcessor(org.jboss.as.jpa.processor.JPAInterceptorProcessor) PersistenceCompleteInstallProcessor(org.jboss.as.jpa.processor.PersistenceCompleteInstallProcessor) JPADependencyProcessor(org.jboss.as.jpa.processor.JPADependencyProcessor) CapabilityServiceSupport(org.jboss.as.controller.capability.CapabilityServiceSupport) ExtendedPersistenceInheritance(org.jboss.as.jpa.config.ExtendedPersistenceInheritance) JPAJarJBossAllParser(org.jboss.as.jpa.processor.JPAJarJBossAllParser) DeploymentProcessorTarget(org.jboss.as.server.DeploymentProcessorTarget) PersistenceUnitParseProcessor(org.jboss.as.jpa.processor.PersistenceUnitParseProcessor) JPAClassFileTransformerProcessor(org.jboss.as.jpa.processor.JPAClassFileTransformerProcessor) AbstractDeploymentChainStep(org.jboss.as.server.AbstractDeploymentChainStep) HibernateSearchProcessor(org.jboss.as.jpa.processor.HibernateSearchProcessor) JPAAnnotationProcessor(org.jboss.as.jpa.processor.JPAAnnotationProcessor) PersistenceBeginInstallProcessor(org.jboss.as.jpa.processor.PersistenceBeginInstallProcessor) PlatformImpl(org.jboss.as.jpa.platform.PlatformImpl)

Example 8 with DeploymentProcessorTarget

use of org.jboss.as.server.DeploymentProcessorTarget 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);
    CapabilityServiceSupport capabilitySupport = context.getCapabilityServiceSupport();
    final boolean elytronJacc = capabilitySupport.hasCapability(ELYTRON_JACC_CAPABILITY);
    final boolean legacyJacc = !elytronJacc && capabilitySupport.hasCapability(LEGACY_JACC_CAPABILITY);
    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_FUNCTIONAL_RESOLVERS, new FunctionalResolverProcessor());
            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.STRUCTURE, Phase.STRUCTURE_GLOBAL_DIRECTORIES, directoryDependencyProcessor);
            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.POST_MODULE, Phase.POST_MODULE_EE_STARTUP_COUNTDOWN, new EEStartupCountdownProcessor());
            if (legacyJacc || elytronJacc) {
                processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.INSTALL, Phase.INSTALL_JACC_POLICY, new JaccEarDeploymentProcessor(elytronJacc ? ELYTRON_JACC_CAPABILITY : LEGACY_JACC_CAPABILITY));
            }
            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(appclient));
            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();
    // installs the service which manages managed executor's hung task periodic termination
    new ManagedExecutorHungTasksPeriodicTerminationService().install(context);
}
Also used : EarMetaDataParsingProcessor(org.jboss.as.ee.structure.EarMetaDataParsingProcessor) ApplicationClientDeploymentProcessor(org.jboss.as.ee.structure.ApplicationClientDeploymentProcessor) DescriptorEnvironmentLifecycleMethodProcessor(org.jboss.as.ee.component.deployers.DescriptorEnvironmentLifecycleMethodProcessor) CapabilityServiceSupport(org.jboss.as.controller.capability.CapabilityServiceSupport) 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) ManagedExecutorHungTasksPeriodicTerminationService(org.jboss.as.ee.concurrent.service.ManagedExecutorHungTasksPeriodicTerminationService) 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) 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) FunctionalResolverProcessor(org.jboss.as.ee.metadata.property.FunctionalResolverProcessor) ModuleJndiBindingProcessor(org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor) JaccEarDeploymentProcessor(org.jboss.as.ee.security.JaccEarDeploymentProcessor) 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) 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 9 with DeploymentProcessorTarget

use of org.jboss.as.server.DeploymentProcessorTarget in project wildfly by wildfly.

the class TimerServiceAdd method performBoottime.

@Override
protected void performBoottime(final OperationContext context, ModelNode operation, final ModelNode model) throws OperationFailedException {
    final String defaultDataStore = TimerServiceResourceDefinition.DEFAULT_DATA_STORE.resolveModelAttribute(context, model).asString();
    final String threadPoolName = TimerServiceResourceDefinition.THREAD_POOL_NAME.resolveModelAttribute(context, model).asString();
    final ServiceName threadPoolServiceName = context.getCapabilityServiceName(TimerServiceResourceDefinition.THREAD_POOL_CAPABILITY_NAME, threadPoolName, Executor.class);
    context.addStep(new AbstractDeploymentChainStep() {

        protected void execute(DeploymentProcessorTarget processorTarget) {
            ROOT_LOGGER.debug("Configuring timers");
            // we only add the timer service DUP's when the timer service in enabled in XML
            processorTarget.addDeploymentProcessor(EJB3Extension.SUBSYSTEM_NAME, Phase.PARSE, Phase.PARSE_TIMEOUT_ANNOTATION, new TimerServiceAnnotationProcessor());
            processorTarget.addDeploymentProcessor(EJB3Extension.SUBSYSTEM_NAME, Phase.PARSE, Phase.PARSE_AROUNDTIMEOUT_ANNOTATION, new AroundTimeoutAnnotationParsingProcessor());
            processorTarget.addDeploymentProcessor(EJB3Extension.SUBSYSTEM_NAME, Phase.POST_MODULE, Phase.POST_MODULE_EJB_TIMER_METADATA_MERGE, new TimerMethodMergingProcessor());
            processorTarget.addDeploymentProcessor(EJB3Extension.SUBSYSTEM_NAME, Phase.POST_MODULE, Phase.POST_MODULE_EJB_TIMER_SERVICE, new TimerServiceDeploymentProcessor(threadPoolServiceName, defaultDataStore));
        }
    }, OperationContext.Stage.RUNTIME);
    context.getCapabilityServiceTarget().addCapability(TimerServiceResourceDefinition.TIMER_SERVICE_CAPABILITY, new TimerValueService()).install();
}
Also used : DeploymentProcessorTarget(org.jboss.as.server.DeploymentProcessorTarget) TimerMethodMergingProcessor(org.jboss.as.ejb3.deployment.processors.merging.TimerMethodMergingProcessor) ServiceName(org.jboss.msc.service.ServiceName) AroundTimeoutAnnotationParsingProcessor(org.jboss.as.ejb3.deployment.processors.AroundTimeoutAnnotationParsingProcessor) AbstractDeploymentChainStep(org.jboss.as.server.AbstractDeploymentChainStep) TimerServiceDeploymentProcessor(org.jboss.as.ejb3.deployment.processors.TimerServiceDeploymentProcessor) TimerServiceAnnotationProcessor(org.jboss.as.ejb3.deployment.processors.annotation.TimerServiceAnnotationProcessor)

Example 10 with DeploymentProcessorTarget

use of org.jboss.as.server.DeploymentProcessorTarget in project wildfly by wildfly.

the class SubsystemAdd method performBoottime.

@Override
protected void performBoottime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException {
    WildFlyTracerFactory.registerTracer(ENV_TRACER).accept(new JaegerEnvTracerConfiguration());
    TracingExtensionLogger.ROOT_LOGGER.activatingSubsystem();
    String defaultTracer = DEFAULT_TRACER.resolveModelAttribute(context, operation).asStringOrNull();
    if (defaultTracer != null && !defaultTracer.isEmpty()) {
        CapabilityServiceBuilder<?> builder = context.getCapabilityServiceTarget().addCapability(DEFAULT_TRACER_CAPABILITY);
        final Supplier<TracerConfiguration> config = builder.requiresCapability(TRACER_CAPABILITY_NAME, TracerConfiguration.class, defaultTracer);
        final Consumer<TracerConfiguration> injector = builder.provides(DEFAULT_TRACER_CAPABILITY);
        builder.setInstance(new Service() {

            @Override
            public void start(StartContext context) throws StartException {
                injector.accept(config.get());
                WildFlyTracerFactory.registerDefaultTracer().accept(config.get());
            }

            @Override
            public void stop(StopContext context) {
                injector.accept(null);
                WildFlyTracerFactory.registerDefaultTracer().accept(config.get());
            }
        }).setInitialMode(ServiceController.Mode.ACTIVE).install();
    }
    context.addStep(new AbstractDeploymentChainStep() {

        @Override
        public void execute(DeploymentProcessorTarget processorTarget) {
            processorTarget.addDeploymentProcessor(SubsystemExtension.SUBSYSTEM_NAME, Phase.DEPENDENCIES, Phase.DEPENDENCIES_MICROPROFILE_OPENTRACING, new TracingDependencyProcessor());
            processorTarget.addDeploymentProcessor(SubsystemExtension.SUBSYSTEM_NAME, Phase.POST_MODULE, Phase.POST_MODULE_MICROPROFILE_OPENTRACING, new TracingDeploymentProcessor());
        }
    }, OperationContext.Stage.RUNTIME);
}
Also used : StopContext(org.jboss.msc.service.StopContext) TracerConfiguration(org.wildfly.microprofile.opentracing.smallrye.TracerConfiguration) JaegerEnvTracerConfiguration(org.wildfly.extension.microprofile.opentracing.resolver.JaegerEnvTracerConfiguration) Service(org.jboss.msc.Service) JaegerEnvTracerConfiguration(org.wildfly.extension.microprofile.opentracing.resolver.JaegerEnvTracerConfiguration) StartContext(org.jboss.msc.service.StartContext) DeploymentProcessorTarget(org.jboss.as.server.DeploymentProcessorTarget) StartException(org.jboss.msc.service.StartException) AbstractDeploymentChainStep(org.jboss.as.server.AbstractDeploymentChainStep)

Aggregations

AbstractDeploymentChainStep (org.jboss.as.server.AbstractDeploymentChainStep)39 DeploymentProcessorTarget (org.jboss.as.server.DeploymentProcessorTarget)39 ServiceTarget (org.jboss.msc.service.ServiceTarget)12 ModelNode (org.jboss.dmr.ModelNode)11 ServiceName (org.jboss.msc.service.ServiceName)10 JBossAllXmlParserRegisteringProcessor (org.jboss.as.server.deployment.jbossallxml.JBossAllXmlParserRegisteringProcessor)7 CapabilityServiceSupport (org.jboss.as.controller.capability.CapabilityServiceSupport)6 OperationContext (org.jboss.as.controller.OperationContext)5 OperationFailedException (org.jboss.as.controller.OperationFailedException)4 OperationStepHandler (org.jboss.as.controller.OperationStepHandler)4 PathHandler (io.undertow.server.handlers.PathHandler)3 Resource (org.jboss.as.controller.registry.Resource)3 AssociationService (org.jboss.as.ejb3.remote.AssociationService)3 BinderService (org.jboss.as.naming.service.BinderService)3 UserTransactionAccessControlService (org.jboss.as.txn.service.UserTransactionAccessControlService)3 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 Properties (java.util.Properties)2 TransactionManager (javax.transaction.TransactionManager)2 TransactionSynchronizationRegistry (javax.transaction.TransactionSynchronizationRegistry)2