final int startupBeansCount = moduleDescription.getStartupBeansCount(); final ClassLoader oldCl = WildFlySecurityManager.getCurrentContextClassLoaderPrivileged(); try { WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(module.getClassLoader()); final Iterator<ComponentDescription> iterator = moduleDescription.getComponentDescriptions().iterator(); while (iterator.hasNext()) { final ComponentDescription componentDescription = iterator.next(); ROOT_LOGGER.debugf("Configuring component class: %s named %s", componentDescription.getComponentClassName(), componentDescription.getComponentName()); final ComponentConfiguration componentConfiguration; try { componentConfiguration = componentDescription.createConfiguration(reflectionIndex.getClassIndex(ClassLoadingUtils.loadClass(componentDescription.getComponentClassName(), module)), module.getClassLoader(), module.getModuleLoader()); for (final ComponentConfigurator componentConfigurator : componentDescription.getConfigurators()) { componentConfigurator.configure(phaseContext, componentDescription, componentConfiguration); if (componentDescription.isOptional()) { ROOT_LOGGER.componentInstallationFailure(componentDescription.getComponentName()); ROOT_LOGGER.debugf(e, "Not installing optional component %s due to an exception", componentDescription.getComponentName()); failed.add(componentDescription.getStartServiceName()); failed.add(componentDescription.getCreateServiceName()); failed.add(componentDescription.getServiceName()); iterator.remove(); } else { throw EeLogger.ROOT_LOGGER.cannotConfigureComponent(e, componentDescription.getComponentName());
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final EEModuleDescription moduleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION); final EEApplicationClasses applicationClassesDescription = deploymentUnit.getAttachment(Attachments.EE_APPLICATION_CLASSES_DESCRIPTION); final CompositeIndex compositeIndex = deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.COMPOSITE_ANNOTATION_INDEX); if (moduleDescription == null) { return; //not an EE deployment for (ComponentDescription component : moduleDescription.getComponentDescriptions()) { componentByClass.put(component.getComponentClassName(), component); if (!(description.getViews().size() == 1)) { throw UndertowLogger.ROOT_LOGGER.wrongComponentType(clazz); description = new WebComponentDescription(clazz, clazz, moduleDescription, deploymentUnit.getServiceName(), applicationClassesDescription); moduleDescription.addComponent(description); deploymentUnit.addToAttachmentList(WebComponentDescription.WEB_COMPONENTS, description.getStartServiceName());
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final EEModuleDescription moduleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION); if(moduleDescription == null) { return; } final ServiceTarget serviceTarget = phaseContext.getServiceTarget(); //if this is a war we need to bind to the modules comp namespace if(DeploymentTypeMarker.isType(DeploymentType.WAR,deploymentUnit)) { final ServiceName moduleContextServiceName = ContextNames.contextServiceNameOfModule(moduleDescription.getApplicationName(),moduleDescription.getModuleName()); bindServices(deploymentUnit, serviceTarget, moduleContextServiceName); } for(ComponentDescription component : moduleDescription.getComponentDescriptions()) { if(component.getNamingMode() == ComponentNamingMode.CREATE) { final ServiceName compContextServiceName = ContextNames.contextServiceNameOfComponent(moduleDescription.getApplicationName(),moduleDescription.getModuleName(),component.getComponentName()); bindServices(deploymentUnit, serviceTarget, compContextServiceName); } } }
public String toString() { return getClass().getName() + "[name=" + componentDescription.getComponentName() + " class=" + componentDescription.getComponentClassName() + "]"; }
/** * Get the context service name. * * @return the context service name */ public ServiceName getContextServiceName() { if (contextServiceName != null) return contextServiceName; if (getNamingMode() == ComponentNamingMode.CREATE) { return ContextNames.contextServiceNameOfComponent(getApplicationName(), getModuleName(), getComponentName()); } else if (getNamingMode() == ComponentNamingMode.USE_MODULE) { return ContextNames.contextServiceNameOfModule(getApplicationName(), getModuleName()); } else { throw new IllegalStateException(); } }
@Override public void configure(DeploymentPhaseContext context, ComponentDescription description, final ComponentConfiguration configuration) throws DeploymentUnitProcessingException { final ConcurrentContext concurrentContext = configuration.getConcurrentContext(); // setup context setupConcurrentContext(concurrentContext, description.getApplicationName(), description.getModuleName(), description.getComponentName(), configuration.getModuleClassLoader(), configuration.getNamespaceContextSelector(), context.getDeploymentUnit(), context.getServiceTarget()); // add the interceptor which manages the concurrent context final ConcurrentContextInterceptor interceptor = new ConcurrentContextInterceptor(concurrentContext); final InterceptorFactory interceptorFactory = new ImmediateInterceptorFactory(interceptor); configuration.addPostConstructInterceptor(interceptorFactory, InterceptorOrder.ComponentPostConstruct.CONCURRENT_CONTEXT); configuration.addPreDestroyInterceptor(interceptorFactory, InterceptorOrder.ComponentPreDestroy.CONCURRENT_CONTEXT); if (description.isPassivationApplicable()) { configuration.addPrePassivateInterceptor(interceptorFactory, InterceptorOrder.ComponentPassivation.CONCURRENT_CONTEXT); configuration.addPostActivateInterceptor(interceptorFactory, InterceptorOrder.ComponentPassivation.CONCURRENT_CONTEXT); } configuration.addComponentInterceptor(interceptorFactory, InterceptorOrder.Component.CONCURRENT_CONTEXT, false); } };
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final EEApplicationClasses applicationClasses = deploymentUnit.getAttachment(Attachments.EE_APPLICATION_CLASSES_DESCRIPTION); final EEModuleConfiguration moduleConfiguration = deploymentUnit.getAttachment(Attachments.EE_MODULE_CONFIGURATION); final EEModuleDescription eeModuleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION); final Module module = deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.MODULE); if (moduleConfiguration == null) { final List<BindingConfiguration> bindingConfigurations = eeModuleDescription.getBindingConfigurations(); for (BindingConfiguration binding : componentConfiguration.getComponentDescription().getBindingConfigurations()) { final String bindingName = binding.getName(); final boolean compBinding = bindingName.startsWith("java:comp") || !bindingName.startsWith("java:"); if (componentConfiguration.getComponentDescription().getNamingMode() == ComponentNamingMode.CREATE && compBinding) { classConfigurations.add(componentConfiguration.getComponentClass()); for (final InterceptorDescription interceptor : componentConfiguration.getComponentDescription().getAllInterceptors()) { try { classConfigurations.add(ClassLoadingUtils.loadClass(interceptor.getInterceptorClassName(), module)); processClassConfigurations(phaseContext, applicationClasses, moduleConfiguration, deploymentDescriptorBindings, handledClasses, componentConfiguration.getComponentDescription().getNamingMode(), classConfigurations, componentConfiguration.getComponentName(), dependencies); if (!MetadataCompleteMarker.isMetadataComplete(phaseContext.getDeploymentUnit()) && !appClient) { for (EEModuleClassDescription config : eeModuleDescription.getClassDescriptions()) { if (handledClasses.contains(config.getClassName())) { continue;
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final ServiceName paViewServiceName = getProcessApplicationViewServiceName(paComponent); Module module = deploymentUnit.getAttachment(Attachments.MODULE); final String moduleName = module.getIdentifier().toString(); final ServiceName paStartServiceName = ServiceNames.forProcessApplicationStartService(moduleName); final ServiceName paStopServiceName = ServiceNames.forProcessApplicationStopService(moduleName); ServiceBuilder<ProcessApplicationStopService> stopServiceBuilder = phaseContext.getServiceTarget().addService(paStopServiceName, paStopService) .addDependency(phaseContext.getPhaseServiceName()) .addDependency(ServiceNames.forBpmPlatformPlugins(), BpmPlatformPlugins.class, paStopService.getPlatformPluginsInjector()) .setInitialMode(Mode.ACTIVE); ServiceName deploymentServiceName = ServiceNames.forProcessApplicationDeploymentService(deploymentUnit.getName(), processArachiveName); ServiceBuilder<ProcessApplicationDeploymentService> serviceBuilder = phaseContext.getServiceTarget().addService(deploymentServiceName, deploymentService) .addDependency(phaseContext.getPhaseServiceName()) serviceBuilder.addDependency(paComponent.getStartServiceName()); serviceBuilder.addDependency(paViewServiceName, ComponentView.class, deploymentService.getPaComponentViewInjector()); } else {
final ServiceName createServiceName = configuration.getComponentDescription().getCreateServiceName(); final ServiceName startServiceName = configuration.getComponentDescription().getStartServiceName(); final ServiceBuilder<Component> startBuilder = serviceTarget.addService(startServiceName, startService); deploymentUnit.addToAttachmentList(org.jboss.as.server.deployment.Attachments.DEPLOYMENT_COMPLETE_SERVICES, startServiceName); ServiceName jndiDepServiceName = configuration.getComponentDescription().getServiceName().append(JNDI_BINDINGS_SERVICE); final ServiceBuilder<Void> jndiDepServiceBuilder = serviceTarget.addService(jndiDepServiceName, Service.NULL); jndiDependencies.add(jndiDepServiceName); final ServiceName contextServiceName; if (configuration.getComponentDescription().getNamingMode() == ComponentNamingMode.CREATE) { final NamingStoreService contextService = new NamingStoreService(true); serviceTarget.addService(configuration.getComponentDescription().getContextServiceName(), contextService).install(); configuration.getComponentDescription().getNamingMode() == ComponentNamingMode.USE_MODULE, if (configuration.getComponentDescription().getNamingMode() == ComponentNamingMode.CREATE) { processBindings(phaseContext, configuration, serviceTarget, resolutionContext, configuration.getComponentDescription().getBindingConfigurations(), jndiDepServiceBuilder, bound); for (InterceptorDescription interceptor : configuration.getComponentDescription().getAllInterceptors()) { final Class<?> interceptorClass; try { interceptorClass = module.getClassLoader().loadClass(interceptor.getInterceptorClassName());
String applicationName = eeModuleDescription.getEarApplicationName(); final DeploymentModuleIdentifier identifier = new DeploymentModuleIdentifier(applicationName, eeModuleDescription.getModuleName(), eeModuleDescription.getDistinctName()); final Collection<ComponentDescription> componentDescriptions = eeModuleDescription.getComponentDescriptions(); if (component instanceof EJBComponentDescription) { final EJBComponentDescription ejbComponentDescription = (EJBComponentDescription) component; componentStartServices.add(component.getStartServiceName()); injectedValues.put(component.getCreateServiceName(), componentInjectedValue); final Map<String, InjectedValue<ComponentView>> remoteViews = new HashMap<String, InjectedValue<ComponentView>>(); final Map<String, InjectedValue<ComponentView>> localViews = new HashMap<String, InjectedValue<ComponentView>>(); final EjbDeploymentInformation info = new EjbDeploymentInformation(ejbComponentDescription.getEJBName(), componentInjectedValue, remoteViews, localViews, module.getClassLoader(), iorFactory); deploymentInformationMap.put(ejbComponentDescription.getEJBName(), info); final StartupCountdown countdown = deploymentUnit.getAttachment(Attachments.STARTUP_COUNTDOWN); final ModuleDeployment deployment = new ModuleDeployment(identifier, deploymentInformationMap); ServiceName moduleDeploymentService = deploymentUnit.getServiceName().append(ModuleDeployment.SERVICE_NAME); final ServiceBuilder<ModuleDeployment> builder = phaseContext.getServiceTarget().addService(moduleDeploymentService, deployment); for (Map.Entry<ServiceName, InjectedValue<?>> entry : injectedValues.entrySet()) { builder.addDependency(entry.getKey(), Object.class, (InjectedValue<Object>) entry.getValue()); final ServiceBuilder<Void> startBuilder = phaseContext.getServiceTarget().addService(deploymentUnit.getServiceName().append(ModuleDeployment.START_SERVICE_NAME), deploymentStart); for (final ServiceName componentStartService : componentStartServices) { startBuilder.requires(componentStartService);
final Set<MethodIdentifier> timeoutMethods = description.getTimerMethods(); if (description.isTimerServiceRequired()) { userAroundTimeoutsByInterceptorClass = new HashMap<>(); } else { if (description.isPassivationApplicable()) { userPrePassivatesByInterceptorClass = new HashMap<>(); userPostActivatesByInterceptorClass = new HashMap<>(); if (!description.isExcludeDefaultInterceptors()) { interceptorWithLifecycleCallbacks.addAll(description.getDefaultInterceptors()); interceptorWithLifecycleCallbacks.addAll(description.getClassInterceptors()); for (final InterceptorDescription interceptorDescription : description.getAllInterceptors()) { final String interceptorClassName = interceptorDescription.getInterceptorClassName(); final Class<?> interceptorClass; description.getBindingConfigurations().addAll(interceptorEnvironment.getBindingConfigurations()); for (final ResourceInjectionConfiguration injection : interceptorEnvironment.getResourceInjections()) { description.addResourceInjection(injection); if (description.isPassivationApplicable()) { if (userPrePassivatesByInterceptorClass.containsKey(interceptorClass.getInterceptorClassName())) { userPrePassivate.addAll(userPrePassivatesByInterceptorClass.get(interceptorClass.getInterceptorClassName())); if (description.isPassivationApplicable()) { final List<InterceptorDescription> classInterceptors = description.getClassInterceptors();
@Override public final void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final DeploymentDescriptorEnvironment environment = deploymentUnit.getAttachment(Attachments.MODULE_DEPLOYMENT_DESCRIPTOR_ENVIRONMENT); final EEApplicationClasses applicationClasses = deploymentUnit.getAttachment(Attachments.EE_APPLICATION_CLASSES_DESCRIPTION); final Module module = deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.MODULE); final DeploymentReflectionIndex deploymentReflectionIndex = deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.REFLECTION_INDEX); final EEModuleDescription description = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION); if (module == null || description == null) { return; } if (environment != null) { final List<BindingConfiguration> bindings = processDescriptorEntries(deploymentUnit, environment, description, null, module.getClassLoader(), deploymentReflectionIndex, applicationClasses); description.getBindingConfigurations().addAll(bindings); } for (final ComponentDescription componentDescription : description.getComponentDescriptions()) { if (componentDescription.getDeploymentDescriptorEnvironment() != null) { final List<BindingConfiguration> bindings = processDescriptorEntries(deploymentUnit, componentDescription.getDeploymentDescriptorEnvironment(), componentDescription, componentDescription, module.getClassLoader(), deploymentReflectionIndex, applicationClasses); componentDescription.getBindingConfigurations().addAll(bindings); } } for(final InterceptorEnvironment interceptorEnv : description.getInterceptorEnvironment().values()) { final List<BindingConfiguration> bindings = processDescriptorEntries(deploymentUnit, interceptorEnv.getDeploymentDescriptorEnvironment(), interceptorEnv, null, module.getClassLoader(), deploymentReflectionIndex, applicationClasses); interceptorEnv.getBindingConfigurations().addAll(bindings); } }
@Override public void deploy(DeploymentPhaseContext context) { final DeploymentUnit deploymentUnit = context.getDeploymentUnit(); final String topLevelName; return; if (deploymentUnit.getParent() == null) { topLevelName = deploymentUnit.getName(); } else { topLevelName = deploymentUnit.getParent().getName(); for (ComponentDescription component : deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION).getComponentDescriptions()) { if (component instanceof EJBComponentDescription) { final String entryPoint = ENTRY_POINT_NAME + deploymentUnit.getName() + "." + component.getComponentName(); ControlPointService.install(context.getServiceTarget(), topLevelName, entryPoint); component.getConfigurators().add(new ComponentConfigurator() { @Override public void configure(DeploymentPhaseContext context, ComponentDescription description, ComponentConfiguration configuration) {
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); if (deploymentUnit.getParent() != null) { return; WildFlySecurityManager.getClassLoaderPrivileged(ExternalBeanArchiveProcessor.class)); final String beanArchiveIdPrefix = deploymentUnit.getName() + ".external."; final Set<AnnotationType> beanDefiningAnnotations = new HashSet<>(deploymentUnit.getAttachment(WeldAttachments.BEAN_DEFINING_ANNOTATIONS)); EEModuleDescription moduleDesc = deployment.getAttachment(org.jboss.as.ee.component.Attachments.EE_MODULE_DESCRIPTION); if(moduleDesc != null) { for(ComponentDescription component : moduleDesc.getComponentDescriptions()) { for (ComponentSupport support : supportServices) { if (!support.isDiscoveredExternalType(component)) { componentClassNames.add(component.getComponentClassName()); break; return; for (DependencySpec dep : module.getDependencies()) { final Module dependency = loadModuleDependency(dep); if (dependency == null) {
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final EEModuleDescription eeModuleDescription = deploymentUnit.getAttachment(EE_MODULE_DESCRIPTION); final Collection<ComponentDescription> componentDescriptions = eeModuleDescription.getComponentDescriptions(); final Module module = deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.MODULE); if(module == null) { return; final ClassLoader moduleClassLoader = module.getClassLoader(); if (componentDescriptions != null) { for (ComponentDescription componentDescription : componentDescriptions) { continue; final Class<?> ejbClass = this.getEjbClass(componentDescription.getComponentClassName(), moduleClassLoader); try { this.processViewAnnotations(deploymentUnit, ejbClass, (SessionBeanComponentDescription) componentDescription); for (ComponentDescription componentDescription : deploymentUnit.getAttachmentList(org.jboss.as.ee.component.Attachments.ADDITIONAL_RESOLVABLE_COMPONENTS)) { if (componentDescription instanceof SessionBeanComponentDescription == false) { continue; final Class<?> ejbClass = this.getEjbClass(componentDescription.getComponentClassName(), moduleClassLoader); try { this.processViewAnnotations(deploymentUnit, ejbClass, (SessionBeanComponentDescription) componentDescription);
if (description.isTimerServiceApplicable()) { componentUserAroundTimeout = new ArrayList<InterceptorFactory>(); userAroundTimeoutsByInterceptorClass = new HashMap<String, List<InterceptorFactory>>(); if (description.isPassivationApplicable()) { userPrePassivatesByInterceptorClass = new HashMap<String, List<InterceptorFactory>>(); userPostActivatesByInterceptorClass = new HashMap<String, List<InterceptorFactory>>(); if (!description.isExcludeDefaultInterceptors()) { interceptorWithLifecycleCallbacks.addAll(description.getDefaultInterceptors()); interceptorWithLifecycleCallbacks.addAll(description.getClassInterceptors()); for (final InterceptorDescription interceptorDescription : description.getAllInterceptors()) { final String interceptorClassName = interceptorDescription.getInterceptorClassName(); final ClassIndex interceptorClass; description.getBindingConfigurations().addAll(interceptorEnvironment.getBindingConfigurations()); for (final ResourceInjectionConfiguration injection : interceptorEnvironment.getResourceInjections()) { description.addResourceInjection(injection); if (description.isPassivationApplicable()) { if (userPrePassivatesByInterceptorClass.containsKey(interceptorClass.getInterceptorClassName())) { userPrePassivate.addAll(userPrePassivatesByInterceptorClass.get(interceptorClass.getInterceptorClassName())); if (description.isPassivationApplicable()) { final List<InterceptorDescription> classInterceptors = description.getClassInterceptors(); final Map<MethodIdentifier, List<InterceptorDescription>> methodInterceptors = description.getMethodInterceptors();
componentClass = module.getClassLoader().loadClass(componentDescription.getComponentClassName()); } catch (ClassNotFoundException e) { throw EjbLogger.ROOT_LOGGER.failToLoadComponentClass(e, componentDescription.getComponentClassName()); final List<InterceptorBindingMetaData> bindings = bindingsPerComponent.get(componentDescription.getComponentName()); final Map<Method, List<InterceptorBindingMetaData>> methodInterceptors = new HashMap<Method, List<InterceptorBindingMetaData>>(); final List<InterceptorBindingMetaData> classLevelBindings = new ArrayList<InterceptorBindingMetaData>(); componentDescription.setDefaultInterceptors(defaultInterceptors); componentDescription.setExcludeDefaultInterceptors(true); componentDescription.setExcludeDefaultInterceptors(true); } else { classLevelInterceptors.addAll(componentDescription.getClassInterceptors()); for (InterceptorBindingMetaData binding : classLevelBindings) { if (binding.getInterceptorClasses() != null) { componentDescription.setClassInterceptors(classLevelInterceptors); excludeDefaultInterceptors = excludeDefaultInterceptors == null ? false : excludeDefaultInterceptors; if (!excludeDefaultInterceptors) { excludeDefaultInterceptors = componentDescription.isExcludeDefaultInterceptors() || componentDescription.isExcludeDefaultInterceptors(methodIdentifier); excludeClassInterceptors = excludeClassInterceptors == null ? false : excludeClassInterceptors; if (!excludeClassInterceptors) { excludeClassInterceptors = componentDescription.isExcludeClassInterceptors(methodIdentifier);
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final EEModuleDescription eeModuleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION); if (eeModuleDescription == null) { return; } final ComponentConfigurator componentConfigurator = new ComponentConfigurator() { @Override public void configure(DeploymentPhaseContext context, ComponentDescription description, final ComponentConfiguration configuration) throws DeploymentUnitProcessingException { final TransactionLeakContextHandleFactory transactionLeakContextHandleFactory = new TransactionLeakContextHandleFactory(); context.addDependency(TransactionManagerService.INTERNAL_SERVICE_NAME, TransactionManager.class, transactionLeakContextHandleFactory); configuration.getConcurrentContext().addFactory(transactionLeakContextHandleFactory); } }; for (ComponentDescription componentDescription : eeModuleDescription.getComponentDescriptions()) { componentDescription.getConfigurators().add(componentConfigurator); } }
protected String[] getDeploymentDescriptors(DeploymentUnit deploymentUnit) throws DeploymentUnitProcessingException { final ComponentDescription processApplicationComponent = ProcessApplicationAttachments.getProcessApplicationComponent(deploymentUnit); final String paClassName = processApplicationComponent.getComponentClassName(); String[] deploymentDescriptorResourceNames = null; Module module = deploymentUnit.getAttachment(MODULE); Class<?> paClass = null; try { paClass = (Class<?>) module.getClassLoader().loadClass(paClassName); } catch (ClassNotFoundException e) { throw new DeploymentUnitProcessingException("Unable to load process application class '"+paClassName+"'."); } ProcessApplication annotation = paClass.getAnnotation(ProcessApplication.class); if(annotation == null) { deploymentDescriptorResourceNames = new String[]{ PROCESSES_XML }; } else { deploymentDescriptorResourceNames = annotation.deploymentDescriptors(); } return deploymentDescriptorResourceNames; }
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final Module module = deploymentUnit.getAttachment(MODULE); final EEModuleConfiguration moduleConfiguration = deploymentUnit.getAttachment(EE_MODULE_CONFIGURATION); if (module == null || moduleConfiguration == null) { return; } ComponentRegistry componentRegistry = deploymentUnit.getAttachment(COMPONENT_REGISTRY); final List<ServiceName> dependencies = deploymentUnit.getAttachmentList(org.jboss.as.server.deployment.Attachments.JNDI_DEPENDENCIES); final ServiceName bindingDependencyService = JndiNamingDependencyProcessor.serviceName(deploymentUnit.getServiceName()); // Iterate through each component, installing it into the container for (final ComponentConfiguration configuration : moduleConfiguration.getComponentConfigurations()) { try { ROOT_LOGGER.tracef("Installing component %s", configuration.getComponentClass().getName()); deployComponent(phaseContext, configuration, dependencies, bindingDependencyService); componentRegistry.addComponent(configuration); //we need to make sure that the web deployment has a dependency on all components it the app, so web components are started //when the web subsystem is starting //we only add a dependency on components in the same sub deployment, otherwise we get circular dependencies when initialize-in-order is used deploymentUnit.addToAttachmentList(org.jboss.as.server.deployment.Attachments.WEB_DEPENDENCIES, configuration.getComponentDescription().getStartServiceName()); } catch (Exception e) { throw EeLogger.ROOT_LOGGER.failedToInstallComponent(e, configuration.getComponentName()); } } }