// EJB Services is registered as a top-level service
deploymentImpl.getServices().add(EjbServices.class, ejbServices);
}
BeanDeploymentArchive bda = deploymentImpl.getBeanDeploymentArchiveForArchive(archive.getName());
WebBundleDescriptor wDesc = context.getModuleMetaData(WebBundleDescriptor.class);
if( wDesc != null) {
wDesc.setExtensionProperty(WELD_EXTENSION, "true");
// Add the Weld Listener if it does not already exist..
wDesc.addAppListenerDescriptor(new AppListenerDescriptorImpl(WELD_LISTENER));
// Add Weld Context Listener - this listener will ensure the WeldELContextListener is used
// for JSP's..
wDesc.addAppListenerDescriptor(new AppListenerDescriptorImpl(WELD_CONTEXT_LISTENER));
}
BundleDescriptor bundle = (wDesc != null) ? wDesc : ejbBundle;
if( bundle != null ) {
// Register EE injection manager at the bean deployment archive level.
// We use the generic InjectionService service to handle all EE-style
// injection instead of the per-dependency-type InjectionPoint approach.
// Each InjectionServicesImpl instance knows its associated GlassFish bundle.
InjectionManager injectionMgr = services.getService(InjectionManager.class);
InjectionServices injectionServices = new InjectionServicesImpl(injectionMgr, bundle);
if(_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, "WeldDeployer:: Adding injectionServices "
+ injectionServices + " for " + bda.getId());
}
bda.getServices().add(InjectionServices.class, injectionServices);
if (bda.getBeanDeploymentArchives().size() != 0) {
//Relevant in WAR BDA - WEB-INF/lib BDA scenarios
for(BeanDeploymentArchive subBda: bda.getBeanDeploymentArchives()){
if(_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, "WeldDeployer:: Adding injectionServices "
+ injectionServices + " for " + subBda.getId());
}
subBda.getServices().add(InjectionServices.class, injectionServices);