use of org.jboss.as.server.AbstractDeploymentChainStep in project wildfly by wildfly.
the class NamingSubsystemAdd method performBoottime.
@SuppressWarnings("deprecation")
@Override
protected void performBoottime(OperationContext context, ModelNode operation, ModelNode model) {
ROOT_LOGGER.activatingSubsystem();
NamingContext.initializeNamingManager();
final ServiceTarget target = context.getServiceTarget();
// Create the java: namespace
target.addService(ContextNames.JAVA_CONTEXT_SERVICE_NAME, new NamingStoreService()).setInitialMode(ServiceController.Mode.ACTIVE).install();
// Create the Naming Service
final NamingService namingService = new NamingService();
target.addService(Capability.NAMING_STORE.getDefinition().getCapabilityServiceName(), namingService).addAliases(NamingService.SERVICE_NAME).addDependency(ContextNames.JAVA_CONTEXT_SERVICE_NAME, NamingStore.class, namingService.getNamingStore()).setInitialMode(ServiceController.Mode.ACTIVE).install();
// Create the java:global namespace
target.addService(ContextNames.GLOBAL_CONTEXT_SERVICE_NAME, new NamingStoreService()).setInitialMode(ServiceController.Mode.ACTIVE).install();
// Create the java:jboss vendor namespace
target.addService(ContextNames.JBOSS_CONTEXT_SERVICE_NAME, new NamingStoreService()).setInitialMode(ServiceController.Mode.ACTIVE).install();
// Setup remote naming store
//we always install the naming store, but we don't install the server unless it has been explicitly enabled
target.addService(ContextNames.EXPORTED_CONTEXT_SERVICE_NAME, new NamingStoreService()).setInitialMode(ServiceController.Mode.ACTIVE).install();
// add the default namespace context selector service
DefaultNamespaceContextSelectorService defaultNamespaceContextSelectorService = new DefaultNamespaceContextSelectorService();
target.addService(DefaultNamespaceContextSelectorService.SERVICE_NAME, defaultNamespaceContextSelectorService).addDependency(ContextNames.GLOBAL_CONTEXT_SERVICE_NAME, NamingStore.class, defaultNamespaceContextSelectorService.getGlobalNamingStore()).addDependency(ContextNames.JBOSS_CONTEXT_SERVICE_NAME, NamingStore.class, defaultNamespaceContextSelectorService.getJbossNamingStore()).addDependency(ContextNames.EXPORTED_CONTEXT_SERVICE_NAME, NamingStore.class, defaultNamespaceContextSelectorService.getRemoteExposedNamingStore()).setInitialMode(ServiceController.Mode.ACTIVE).install();
target.addService(JndiViewExtensionRegistry.SERVICE_NAME, new JndiViewExtensionRegistry()).install();
// create the subsystem's external context instance, and install related Service and DUP
final ExternalContexts externalContexts = new ExternalContextsNavigableSet();
target.addService(ExternalContextsService.SERVICE_NAME, new ExternalContextsService(externalContexts)).install();
context.addStep(new AbstractDeploymentChainStep() {
@Override
protected void execute(DeploymentProcessorTarget processorTarget) {
processorTarget.addDeploymentProcessor(NamingExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, Phase.STRUCTURE_NAMING_EXTERNAL_CONTEXTS, new ExternalContextsProcessor(externalContexts));
processorTarget.addDeploymentProcessor(NamingExtension.SUBSYSTEM_NAME, Phase.INSTALL, Phase.INSTALL_JNDI_DEPENDENCIES, new JndiNamingDependencyProcessor());
}
}, OperationContext.Stage.RUNTIME);
if (context.hasOptionalCapability(UNDERTOW_HTTP_INVOKER_CAPABILITY_NAME, NamingService.CAPABILITY_NAME, null)) {
HttpRemoteNamingServerService httpRemoteNamingServerService = new HttpRemoteNamingServerService();
context.getServiceTarget().addService(HttpRemoteNamingServerService.SERVICE_NAME, httpRemoteNamingServerService).addDependency(context.getCapabilityServiceName(UNDERTOW_HTTP_INVOKER_CAPABILITY_NAME, PathHandler.class), PathHandler.class, httpRemoteNamingServerService.getPathHandlerInjectedValue()).addDependency(ContextNames.EXPORTED_CONTEXT_SERVICE_NAME, NamingStore.class, httpRemoteNamingServerService.getNamingStore()).install();
}
}
use of org.jboss.as.server.AbstractDeploymentChainStep in project wildfly by wildfly.
the class JSR77ManagementSubsystemAdd method performBoottime.
@Override
protected void performBoottime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException {
context.addStep(new AbstractDeploymentChainStep() {
protected void execute(DeploymentProcessorTarget processorTarget) {
processorTarget.addDeploymentProcessor(JSR77ManagementExtension.SUBSYSTEM_NAME, Phase.DEPENDENCIES, Phase.DEPENDENCIES_JSR77, new Jsr77DependenciesProcessor());
}
}, OperationContext.Stage.RUNTIME);
final boolean appclient = context.getProcessType() == ProcessType.APPLICATION_CLIENT;
if (!appclient) {
context.addStep(new OperationStepHandler() {
@Override
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
ServiceTarget target = context.getServiceTarget();
ServiceName mbeanServerServiceName = context.getCapabilityServiceName(JSR77ManagementRootResource.JMX_CAPABILITY, MBeanServer.class);
RegisterMBeanServerDelegateService mbeanServerService = new RegisterMBeanServerDelegateService();
target.addService(RegisterMBeanServerDelegateService.SERVICE_NAME, mbeanServerService).addDependency(mbeanServerServiceName, PluggableMBeanServer.class, mbeanServerService.injectedMbeanServer).addDependency(Services.JBOSS_SERVER_CONTROLLER, ModelController.class, mbeanServerService.injectedController).setInitialMode(Mode.ACTIVE).install();
RegisterManagementEJBService managementEjbService = new RegisterManagementEJBService();
target.addService(RegisterManagementEJBService.SERVICE_NAME, managementEjbService).addDependency(DeploymentRepository.SERVICE_NAME, DeploymentRepository.class, managementEjbService.deploymentRepositoryValue).addDependency(mbeanServerServiceName, MBeanServer.class, managementEjbService.mbeanServerValue).addDependency(EJBClientContextService.DEFAULT_SERVICE_NAME, EJBClientContextService.class, managementEjbService.ejbClientContextValue).addDependency(AssociationService.SERVICE_NAME, AssociationService.class, managementEjbService.associationServiceInjector).setInitialMode(Mode.ACTIVE).install();
//TODO null for source ok?
final ContextNames.BindInfo bindInfo = ContextNames.bindInfoFor(JNDI_NAME);
final BinderService binderService = new BinderService(bindInfo.getBindName(), null);
final InjectedValue<ClassLoader> viewClassLoader = new InjectedValue<ClassLoader>();
viewClassLoader.setValue(Values.immediateValue(ManagementHome.class.getClassLoader()));
target.addService(bindInfo.getBinderServiceName(), binderService).addInjection(binderService.getManagedObjectInjector(), new RemoteViewManagedReferenceFactory(APP_NAME, MODULE_NAME, DISTINCT_NAME, EJB_NAME, ManagementHome.class.getName(), false, viewClassLoader, appclient)).addDependency(bindInfo.getParentContextServiceName(), ServiceBasedNamingStore.class, binderService.getNamingStoreInjector()).setInitialMode(Mode.ACTIVE).install();
// Rollback is handled by the parent step
context.completeStep(OperationContext.RollbackHandler.NOOP_ROLLBACK_HANDLER);
}
}, Stage.RUNTIME);
}
}
use of org.jboss.as.server.AbstractDeploymentChainStep in project wildfly by wildfly.
the class JSFSubsystemAdd method performBoottime.
@Override
protected void performBoottime(OperationContext context, ModelNode operation, final ModelNode model) throws OperationFailedException {
final String defaultJSFSlot = JSFResourceDefinition.DEFAULT_JSF_IMPL_SLOT.resolveModelAttribute(context, model).asString();
context.addStep(new AbstractDeploymentChainStep() {
protected void execute(DeploymentProcessorTarget processorTarget) {
processorTarget.addDeploymentProcessor(JSFExtension.SUBSYSTEM_NAME, Phase.PARSE, Phase.PARSE_JSF_VERSION, new JSFVersionProcessor(defaultJSFSlot));
processorTarget.addDeploymentProcessor(JSFExtension.SUBSYSTEM_NAME, Phase.PARSE, Phase.PARSE_JSF_SHARED_TLDS, new JSFSharedTldsProcessor());
processorTarget.addDeploymentProcessor(JSFExtension.SUBSYSTEM_NAME, Phase.PARSE, Phase.PARSE_JSF_MANAGED_BEANS, new JSFManagedBeanProcessor());
processorTarget.addDeploymentProcessor(JSFExtension.SUBSYSTEM_NAME, Phase.PARSE, Phase.PARSE_JSF_METADATA, new JSFMetadataProcessor());
processorTarget.addDeploymentProcessor(JSFExtension.SUBSYSTEM_NAME, Phase.DEPENDENCIES, Phase.DEPENDENCIES_JSF, new JSFDependencyProcessor());
processorTarget.addDeploymentProcessor(JSFExtension.SUBSYSTEM_NAME, Phase.POST_MODULE, Phase.POST_MODULE_JSF_MANAGED_BEANS, new JSFManagedBeanProcessor());
processorTarget.addDeploymentProcessor(JSFExtension.SUBSYSTEM_NAME, Phase.POST_MODULE, Phase.POST_MODULE_JSF_CDI_EXTENSIONS, new JSFCdiExtensionDeploymentProcessor());
processorTarget.addDeploymentProcessor(JSFExtension.SUBSYSTEM_NAME, Phase.INSTALL, Phase.INSTALL_JSF_ANNOTATIONS, new JSFAnnotationProcessor());
processorTarget.addDeploymentProcessor(JSFExtension.SUBSYSTEM_NAME, Phase.INSTALL, Phase.INSTALL_JSF_VALIDATOR_FACTORY, new JSFBeanValidationFactoryProcessor());
}
}, OperationContext.Stage.RUNTIME);
}
use of org.jboss.as.server.AbstractDeploymentChainStep in project wildfly by wildfly.
the class WeldSubsystemAdd method performBoottime.
@Override
protected void performBoottime(final OperationContext context, ModelNode operation, Resource resource) throws OperationFailedException {
final ModelNode model = resource.getModel();
final boolean requireBeanDescriptor = REQUIRE_BEAN_DESCRIPTOR_ATTRIBUTE.resolveModelAttribute(context, model).asBoolean();
final boolean nonPortableMode = WeldResourceDefinition.NON_PORTABLE_MODE_ATTRIBUTE.resolveModelAttribute(context, model).asBoolean();
final boolean developmentMode = WeldResourceDefinition.DEVELOPMENT_MODE_ATTRIBUTE.resolveModelAttribute(context, model).asBoolean();
final int threadPoolSize = WeldResourceDefinition.THREAD_POOL_SIZE_ATTRIBUTE.resolveModelAttribute(context, model).asInt(WeldExecutorServices.DEFAULT_BOUND);
context.addStep(new AbstractDeploymentChainStep() {
@Override
protected void execute(DeploymentProcessorTarget processorTarget) {
final JBossAllXmlParserRegisteringProcessor<?> jbossAllParsers = JBossAllXmlParserRegisteringProcessor.builder().addParser(WeldJBossAll10Parser.ROOT_ELEMENT, WeldJBossAllConfiguration.ATTACHMENT_KEY, WeldJBossAll10Parser.INSTANCE).addParser(WeldJBossAll11Parser.ROOT_ELEMENT, WeldJBossAllConfiguration.ATTACHMENT_KEY, WeldJBossAll11Parser.INSTANCE).build();
processorTarget.addDeploymentProcessor(WeldExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, Phase.STRUCTURE_REGISTER_JBOSS_ALL_WELD, jbossAllParsers);
processorTarget.addDeploymentProcessor(WeldExtension.SUBSYSTEM_NAME, Phase.PARSE, Phase.PARSE_WELD_CONFIGURATION, new WeldConfigurationProcessor(requireBeanDescriptor, nonPortableMode, developmentMode));
processorTarget.addDeploymentProcessor(WeldExtension.SUBSYSTEM_NAME, Phase.PARSE, Phase.PARSE_CDI_ANNOTATIONS, new CdiAnnotationProcessor());
processorTarget.addDeploymentProcessor(WeldExtension.SUBSYSTEM_NAME, Phase.PARSE, Phase.PARSE_CDI_BEAN_DEFINING_ANNOTATIONS, new BeanDefiningAnnotationProcessor());
processorTarget.addDeploymentProcessor(WeldExtension.SUBSYSTEM_NAME, Phase.PARSE, Phase.PARSE_WELD_DEPLOYMENT, new BeansXmlProcessor());
processorTarget.addDeploymentProcessor(WeldExtension.SUBSYSTEM_NAME, Phase.PARSE, Phase.PARSE_WELD_IMPLICIT_DEPLOYMENT_DETECTION, new WeldImplicitDeploymentProcessor());
processorTarget.addDeploymentProcessor(WeldExtension.SUBSYSTEM_NAME, Phase.DEPENDENCIES, Phase.DEPENDENCIES_WELD, new WeldDependencyProcessor());
processorTarget.addDeploymentProcessor(WeldExtension.SUBSYSTEM_NAME, Phase.POST_MODULE, Phase.POST_MODULE_WELD_WEB_INTEGRATION, new WebIntegrationProcessor());
processorTarget.addDeploymentProcessor(WeldExtension.SUBSYSTEM_NAME, Phase.POST_MODULE, Phase.POST_MODULE_WELD_DEVELOPMENT_MODE, new DevelopmentModeProcessor());
processorTarget.addDeploymentProcessor(WeldExtension.SUBSYSTEM_NAME, Phase.POST_MODULE, Phase.POST_MODULE_WELD_BEAN_ARCHIVE, new BeanArchiveProcessor());
processorTarget.addDeploymentProcessor(WeldExtension.SUBSYSTEM_NAME, Phase.POST_MODULE, Phase.POST_MODULE_WELD_EXTERNAL_BEAN_ARCHIVE, new ExternalBeanArchiveProcessor());
processorTarget.addDeploymentProcessor(WeldExtension.SUBSYSTEM_NAME, Phase.POST_MODULE, Phase.POST_MODULE_WELD_PORTABLE_EXTENSIONS, new WeldPortableExtensionProcessor());
processorTarget.addDeploymentProcessor(WeldExtension.SUBSYSTEM_NAME, Phase.POST_MODULE, Phase.POST_MODULE_WELD_COMPONENT_INTEGRATION, new WeldComponentIntegrationProcessor());
processorTarget.addDeploymentProcessor(WeldExtension.SUBSYSTEM_NAME, Phase.INSTALL, Phase.INSTALL_WELD_DEPLOYMENT, new WeldDeploymentProcessor(checkJtsEnabled(context)));
processorTarget.addDeploymentProcessor(WeldExtension.SUBSYSTEM_NAME, Phase.INSTALL, Phase.INSTALL_WELD_BEAN_MANAGER, new WeldBeanManagerServiceProcessor());
// Add additional deployment processors
ServiceLoader<DeploymentUnitProcessorProvider> processorProviders = ServiceLoader.load(DeploymentUnitProcessorProvider.class, WildFlySecurityManager.getClassLoaderPrivileged(WeldSubsystemAdd.class));
for (DeploymentUnitProcessorProvider provider : processorProviders) {
processorTarget.addDeploymentProcessor(WeldExtension.SUBSYSTEM_NAME, provider.getPhase(), provider.getPriority(), provider.getProcessor());
}
}
}, OperationContext.Stage.RUNTIME);
TCCLSingletonService singleton = new TCCLSingletonService();
context.getServiceTarget().addService(TCCLSingletonService.SERVICE_NAME, singleton).setInitialMode(Mode.ON_DEMAND).install();
context.getServiceTarget().addService(WeldExecutorServices.SERVICE_NAME, new WeldExecutorServices(threadPoolSize)).setInitialMode(Mode.ON_DEMAND).install();
}
use of org.jboss.as.server.AbstractDeploymentChainStep in project wildfly by wildfly.
the class FederationSubsystemAdd method performBoottime.
@Override
public void performBoottime(OperationContext context, ModelNode operation, ModelNode model, ServiceVerificationHandler verificationHandler, List<ServiceController<?>> controllers) throws OperationFailedException {
PicketLinkLogger.ROOT_LOGGER.activatingSubsystem("Federation");
context.addStep(new AbstractDeploymentChainStep() {
@Override
public void execute(DeploymentProcessorTarget processorTarget) {
PicketLinkLogger.ROOT_LOGGER.trace("Installing the PicketLink Defederation Dependency Processor.");
processorTarget.addDeploymentProcessor(FederationExtension.SUBSYSTEM_NAME, FederationDependencyProcessor.PHASE, FederationDependencyProcessor.PRIORITY, new FederationDependencyProcessor());
PicketLinkLogger.ROOT_LOGGER.trace("Installing the PicketLink Federation Deployment Processor.");
processorTarget.addDeploymentProcessor(FederationExtension.SUBSYSTEM_NAME, FederationDeploymentProcessor.PHASE, FederationDeploymentProcessor.PRIORITY, new FederationDeploymentProcessor());
}
}, OperationContext.Stage.RUNTIME);
}
Aggregations