/** * Creates the service name used for the bean manager on the deployment. * * @param deploymentUnit the deployment unit to create the service name for * * @return the service name */ public static ServiceName beanManagerServiceName(final DeploymentUnit deploymentUnit) { return deploymentUnit.getServiceName().append("beanmanager"); }
public static ServiceName serviceName(final DeploymentUnit deploymentUnit) { return deploymentUnit.getServiceName().append(BeanManagerService.NAME); }
public static ServiceName beanManagerServiceName(final DeploymentUnit deploymentUnit) { return deploymentUnit.getServiceName().append(BEAN_MANAGER_SERVICE_NAME); }
public static ServiceName serviceName(final DeploymentUnit deploymentUnit) { return deploymentUnit.getServiceName().append(SERVICE_NAME); }
/** * Creates the service name used for the job operator registered for the deployment. * * @param deploymentUnit the deployment unit where the operator is to be registered * * @return the service name */ public static ServiceName jobOperatorServiceName(final DeploymentUnit deploymentUnit) { return deploymentUnit.getServiceName().append("batch").append("job-operator"); }
/** * Creates a service name for the batch environment service. * * @param deploymentUnit the deployment unit to create the service name for * * @return the service name */ public static ServiceName batchEnvironmentServiceName(final DeploymentUnit deploymentUnit) { return deploymentUnit.getServiceName().append("batch").append("environment"); }
/** * Creates a service name for the {@linkplain org.jberet.spi.ArtifactFactory artifact factory} service. * * @param deploymentUnit the deployment unit to create the service name for * * @return the service name */ public static ServiceName batchArtifactFactoryServiceName(final DeploymentUnit deploymentUnit) { return deploymentUnit.getServiceName().append("batch").append("artifact").append("factory"); }
public MarshallingConfigurationRepositoryServiceConfigurator(DeploymentUnit unit) { super(unit.getServiceName().append("marshalling")); this.module = unit.getAttachment(Attachments.MODULE); this.deployment = new ServiceSupplierDependency<>(unit.getServiceName().append(ModuleDeployment.SERVICE_NAME)); }
@Override public Collection<CapabilityServiceConfigurator> getDeploymentServiceConfigurators(DeploymentUnit unit) { return this.builder.getDeploymentServiceConfigurators(unit.getServiceName()); }
private ServiceName getJaccServiceName(DeploymentUnit deploymentUnit){ final DeploymentUnit parentDU = deploymentUnit.getParent(); // EJBs maybe included directly in war deployment ServiceName jaccServiceName = deploymentUnit.getServiceName().append(JaccService.SERVICE_NAME).append("ejb"); //Qualify the service name properly with parent DU if(parentDU != null) { jaccServiceName = jaccServiceName.append(parentDU.getName()); } return jaccServiceName; } }
@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 Collection<CapabilityServiceConfigurator> getDeploymentServiceConfigurators(DeploymentUnit unit) { ServiceConfigurator configurator = new RemoveOnCancelScheduledExecutorServiceConfigurator(this.getExpirationSchedulerServiceName(unit.getServiceName()), THREAD_FACTORY); return Collections.singleton(new ServiceConfiguratorAdapter(configurator)); }
@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); }
@Override public void undeploy(DeploymentUnit context) { final ServiceName weldTransactionServiceName = context.getServiceName().append(ServiceNames.WELD_TRANSACTION_SERVICES_SERVICE_NAME); final ServiceController<?> serviceController = context.getServiceRegistry().getService(weldTransactionServiceName); if (serviceController != null) { serviceController.setMode(ServiceController.Mode.REMOVE); } }
private void createDependency(DeploymentUnit deploymentUnit, WarMetaData warMetaData) { final ServiceName weldStartService = (deploymentUnit.getParent() != null ? deploymentUnit.getParent() : deploymentUnit).getServiceName().append(WeldStartService.SERVICE_NAME); warMetaData.addAdditionalDependency(weldStartService); }
@Override public ServiceName install(ServiceTarget serviceTarget, DeploymentUnit deploymentUnit, boolean jtsEnabled) { final ServiceName weldTransactionServiceName = deploymentUnit.getServiceName().append(WeldTransactionServices.SERVICE_NAME); final ServiceBuilder<?> sb = serviceTarget.addService(weldTransactionServiceName); final Consumer<WeldTransactionServices> weldTransactionServicesConsumer = sb.provides(weldTransactionServiceName); // Ensure the local transaction provider is started before we start sb.requires(ServiceNames.capabilityServiceName(deploymentUnit, "org.wildfly.transactions.global-default-local-provider")); sb.setInstance(new WeldTransactionServices(jtsEnabled, weldTransactionServicesConsumer)); sb.install(); return weldTransactionServiceName; }
private void installManagedBeanComponent(String className, final EEModuleDescription moduleDescription, final DeploymentUnit deploymentUnit, final EEApplicationClasses applicationClassesDescription) { final ComponentDescription componentDescription = new WebComponentDescription(MANAGED_BEAN.toString() + "." + className, className, moduleDescription, deploymentUnit.getServiceName(), applicationClassesDescription); moduleDescription.addComponent(componentDescription); deploymentUnit.addToAttachmentList(WebComponentDescription.WEB_COMPONENTS, componentDescription.getStartServiceName()); }
public static void install(final DeploymentUnit deploymentUnit, final ServiceTarget serviceTarget) { final ServiceName sn = serviceName(deploymentUnit); final ServiceBuilder<?> sb = serviceTarget.addService(sn); final Consumer<EEClassIntrospector> eeClassIntrospectorConsumer = sb.provides(sn); final Supplier<BeanManager> beanManagerSupplier = sb.requires(BeanManagerService.serviceName(deploymentUnit)); sb.requires(Utils.getRootDeploymentUnit(deploymentUnit).getServiceName().append(WeldStartService.SERVICE_NAME)); sb.setInstance(new WeldClassIntrospector(eeClassIntrospectorConsumer, beanManagerSupplier)); sb.install(); }
public static void registerAsComponent(String listener, DeploymentUnit deploymentUnit) { final EEApplicationClasses applicationClasses = deploymentUnit.getAttachment(Attachments.EE_APPLICATION_CLASSES_DESCRIPTION); final EEModuleDescription module = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION); final WebComponentDescription componentDescription = new WebComponentDescription(listener, listener, module, deploymentUnit.getServiceName(), applicationClasses); module.addComponent(componentDescription); deploymentUnit.addToAttachmentList(WebComponentDescription.WEB_COMPONENTS, componentDescription.getStartServiceName()); }
private void setupConcurrentContext(ConcurrentContext concurrentContext, String applicationName, String moduleName, String componentName, ClassLoader moduleClassLoader, NamespaceContextSelector namespaceContextSelector, DeploymentUnit deploymentUnit, ServiceTarget serviceTarget) { // add default factories concurrentContext.addFactory(new NamingContextHandleFactory(namespaceContextSelector, deploymentUnit.getServiceName())); concurrentContext.addFactory(new ClassLoaderContextHandleFactory(moduleClassLoader)); for(ContextHandleFactory factory : deploymentUnit.getAttachmentList(Attachments.ADDITIONAL_FACTORIES)) { concurrentContext.addFactory(factory); } concurrentContext.addFactory(new OtherEESetupActionsContextHandleFactory(deploymentUnit.getAttachmentList(Attachments.OTHER_EE_SETUP_ACTIONS))); final ConcurrentContextService service = new ConcurrentContextService(concurrentContext); final ServiceName serviceName = ConcurrentServiceNames.getConcurrentContextServiceName(applicationName, moduleName, componentName); serviceTarget.addService(serviceName, service) .install(); }