return new BindInfo(contextServiceNameOfApplication(app), context.substring(9)); } else if (namespace.equals("module")) { return new BindInfo(contextServiceNameOfModule(app, module), context.substring(12)); } else if (namespace.equals("comp")) { return new BindInfo(contextServiceNameOfComponent(app, module, comp), context.substring(10));
@Override public void getResourceValue(final ResolutionContext resolutionContext, final ServiceBuilder<?> serviceBuilder, final DeploymentPhaseContext phaseContext, final Injector<ManagedReferenceFactory> injector) throws DeploymentUnitProcessingException { final ContextManagedReferenceFactory managedReferenceFactory = new ContextManagedReferenceFactory(name); final ServiceName contextServiceName; if(fullName.startsWith("java:app")) { contextServiceName = ContextNames.contextServiceNameOfApplication(resolutionContext.getApplicationName()); } else if (fullName.startsWith("java:module") || (fullName.startsWith("java:comp") && resolutionContext.isCompUsesModule())) { contextServiceName = ContextNames.contextServiceNameOfModule(resolutionContext.getApplicationName(), resolutionContext.getModuleName()); } else if(fullName.startsWith("java:comp")) { contextServiceName = ContextNames.contextServiceNameOfComponent(resolutionContext.getApplicationName(), resolutionContext.getModuleName(), resolutionContext.getComponentName()); } else { throw NamingLogger.ROOT_LOGGER.invalidNameForContextBinding(fullName); } serviceBuilder.addDependency(contextServiceName, NamingStore.class, managedReferenceFactory.getNamingStoreInjectedValue()); injector.inject(managedReferenceFactory); } }
final ServiceName moduleContextName = ContextNames.contextServiceNameOfModule(appName, moduleName); final ServiceController<?> moduleContextController = serviceRegistry.getService(moduleContextName); if (moduleContextController != null) {
/** * 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(); } }
final ServiceName moduleContextServiceName = ContextNames.contextServiceNameOfModule(moduleDescription.getApplicationName(), moduleDescription.getModuleName()); final NamingStoreService contextService = new NamingStoreService(true); serviceTarget.addService(moduleContextServiceName, contextService).install();
private void bindFactoryToJndi(LazyValidatorFactory factory, DeploymentUnit deploymentUnit, DeploymentPhaseContext phaseContext,EEModuleDescription moduleDescription) { 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) || DeploymentTypeMarker.isType(DeploymentType.APPLICATION_CLIENT, deploymentUnit)) { final ServiceName moduleContextServiceName = ContextNames.contextServiceNameOfModule(moduleDescription.getApplicationName(), moduleDescription.getModuleName()); bindServices(factory, serviceTarget, moduleDescription, moduleDescription.getModuleName(), moduleContextServiceName); } for(ComponentDescription component : moduleDescription.getComponentDescriptions()) { if(component.getNamingMode() == ComponentNamingMode.CREATE) { final ServiceName compContextServiceName = ContextNames.contextServiceNameOfComponent(moduleDescription.getApplicationName(),moduleDescription.getModuleName(),component.getComponentName()); bindServices(factory, serviceTarget, moduleDescription, component.getComponentName(), compContextServiceName); } } }
@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); } } }
@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) || DeploymentTypeMarker.isType(DeploymentType.APPLICATION_CLIENT, 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); } } }
final ServiceName moduleContextServiceName = ContextNames.contextServiceNameOfModule(moduleDescription.getApplicationName(), moduleDescription.getModuleName()); bindBeanManager(serviceTarget, beanManagerServiceName, moduleContextServiceName, dependencies, phaseContext.getServiceRegistry());
@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) || DeploymentTypeMarker.isType(DeploymentType.APPLICATION_CLIENT, 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); } } }
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final EEModuleDescription moduleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION); final Module module = deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.MODULE); if (moduleDescription == null) { return; } //do not bind if jacORB not present if (!IIOPDeploymentMarker.isIIOPDeployment(deploymentUnit)) { 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) || DeploymentTypeMarker.isType(DeploymentType.APPLICATION_CLIENT, deploymentUnit)) { final ServiceName moduleContextServiceName = ContextNames.contextServiceNameOfModule(moduleDescription.getApplicationName(), moduleDescription.getModuleName()); bindService(serviceTarget, moduleContextServiceName, module); } for (ComponentDescription component : moduleDescription.getComponentDescriptions()) { if (component.getNamingMode() == ComponentNamingMode.CREATE) { final ServiceName compContextServiceName = ContextNames.contextServiceNameOfComponent(moduleDescription.getApplicationName(), moduleDescription.getModuleName(), component.getComponentName()); bindService(serviceTarget, compContextServiceName, module); } } }
final String compName = configuration.getComponentName(); final ServiceName appContextServiceName = ContextNames.contextServiceNameOfApplication(applicationName); final ServiceName moduleContextServiceName = ContextNames.contextServiceNameOfModule(applicationName, moduleName); final ServiceName compContextServiceName = ContextNames.contextServiceNameOfComponent(applicationName, moduleName, compName); final Injector<NamingStore> appInjector = selector.getAppContextInjector();
@Override public void getResourceValue(final ResolutionContext resolutionContext, final ServiceBuilder<?> serviceBuilder, final DeploymentPhaseContext phaseContext, final Injector<ManagedReferenceFactory> injector) throws DeploymentUnitProcessingException { final ContextManagedReferenceFactory managedReferenceFactory = new ContextManagedReferenceFactory(name); final ServiceName contextServiceName; if(fullName.startsWith("java:app")) { contextServiceName = ContextNames.contextServiceNameOfApplication(resolutionContext.getApplicationName()); } else if (fullName.startsWith("java:module") || (fullName.startsWith("java:comp") && resolutionContext.isCompUsesModule())) { contextServiceName = ContextNames.contextServiceNameOfModule(resolutionContext.getApplicationName(), resolutionContext.getModuleName()); } else if(fullName.startsWith("java:comp")) { contextServiceName = ContextNames.contextServiceNameOfComponent(resolutionContext.getApplicationName(), resolutionContext.getModuleName(), resolutionContext.getComponentName()); } else { throw NamingLogger.ROOT_LOGGER.invalidNameForContextBinding(fullName); } serviceBuilder.addDependency(contextServiceName, NamingStore.class, managedReferenceFactory.getNamingStoreInjectedValue()); injector.inject(managedReferenceFactory); } }
@Override public void getResourceValue(final ResolutionContext resolutionContext, final ServiceBuilder<?> serviceBuilder, final DeploymentPhaseContext phaseContext, final Injector<ManagedReferenceFactory> injector) throws DeploymentUnitProcessingException { final ContextManagedReferenceFactory managedReferenceFactory = new ContextManagedReferenceFactory(name); final ServiceName contextServiceName; if(fullName.startsWith("java:app")) { contextServiceName = ContextNames.contextServiceNameOfApplication(resolutionContext.getApplicationName()); } else if (fullName.startsWith("java:module") || (fullName.startsWith("java:comp") && resolutionContext.isCompUsesModule())) { contextServiceName = ContextNames.contextServiceNameOfModule(resolutionContext.getApplicationName(), resolutionContext.getModuleName()); } else if(fullName.startsWith("java:comp")) { contextServiceName = ContextNames.contextServiceNameOfComponent(resolutionContext.getApplicationName(), resolutionContext.getModuleName(), resolutionContext.getComponentName()); } else { throw NamingMessages.MESSAGES.invalidNameForContextBinding(fullName); } serviceBuilder.addDependency(contextServiceName, NamingStore.class, managedReferenceFactory.getNamingStoreInjectedValue()); injector.inject(managedReferenceFactory); } }
@Override public void getResourceValue(final ResolutionContext resolutionContext, final ServiceBuilder<?> serviceBuilder, final DeploymentPhaseContext phaseContext, final Injector<ManagedReferenceFactory> injector) throws DeploymentUnitProcessingException { final ContextManagedReferenceFactory managedReferenceFactory = new ContextManagedReferenceFactory(name); final ServiceName contextServiceName; if(fullName.startsWith("java:app")) { contextServiceName = ContextNames.contextServiceNameOfApplication(resolutionContext.getApplicationName()); } else if (fullName.startsWith("java:module") || (fullName.startsWith("java:comp") && resolutionContext.isCompUsesModule())) { contextServiceName = ContextNames.contextServiceNameOfModule(resolutionContext.getApplicationName(), resolutionContext.getModuleName()); } else if(fullName.startsWith("java:comp")) { contextServiceName = ContextNames.contextServiceNameOfComponent(resolutionContext.getApplicationName(), resolutionContext.getModuleName(), resolutionContext.getComponentName()); } else { throw NamingLogger.ROOT_LOGGER.invalidNameForContextBinding(fullName); } serviceBuilder.addDependency(contextServiceName, NamingStore.class, managedReferenceFactory.getNamingStoreInjectedValue()); injector.inject(managedReferenceFactory); } }
/** * 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(); } }
/** * 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(); } }
/** * 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(); } }
private void bindFactoryToJndi(LazyValidatorFactory factory, DeploymentUnit deploymentUnit, DeploymentPhaseContext phaseContext,EEModuleDescription moduleDescription) { 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) || DeploymentTypeMarker.isType(DeploymentType.APPLICATION_CLIENT, deploymentUnit)) { final ServiceName moduleContextServiceName = ContextNames.contextServiceNameOfModule(moduleDescription.getApplicationName(), moduleDescription.getModuleName()); bindServices(factory, serviceTarget, moduleDescription, moduleDescription.getModuleName(), moduleContextServiceName); } for(ComponentDescription component : moduleDescription.getComponentDescriptions()) { if(component.getNamingMode() == ComponentNamingMode.CREATE) { final ServiceName compContextServiceName = ContextNames.contextServiceNameOfComponent(moduleDescription.getApplicationName(),moduleDescription.getModuleName(),component.getComponentName()); bindServices(factory, serviceTarget, moduleDescription, component.getComponentName(), compContextServiceName); } } }
private void bindFactoryToJndi(LazyValidatorFactory factory, DeploymentUnit deploymentUnit, DeploymentPhaseContext phaseContext,EEModuleDescription moduleDescription) { 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) || DeploymentTypeMarker.isType(DeploymentType.APPLICATION_CLIENT, deploymentUnit)) { final ServiceName moduleContextServiceName = ContextNames.contextServiceNameOfModule(moduleDescription.getApplicationName(), moduleDescription.getModuleName()); bindServices(factory, serviceTarget, moduleDescription, moduleDescription.getModuleName(), moduleContextServiceName); } for(ComponentDescription component : moduleDescription.getComponentDescriptions()) { if(component.getNamingMode() == ComponentNamingMode.CREATE) { final ServiceName compContextServiceName = ContextNames.contextServiceNameOfComponent(moduleDescription.getApplicationName(),moduleDescription.getModuleName(),component.getComponentName()); bindServices(factory, serviceTarget, moduleDescription, component.getComponentName(), compContextServiceName); } } }