private String uniqueName(ResolutionContext context, final String jndiName) { StringBuilder name = new StringBuilder(); name.append(context.getApplicationName() + "_"); name.append(context.getModuleName() + "_"); if (context.getComponentName() != null) { name.append(context.getComponentName() + "_"); } name.append(jndiName); return name.toString(); }
public void getResourceValue(final ResolutionContext resolutionContext, final ServiceBuilder<?> serviceBuilder, final DeploymentPhaseContext phaseContext, final Injector<ManagedReferenceFactory> injector) throws DeploymentUnitProcessingException { if (error != null) { throw new DeploymentUnitProcessingException(error); } final String applicationName = resolutionContext.getApplicationName(); final String moduleName = resolutionContext.getModuleName(); final String componentName = resolutionContext.getComponentName(); final boolean compUsesModule = resolutionContext.isCompUsesModule(); final String lookupName; if (!this.resolvedLookupName.contains(":")) { if (componentName != null && !compUsesModule) { lookupName = "java:comp/env/" + this.resolvedLookupName; } else if (compUsesModule) { lookupName = "java:module/env/" + this.resolvedLookupName; } else { lookupName = "java:jboss/env" + this.resolvedLookupName; } } else if (this.resolvedLookupName.startsWith("java:comp/") && compUsesModule) { lookupName = "java:module/" + this.resolvedLookupName.substring(10); } else { lookupName = this.resolvedLookupName; } final ContextNames.BindInfo bindInfo = ContextNames.bindInfoFor(applicationName, moduleName, componentName, lookupName); if (lookupName.startsWith("java:")) { serviceBuilder.addDependency(bindInfo.getBinderServiceName(), ManagedReferenceFactory.class, injector); } }
@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); } }
/** * {@inheritDoc} */ public void getResourceValue(final ResolutionContext resolutionContext, final ServiceBuilder<?> serviceBuilder, final DeploymentPhaseContext phaseContext, final Injector<ManagedReferenceFactory> injector) { final String applicationName = resolutionContext.getApplicationName(); final String moduleName = resolutionContext.getModuleName(); final String componentName = resolutionContext.getComponentName(); final boolean compUsesModule = resolutionContext.isCompUsesModule(); final String lookupName; if (!this.lookupName.contains("java:")) { if (componentName != null && !compUsesModule) { lookupName = "java:comp/env/" + this.lookupName; } else if (compUsesModule) { lookupName = "java:module/env/" + this.lookupName; } else { lookupName = "java:jboss/env" + this.lookupName; } } else if (this.lookupName.startsWith("java:comp/") && compUsesModule) { lookupName = "java:module/" + this.lookupName.substring(10); } else { lookupName = this.lookupName; } final ContextNames.BindInfo bindInfo = ContextNames.bindInfoFor(applicationName, moduleName, componentName, lookupName); serviceBuilder.addDependency(bindInfo.getBinderServiceName(), ManagedReferenceFactory.class, injector); }
/** * {@inheritDoc} */ public void getResourceValue(final ResolutionContext resolutionContext, final ServiceBuilder<?> serviceBuilder, final DeploymentPhaseContext phaseContext, final Injector<ManagedReferenceFactory> injector) { final String applicationName = resolutionContext.getApplicationName(); final String moduleName = resolutionContext.getModuleName(); final String componentName = resolutionContext.getComponentName(); final boolean compUsesModule = resolutionContext.isCompUsesModule(); final String lookupName; if (!this.lookupName.contains("java:")) { if (componentName != null && !compUsesModule) { lookupName = "java:comp/env/" + this.lookupName; } else if (compUsesModule) { lookupName = "java:module/env/" + this.lookupName; } else { lookupName = "java:jboss/env" + this.lookupName; } } else if (this.lookupName.startsWith("java:comp/") && compUsesModule) { lookupName = "java:module/" + this.lookupName.substring(10); } else { lookupName = this.lookupName; } final ContextNames.BindInfo bindInfo = ContextNames.bindInfoFor(applicationName, moduleName, componentName, lookupName); serviceBuilder.addDependency(ServiceBuilder.DependencyType.OPTIONAL, bindInfo.getBinderServiceName()); injector.inject(new OptionalLookupManagedReferenceFactory(lookupName)); }
@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); } }
private String uniqueName(InjectionSource.ResolutionContext context) { if (destinationName != null && !destinationName.isEmpty()) { return destinationName; } StringBuilder uniqueName = new StringBuilder(); uniqueName.append(context.getApplicationName() + "_"); uniqueName.append(context.getModuleName() + "_"); if (context.getComponentName() != null) { uniqueName.append(context.getComponentName() + "_"); } uniqueName.append(jndiName); return uniqueName.toString(); }
private String uniqueName(InjectionSource.ResolutionContext context) { if (destinationName != null && !destinationName.isEmpty()) { return destinationName; } StringBuilder uniqueName = new StringBuilder(); uniqueName.append(context.getApplicationName() + "_"); uniqueName.append(context.getModuleName() + "_"); if (context.getComponentName() != null) { uniqueName.append(context.getComponentName() + "_"); } uniqueName.append(jndiName); return uniqueName.toString(); }
private String uniqueName(ResolutionContext context, final String jndiName) { StringBuilder name = new StringBuilder(); name.append(context.getApplicationName() + "_"); name.append(context.getModuleName() + "_"); if (context.getComponentName() != null) { name.append(context.getComponentName() + "_"); } name.append(jndiName); return name.toString(); }
private static String managementName(InjectionSource.ResolutionContext context, final String jndiName) { StringBuilder uniqueName = new StringBuilder(); uniqueName.append(context.getModuleName() + "_"); if (context.getComponentName() != null) { uniqueName.append(context.getComponentName() + "_"); } return uniqueName .append(jndiName.replace(':', '_')) .toString(); }
private String uniqueName(ResolutionContext context, final String jndiName) { StringBuilder name = new StringBuilder(); name.append(context.getApplicationName() + "_"); name.append(context.getModuleName() + "_"); if (context.getComponentName() != null) { name.append(context.getComponentName() + "_"); } name.append(jndiName); return name.toString(); }
private static String managementName(InjectionSource.ResolutionContext context, final String jndiName) { StringBuilder uniqueName = new StringBuilder(); uniqueName.append(context.getModuleName() + "_"); if (context.getComponentName() != null) { uniqueName.append(context.getComponentName() + "_"); } return uniqueName .append(jndiName.replace(':', '_')) .toString(); }
dataSourceConfiguration.connectionPoolConfiguration(connectionPoolConfiguration); ContextNames.BindInfo bindInfo = ContextNames.bindInfoForEnvEntry(context.getApplicationName(), context.getModuleName(), context.getComponentName(), !context.isCompUsesModule(), jndiName); ServiceName dataSourceServiceName = DATASOURCE_DEFINITION_SERVICE_PREFIX.append(bindInfo.getBinderServiceName().getCanonicalName());
final String moduleName = resolutionContext.getModuleName(); final String componentName = resolutionContext.getComponentName(); final boolean compUsesModule = resolutionContext.isCompUsesModule();
ContextNames.BindInfo bindInfo = ContextNames.bindInfoForEnvEntry(context.getApplicationName(), context.getModuleName(), context.getComponentName(), !context.isCompUsesModule(), jndiName);
final EEModuleDescription eeModuleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION); final String poolName = uniqueName(context, jndiName); final ContextNames.BindInfo bindInfo = ContextNames.bindInfoForEnvEntry(context.getApplicationName(), context.getModuleName(), context.getComponentName(), !context.isCompUsesModule(), jndiName); final DeploymentReflectionIndex reflectionIndex = deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.REFLECTION_INDEX); try {
.addService(mailSessionServiceName, mailSessionService); final ContextNames.BindInfo bindInfo = ContextNames.bindInfoForEnvEntry(context.getApplicationName(), context.getModuleName(), context.getComponentName(), !context.isCompUsesModule(), jndiName); final BinderService binderService = new BinderService(bindInfo.getBindName(), this); binderService.getManagedObjectInjector().inject(new MailSessionManagedReferenceFactory(mailSessionService));
ContextNames.BindInfo bindInfo = ContextNames.bindInfoForEnvEntry(context.getApplicationName(), context.getModuleName(), context.getComponentName(), !context.isCompUsesModule(), jndiName);