Refine search
@Override public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final ServiceName serviceName = deploymentUnit.getServiceName().append(SERVICE_NAME); final CachedConnectionManagerSetupAction action = new CachedConnectionManagerSetupAction(serviceName); phaseContext.getServiceTarget().addService(serviceName, action) .addDependency(ConnectorServices.CCM_SERVICE, CachedConnectionManager.class, action.cachedConnectionManager) .addDependency(ConnectorServices.NON_TX_CCM_SERVICE, CachedConnectionManager.class, action.noTxCcmValue) .install(); deploymentUnit.addToAttachmentList(Attachments.WEB_SETUP_ACTIONS, action); deploymentUnit.addToAttachmentList(Attachments.OTHER_EE_SETUP_ACTIONS, action); }
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final ServiceName serviceName = deploymentUnit.getServiceName().append(SERVICE_NAME); final TransactionRollbackSetupAction service = new TransactionRollbackSetupAction(serviceName); phaseContext.getServiceTarget().addService(serviceName, service) .addDependency(TransactionManagerService.INTERNAL_SERVICE_NAME, TransactionManager.class, service.getTransactionManager()) .install(); deploymentUnit.addToAttachmentList(Attachments.WEB_SETUP_ACTIONS, service); }
public void getResourceValue(final ResolutionContext context, final ServiceBuilder<?> serviceBuilder, final DeploymentPhaseContext phaseContext, final Injector<ManagedReferenceFactory> injector) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final EEModuleDescription eeModuleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION); try { MailSessionService mailSessionService = new DirectMailSessionService(provider); startMailSession(mailSessionService, jndiName, eeModuleDescription, context, phaseContext.getServiceTarget(), serviceBuilder, injector); } catch (Exception e) { throw new DeploymentUnitProcessingException(e); } }
@Override public void configure(DeploymentPhaseContext context, ComponentDescription description, ComponentConfiguration configuration) throws DeploymentUnitProcessingException { CapabilityServiceSupport support = context.getDeploymentUnit().getAttachment(org.jboss.as.server.deployment.Attachments.CAPABILITY_SERVICE_SUPPORT); StatefulComponentDescription statefulDescription = (StatefulComponentDescription) description; ServiceName cacheFactoryServiceName = statefulDescription.getCacheFactoryServiceName(); ServiceTarget target = context.getServiceTarget(); ServiceBuilder<?> builder = target.addService(cacheFactoryServiceName.append("installer")); Supplier<CacheFactoryBuilder<SessionID, StatefulSessionComponentInstance>> cacheFactoryBuilder = builder.requires(this.getCacheFactoryBuilderRequirement(statefulDescription)); Service service = new ChildTargetService(new Consumer<ServiceTarget>() { @Override public void accept(ServiceTarget target) { cacheFactoryBuilder.get().getServiceConfigurator(cacheFactoryServiceName, statefulDescription, configuration).configure(support).build(target).install(); } }); builder.setInstance(service).install(); }
@Override public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final Module module = deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.MODULE); if (module == null) { return; } RegistrationService registrationService = new RegistrationService(module); ServiceName registrationServiceName = deploymentUnit.getServiceName().append("ejb3","client-context","registration-service"); final ServiceName profileServiceName = getProfileServiceName(phaseContext); final ServiceBuilder<Void> builder = phaseContext.getServiceTarget().addService(registrationServiceName, registrationService) .addDependency(getEJBClientContextServiceName(phaseContext), EJBClientContextService.class, registrationService.ejbClientContextInjectedValue) .addDependency(getDiscoveryServiceName(phaseContext), Discovery.class, registrationService.discoveryInjector); if (profileServiceName != null) { builder.addDependency(profileServiceName, RemotingProfileService.class, registrationService.profileServiceInjectedValue); } builder.install(); final EEModuleDescription moduleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION); if (moduleDescription == null) { return; } //we need to make sure all our components have a dependency on the EJB client context registration, which in turn implies a dependency on the context for(final ComponentDescription component : moduleDescription.getComponentDescriptions()) { component.addDependency(registrationServiceName); } }
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); boolean securityEnabled = deploymentUnit.hasAttachment(SecurityAttachments.SECURITY_ENABLED); if(!securityEnabled) { return; } AbstractSecurityDeployer<?> deployer = null; deployer = new EjbSecurityDeployer(); JaccService<?> service = deployer.deploy(deploymentUnit); if (service != null) { final DeploymentUnit parentDU = deploymentUnit.getParent(); // EJBs maybe included directly in war deployment ServiceName jaccServiceName = getJaccServiceName(deploymentUnit); final ServiceTarget serviceTarget = phaseContext.getServiceTarget(); ServiceBuilder<?> builder = serviceTarget.addService(jaccServiceName, service); if (parentDU != null) { // add dependency to parent policy builder.addDependency(parentDU.getServiceName().append(JaccService.SERVICE_NAME), PolicyConfiguration.class, service.getParentPolicyInjector()); } builder.setInitialMode(Mode.ACTIVE).install(); } }
/** * {@inheritDoc} */ @Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); AbstractSecurityDeployer<?> deployer = null; if (DeploymentTypeMarker.isType(DeploymentType.EAR, deploymentUnit)) { deployer = new EarSecurityDeployer(); JaccService<?> service = deployer.deploy(deploymentUnit); if (service != null) { final ServiceName jaccServiceName = deploymentUnit.getServiceName().append(JaccService.SERVICE_NAME); final ServiceTarget serviceTarget = phaseContext.getServiceTarget(); ServiceBuilder<?> builder = serviceTarget.addService(jaccServiceName, service); if (deploymentUnit.getParent() != null) { // add dependency to parent policy final DeploymentUnit parentDU = deploymentUnit.getParent(); builder.addDependency(parentDU.getServiceName().append(JaccService.SERVICE_NAME), PolicyConfiguration.class, service.getParentPolicyInjector()); } builder.setInitialMode(Mode.ACTIVE).install(); } } }
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final Module module = deploymentUnit.getAttachment(Attachments.MODULE); final ServicesAttachment servicesAttachment = deploymentUnit.getAttachment(Attachments.SERVICES); DriverService driverService = new DriverService(driverMetadata, driver); phaseContext .getServiceTarget() .addService(ServiceName.JBOSS.append("jdbc-driver", driverName.replaceAll("\\.", "_")), driverService) .addDependency(ConnectorServices.JDBC_DRIVER_REGISTRY_SERVICE, DriverRegistry.class,
@Override public void deploy(DeploymentPhaseContext phaseContext) { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final DeploymentUnit topLevelDeployment = deploymentUnit.getParent() == null ? deploymentUnit : deploymentUnit.getParent(); final ServiceName weldStartService = topLevelDeployment.getServiceName().append(ServiceNames.WELD_START_SERVICE_NAME); if (!WeldDeploymentMarker.isPartOfWeldDeployment(deploymentUnit)) { return; } if (!deploymentUnit.hasAttachment(BeanValidationAttachments.VALIDATOR_FACTORY)) { return; } final ServiceTarget serviceTarget = phaseContext.getServiceTarget(); final ServiceName serviceName = deploymentUnit.getServiceName().append(CdiValidatorFactoryService.SERVICE_NAME); final ServiceBuilder<?> sb = serviceTarget.addService(serviceName); final Supplier<BeanManager> beanManagerSupplier = sb.requires(ServiceNames.beanManagerServiceName(deploymentUnit)); sb.requires(weldStartService); sb.setInstance(new CdiValidatorFactoryService(deploymentUnit, beanManagerSupplier)); sb.install(); }
@Override public void deploy(DeploymentPhaseContext context) { DeploymentUnit unit = context.getDeploymentUnit(); final ServiceName name = unit.getServiceName(); EEModuleDescription moduleDescription = unit.getAttachment(Attachments.EE_MODULE_DESCRIPTION); final ServiceTarget target = context.getServiceTarget();
@Override public void configure(final DeploymentPhaseContext context, final ComponentDescription description, final ComponentConfiguration configuration) throws DeploymentUnitProcessingException { final Class<?> componentClass = configuration.getComponentClass(); final DeploymentUnit deploymentUnit = context.getDeploymentUnit(); final Module module = deploymentUnit.getAttachment(Attachments.MODULE); final ModuleClassLoader classLoader = module.getClassLoader(); //get the interceptors so they can be injected as well final Set<Class<?>> interceptorClasses = new HashSet<Class<?>>(); for (InterceptorDescription interceptorDescription : description.getAllInterceptors()) { try { interceptorClasses.add(ClassLoadingUtils.loadClass(interceptorDescription.getInterceptorClassName(), module)); } catch (ClassNotFoundException e) { throw WeldLogger.ROOT_LOGGER.couldNotLoadInterceptorClass(interceptorDescription.getInterceptorClassName(), e); } } addWeldIntegration(componentIntegrators, componentInterceptorSupport, context.getServiceTarget(), configuration, description, componentClass, beanName, weldBootstrapService, weldStartService, beanManagerService, interceptorClasses, classLoader, description.getBeanDeploymentArchiveId()); } });
/** * Add a ContextService for this module. * * @param phaseContext the deployment unit context * @throws DeploymentUnitProcessingException */ public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); if (deploymentUnit.getParent() != null) { return; } EEModuleDescription moduleDescription = deploymentUnit.getAttachment(org.jboss.as.ee.component.Attachments.EE_MODULE_DESCRIPTION); final ServiceTarget serviceTarget = phaseContext.getServiceTarget(); final ServiceName applicationContextServiceName = ContextNames.contextServiceNameOfApplication(moduleDescription.getApplicationName()); final NamingStoreService contextService = new NamingStoreService(true); serviceTarget.addService(applicationContextServiceName, contextService).install(); final ServiceName appNameServiceName = applicationContextServiceName.append("AppName"); final BinderService applicationNameBinder = new BinderService("AppName"); applicationNameBinder.getManagedObjectInjector().inject(new ValueManagedReferenceFactory(Values.immediateValue(moduleDescription.getApplicationName()))); serviceTarget.addService(appNameServiceName, applicationNameBinder) .addDependency(applicationContextServiceName, ServiceBasedNamingStore.class, applicationNameBinder.getNamingStoreInjector()) .install(); deploymentUnit.addToAttachmentList(org.jboss.as.server.deployment.Attachments.JNDI_DEPENDENCIES, appNameServiceName); deploymentUnit.putAttachment(Attachments.APPLICATION_CONTEXT_CONFIG, applicationContextServiceName); }
public void getResourceValue(final ResolutionContext context, final ServiceBuilder<?> serviceBuilder, final DeploymentPhaseContext phaseContext, final Injector<ManagedReferenceFactory> injector) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final Module module = deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.MODULE); String raId = resourceAdapter; module, bindInfo); ServiceName serviceName = DirectConnectionFactoryActivatorService.SERVICE_NAME_BASE.append(jndiName); final ServiceBuilder sb = phaseContext.getServiceTarget().addService(serviceName, service); sb.addDependency(ConnectorServices.IRONJACAMAR_MDR, AS7MetadataRepository.class, service.getMdrInjector()); sb.requires(ConnectorServices.RESOURCE_ADAPTER_DEPLOYER_SERVICE_PREFIX.append(deployerServiceName));
public void getResourceValue(final ResolutionContext context, final ServiceBuilder<?> serviceBuilder, final DeploymentPhaseContext phaseContext, final Injector<ManagedReferenceFactory> injector) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final Module module = deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.MODULE); String raId = resourceAdapter; raId, properties, module, bindInfo); ServiceName serviceName = DirectAdminObjectActivatorService.SERVICE_NAME_BASE.append(jndiName); final ServiceBuilder sb = phaseContext.getServiceTarget().addService(serviceName, service); sb.addDependency(ConnectorServices.IRONJACAMAR_MDR, AS7MetadataRepository.class, service.getMdrInjector()); sb.requires(ConnectorServices.RESOURCE_ADAPTER_DEPLOYER_SERVICE_PREFIX.append(deployerServiceName));
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final ServiceBuilder<Discovery> builder = phaseContext.getServiceTarget().addService(discoveryServiceName, discoveryService); Injector<DiscoveryProvider> providerInjector = discoveryService.getDiscoveryProviderInjector(); new RemoteEJBDiscoveryConfigurator().configure(providerInjector::inject, registryProvider -> {});
/** * Process a deployment for KernelDeployment configuration. * Will install a {@code POJO} for each configured bean. * * @param phaseContext the deployment unit context * @throws DeploymentUnitProcessingException * */ public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit unit = phaseContext.getDeploymentUnit(); final List<KernelDeploymentXmlDescriptor> kdXmlDescriptors = unit.getAttachment(KernelDeploymentXmlDescriptor.ATTACHMENT_KEY); if (kdXmlDescriptors == null || kdXmlDescriptors.isEmpty()) return; final Module module = unit.getAttachment(Attachments.MODULE); if (module == null) throw PojoLogger.ROOT_LOGGER.noModuleFound(unit); final ServiceTarget serviceTarget = phaseContext.getServiceTarget(); final DeploymentReflectionIndex index = unit.getAttachment(Attachments.REFLECTION_INDEX); if (index == null) throw PojoLogger.ROOT_LOGGER.missingReflectionIndex(unit); for (KernelDeploymentXmlDescriptor kdXmlDescriptor : kdXmlDescriptors) { final List<BeanMetaDataConfig> beanConfigs = kdXmlDescriptor.getBeans(); for (final BeanMetaDataConfig beanConfig : beanConfigs) { describeBean(module, serviceTarget, index, beanConfig); } // TODO -- KD::classloader, KD::aliases } }
@Override public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final EEModuleDescription eeModuleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION); final Module module = deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.MODULE); 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);
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); SharedSessionManagerConfig sharedConfig = deploymentUnit.getAttachment(UndertowAttachments.SHARED_SESSION_MANAGER_CONFIG); if (sharedConfig == null) return; ServiceTarget target = phaseContext.getServiceTarget(); ServiceName deploymentServiceName = deploymentUnit.getServiceName();
@Override public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); CapabilityServiceSupport support = deploymentUnit.getAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT); ServiceName namingStoreServiceName = support.getCapabilityServiceName(NamingService.CAPABILITY_NAME); //this will always be up but we need to make sure the naming service is //not shut down before the deployment is undeployed when the container is shut down phaseContext.addToAttachmentList(Attachments.NEXT_PHASE_DEPS, namingStoreServiceName); List<ServiceName> dependencies = deploymentUnit.getAttachmentList(Attachments.JNDI_DEPENDENCIES); final ServiceName serviceName = serviceName(deploymentUnit.getServiceName()); final ServiceBuilder<?> serviceBuilder = phaseContext.getServiceTarget().addService(serviceName, new RuntimeBindReleaseService()); for (final ServiceName dependency : dependencies) { serviceBuilder.requires(dependency); } if(deploymentUnit.getParent() != null) { for (final ServiceName jndiDependency : deploymentUnit.getParent().getAttachment(Attachments.JNDI_DEPENDENCIES)) { serviceBuilder.requires(jndiDependency); } } serviceBuilder.requires(namingStoreServiceName); serviceBuilder.install(); }
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); if (!IIOPDeploymentMarker.isIIOPDeployment(deploymentUnit)) { return; phaseContext.getServiceTarget(), iiopMetaData);