{@inheritDoc}

@return
@throws InjectionException
187964
@Override
    public void registerInjectionTargetListener(WebSphereInjectionTargetListener<?> listener) {
        Object instance = listener.getObject();
        injectionTargetListeners.put(instance, listener);
    }
995699
@Override
    public <T> void aroundInject(final InjectionContext<T> injectionContext) {

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Annotations: " + injectionContext.getAnnotatedType());
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Perform EE injection.");
        }
        injectJavaEEResources(injectionContext);

        // perform Weld injection
        AccessController.doPrivileged(new PrivilegedAction<Void>() {
            @Override
            public Void run() {
                injectionContext.proceed();
                return null;
            }

        });

    }
231377
@Override
    public void processXML() throws InjectionException {

        @SuppressWarnings("unchecked")
        List<ServiceRef> serviceRefs = (List<ServiceRef>) ivNameSpaceConfig.getWebServiceRefs();

        // no need to do any work if there are no service refs in the XML
        if (serviceRefs == null || serviceRefs.isEmpty()) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "No service-refs in XML for module: " + ivNameSpaceConfig.getModuleName());
            }
            return;
        }

        ClassLoader moduleClassLoader = ivNameSpaceConfig.getClassLoader();

        if (moduleClassLoader == null) {
            throw new InjectionException("Internal Error: The classloader of module " + ivNameSpaceConfig.getModuleName() + " is null.");
        }

        // get all JAX-WS service refs from deployment descriptor
        List<ServiceRef> jaxwsServiceRefs = InjectionHelper.normalizeJaxWsServiceRefs(serviceRefs, moduleClassLoader);

        if (jaxwsServiceRefs.isEmpty()) {
            return;
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Found JAX-WS service refs in XML for module: " + ivNameSpaceConfig.getModuleName());
        }

        // build up the metadata and create WebServiceRefBinding instances that will be used by the injection engine, 
        // then we will be saving off this metadata in the module or component metadata slot for later use by our ServiceRefObjectFactory
        List<InjectionBinding<WebServiceRef>> bindingList = WebServiceRefBindingBuilder.buildJaxWsWebServiceRefBindings(jaxwsServiceRefs, ivNameSpaceConfig);

        // now add all the bindings that were created
        if (bindingList != null && !bindingList.isEmpty()) {
            for (InjectionBinding<WebServiceRef> binding : bindingList) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "Adding binding for JAX-WS service-ref: " + binding.getJndiName());
                }
                addInjectionBinding(binding);
            }
        }

    }
574857
@Override
    public InjectionBinding<ConnectionFactoryDefinition> createInjectionBinding(ConnectionFactoryDefinition annotation, Class<?> instanceClass, Member member, String jndiName) throws InjectionException {
        InjectionBinding<ConnectionFactoryDefinition> injectionBinding =
                        new ConnectionFactoryDefinitionInjectionBinding(jndiName, ivNameSpaceConfig);
        injectionBinding.merge(annotation, instanceClass, null);
        return injectionBinding;
    }
297920
@Override
    public InjectionBinding<WebServiceRef> createOverrideInjectionBinding(Class<?> instanceClass, Member member,
                                                                          Resource resource, String jndiName) throws InjectionException {

        Class<?> typeClass = resource.type();

        if (member != null) {
            Class<?> inferredType = InjectionHelper.getTypeFromMember(member);
            if (typeClass.getName().equals(Object.class.getName())) { //default
                typeClass = inferredType;
            } else {
                if (!inferredType.isAssignableFrom(typeClass)) {
                    Tr.error(tc, "error.service.ref.member.level.annotation.type.not.compatible",
                             member.getName(), member.getDeclaringClass().getName(), typeClass.getName(), inferredType.getName());
                    throw new InjectionException(Tr.formatMessage(tc, "error.service.ref.member.level.annotation.type.not.compatible",
                                                                  member.getName(), member.getDeclaringClass().getName(), typeClass.getName(), inferredType.getName()));
                }
            }
        }

        InjectionBinding<WebServiceRef> binding;

        //only service type injections are possible with the @Resource annotation
        if (Service.class.isAssignableFrom(typeClass)) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "The @Resource annotation found has type=" + typeClass.getName() + " and is refers to a JAX-WS service reference");
            }
            binding = WebServiceRefBindingBuilder.createWebServiceRefBindingFromResource(resource, ivNameSpaceConfig, typeClass, jndiName);
        } else {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "The @Resource annotation found did not refer to a web service reference type.");
            }
            binding = null;
        }

        return binding;
    }
1247027
@Override
    protected InjectionPoint getInjectionPoint(InvokeInstruction invoke, ConstantPoolGen cpg,
                                               InstructionHandle handle) {
        assert invoke != null && cpg != null;

        //ByteCode.printOpCode(invoke,cpg);

        if(CIPHER_GET_INSTANCE.matches(invoke,cpg)) {
            return new InjectionPoint(new int[]{0}, getBugPattern());
        }
        else if(CIPHER_GET_INSTANCE_PROVIDER.matches(invoke,cpg)) {
            return new InjectionPoint(new int[]{1}, getBugPattern());
        }
        else if(KEYGENERATOR_GET_INSTANCE.matches(invoke,cpg)) {
            return new InjectionPoint(new int[]{0}, getBugPattern());
        }
        else if(KEYGENERATOR_GET_INSTANCE_PROVIDER.matches(invoke,cpg)) {
            return new InjectionPoint(new int[]{1}, getBugPattern());
        }
        return InjectionPoint.NONE;
    }
708220
public static DriverLauncher getLauncher(final Configuration runtimeConfiguration) throws InjectionException {
    return Tang.Factory.getTang()
        .newInjector(runtimeConfiguration, CLIENT_CONFIG)
        .getInstance(DriverLauncher.class);
  }
438231
public static void injectWith(Class<InjectionProvider> provider) {

		try {
			injectionProvider = (InjectionProvider) ClassFactory.newInstanceOf(provider);
			log.info("Registered injection provider: " + injectionProvider.getClass().getName());
		}
		catch (ClassFactoryException e) {
			log.error("Failed to instantiate injection provider: ", e);
			throw new IllegalArgumentException(e);
		}
	}
307574
private static Object injectAndPostConstruct(Object injectionProvider, Class Klass, List injectedBeanStorage)
    {
        Object instance = null;
        if (injectionProvider != null)
        {
            try
            {

                Object managedObject = _FactoryFinderProviderFactory.INJECTION_PROVIDER_INJECT_CLASS_METHOD.invoke(injectionProvider, Klass);

                instance = _FactoryFinderProviderFactory.MANAGED_OBJECT_GET_OBJECT_METHOD.invoke(managedObject, null);

                if (instance != null) {

                    Object creationMetaData = _FactoryFinderProviderFactory.MANAGED_OBJECT_GET_CONTEXT_DATA_METHOD.invoke
                                    (managedObject, CreationalContext.class);

                    addBeanEntry(instance, creationMetaData, injectedBeanStorage);

                    _FactoryFinderProviderFactory.INJECTION_PROVIDER_POST_CONSTRUCT_METHOD.invoke(
                                                                                                  injectionProvider, instance, creationMetaData);
                }
            } catch (Exception ex)
            {
                throw new FacesException(ex);
            }
        }
        return instance;
    }
145838
@Sensitive
    @Override
    public InjectionBinding<MailSessionDefinition> createInjectionBinding(@Sensitive MailSessionDefinition annotation, Class<?> instanceClass, Member member, String jndiName) throws InjectionException {
        InjectionBinding<MailSessionDefinition> injectionBinding =
                        new MailSessionDefinitionInjectionBinding(jndiName, ivNameSpaceConfig);
        injectionBinding.merge(annotation, instanceClass, null);
        return injectionBinding;
    }
339965
public InjectionBinding<?> getInjectionBinding(NamingConstants.JavaColonNamespace namespace, String name) throws NamingException {
        if (namespace == NamingConstants.JavaColonNamespace.COMP) {
            return lookup(compLock, compBindings, name);
        }
        if (namespace == NamingConstants.JavaColonNamespace.COMP_ENV) {
            return lookup(compLock, compEnvBindings, name);
        }
        if (namespace == this.namespace) {
            NonCompBinding nonCompBinding = lookup(nonCompEnvLock, nonCompBindings, name);
            return nonCompBinding == null ? null : nonCompBinding.binding;
        }
        return null;
    }
941601
public function inject($injectable)
    {
        $func = new Func($injectable);
        $args = $this->resolveFuncArgs($func);

        return $func->invoke($args);
    }
374328
public static <T> Releasable<T> inject(final Class<T> clazz) {
        try {
            final BeanManager beanManager = CDI.current().getBeanManager();
            if (beanManager == null) {
                return null;
            }
            final AnnotatedType<T> annotatedType = beanManager.createAnnotatedType(clazz);
            final InjectionTarget<T> it = beanManager.createInjectionTarget(annotatedType);
            final CreationalContext<T> context = beanManager.createCreationalContext(null);
            final T instance = it.produce(context);
            it.inject(instance, context);
            it.postConstruct(instance);

            return new Releasable<T>(context, it, instance);
        } catch (final Exception e) {
            // no-op
        } catch (final NoClassDefFoundError error) {
            // no-op
        }
        return null;
    }
858762
static WebServiceRef createWebServiceRefFromResource(Resource resource, Class<?> typeClass, String jndiName) throws InjectionException {
        // notice we send in 'Service.class' for the 'value' attribute, this is
        // because only service type injections are possible with the @Resource
        // annotation, so we'll use the default value for the 'value' attribute.
        return new WebServiceRefSimulator(resource.mappedName(), jndiName, typeClass, Service.class, null, "");
    }
330236
private void initializeInjector(final Injector runtimeInjector) throws InjectionException {

    copyEventHandler(runtimeInjector, RuntimeParameters.ResourceStatusHandler.class);
    copyEventHandler(runtimeInjector, RuntimeParameters.NodeDescriptorHandler.class);
    copyEventHandler(runtimeInjector, RuntimeParameters.ResourceAllocationHandler.class);
    copyEventHandler(runtimeInjector, RuntimeParameters.RuntimeStatusHandler.class);

    try {
      runtimeInjector.bindVolatileInstance(HttpServer.class, this.originalInjector.getInstance(HttpServer.class));
      LOG.log(Level.INFO, "Binding http server for the runtime implementation");
    } catch (final InjectionException e) {
      LOG.log(Level.INFO, "Http Server is not configured for the runtime", e);
    }
  }
927058
protected Object getInjectedObjectFromCXF(Class<?> classType,
                                              Type genericType,
                                              Annotation[] memberAnnotations,
                                              ParamInjectionMetadata paramInjectionMetadata) {
        Parameter p = ResourceUtils.getParameter(0, memberAnnotations, classType);
        Object injectedObject = null;

        Message message = paramInjectionMetadata.getInMessage();
        OperationResourceInfo ori = paramInjectionMetadata.getOperationResourceInfo();
        BeanResourceInfo cri = ori.getClassResourceInfo();
        MultivaluedMap<String, String> values = (MultivaluedMap<String, String>) message.get(URITemplate.TEMPLATE_PARAMETERS);
        if (p.getType() == ParameterType.BEAN && cri instanceof ClassResourceInfo) {
            injectedObject = JAXRSUtils.createBeanParamValue(message, classType, ori);
        } else {
            injectedObject = JAXRSUtils.createHttpParameterValue(p,
                                                                 classType,
                                                                 genericType,
                                                                 memberAnnotations,
                                                                 message,
                                                                 values,
                                                                 ori);
        }
        return injectedObject;
    }
543885
private function getInjector(\ReflectionClass $reflection): InjectorInterface
    {
        if (isset($this->injectors[$reflection->getName()])) {
            //Stated directly
            $injector = $this->get($this->injectors[$reflection->getName()]);
        } else {
            //Auto-injection!
            $injector = $this->get($reflection->getConstant('INJECTOR'));
        }

        if (!$injector instanceof InjectorInterface) {
            throw new InjectionException(sprintf(
                "Class '%s' must be an instance of InjectorInterface for '%s'",
                get_class($injector),
                $reflection->getName()
            ));
        }

        return $injector;
    }