return new BindInfo(contextServiceNameOfApplication(app), context.substring(9)); } else if (namespace.equals("module")) { return new BindInfo(contextServiceNameOfModule(app, module), context.substring(12));
@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); } }
/** * 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); }
final ServiceName appContextName = ContextNames.contextServiceNameOfApplication(appName); final ServiceController<?> appContextController = serviceRegistry.getService(appContextName); if (appContextController != null) {
final ServiceTarget serviceTarget = phaseContext.getServiceTarget(); final ServiceName appContextServiceName = ContextNames.contextServiceNameOfApplication(moduleDescription.getApplicationName()); final ServiceName moduleContextServiceName = ContextNames.contextServiceNameOfModule(moduleDescription.getApplicationName(), moduleDescription.getModuleName()); final NamingStoreService contextService = new NamingStoreService(true);
final String moduleName = configuration.getModuleName(); 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);
return new BindInfo(contextServiceNameOfApplication(app), context.substring(9)); } else if (namespace.equals("module")) { return new BindInfo(contextServiceNameOfModule(app, module), context.substring(12));
@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); } }
/** * Add a ContextService for this module. * * @param phaseContext the deployment unit context * @throws org.jboss.as.server.deployment.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(); serviceTarget.addService(applicationContextServiceName, contextService).install(); final BinderService applicationNameBinder = new BinderService("AppName"); final ServiceName appNameServiceName = applicationContextServiceName.append("AppName"); serviceTarget.addService(appNameServiceName, applicationNameBinder) .addDependency(applicationContextServiceName, ServiceBasedNamingStore.class, applicationNameBinder.getNamingStoreInjector()) .addInjection(applicationNameBinder.getManagedObjectInjector(), new ValueManagedReferenceFactory(Values.immediateValue(moduleDescription.getApplicationName()))) .install(); deploymentUnit.addToAttachmentList(org.jboss.as.server.deployment.Attachments.JNDI_DEPENDENCIES,appNameServiceName); deploymentUnit.putAttachment(Attachments.APPLICATION_CONTEXT_CONFIG, applicationContextServiceName); }
/** * 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); }
/** * 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 BinderService applicationNameBinder = new BinderService("AppName"); final ServiceName appNameServiceName = applicationContextServiceName.append("AppName"); serviceTarget.addService(appNameServiceName, applicationNameBinder) .addDependency(applicationContextServiceName, ServiceBasedNamingStore.class, applicationNameBinder.getNamingStoreInjector()) .addInjection(applicationNameBinder.getManagedObjectInjector(), new ValueManagedReferenceFactory(Values.immediateValue(moduleDescription.getApplicationName()))) .install(); deploymentUnit.addToAttachmentList(org.jboss.as.server.deployment.Attachments.JNDI_DEPENDENCIES, appNameServiceName); deploymentUnit.putAttachment(Attachments.APPLICATION_CONTEXT_CONFIG, applicationContextServiceName); }
final ServiceName appContextName = ContextNames.contextServiceNameOfApplication(appName); final ServiceController<?> appContextController = serviceRegistry.getService(appContextName); if (appContextController != null) {
final ServiceName appContextName = ContextNames.contextServiceNameOfApplication(appName); final ServiceController<?> appContextController = serviceRegistry.getService(appContextName); if (appContextController != null) {
final ServiceName appContextName = ContextNames.contextServiceNameOfApplication(appName); final ServiceController<?> appContextController = serviceRegistry.getService(appContextName); if (appContextController != null) {
final ServiceTarget serviceTarget = phaseContext.getServiceTarget(); final ServiceName appContextServiceName = ContextNames.contextServiceNameOfApplication(moduleDescription.getApplicationName()); final ServiceName moduleContextServiceName = ContextNames.contextServiceNameOfModule(moduleDescription.getApplicationName(), moduleDescription.getModuleName()); final NamingStoreService contextService = new NamingStoreService();
final ServiceTarget serviceTarget = phaseContext.getServiceTarget(); final ServiceName appContextServiceName = ContextNames.contextServiceNameOfApplication(moduleDescription.getApplicationName()); final ServiceName moduleContextServiceName = ContextNames.contextServiceNameOfModule(moduleDescription.getApplicationName(), moduleDescription.getModuleName()); final NamingStoreService contextService = new NamingStoreService(true);
final ServiceTarget serviceTarget = phaseContext.getServiceTarget(); final ServiceName appContextServiceName = ContextNames.contextServiceNameOfApplication(moduleDescription.getApplicationName()); final ServiceName moduleContextServiceName = ContextNames.contextServiceNameOfModule(moduleDescription.getApplicationName(), moduleDescription.getModuleName()); final NamingStoreService contextService = new NamingStoreService(true);
final String moduleName = configuration.getModuleName(); 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);