<p>Performs <b>dependency injection</b> by invoking {@link InjectionUtils#inject()}.</p>
487969
@Override
	public void onViewCreated(View view, Bundle savedInstanceState) {
		
		super.onViewCreated(view, savedInstanceState);
		InjectionUtils.inject(INJECTOR_CONFIGURATION);
	}
564783
public void doInvocationCollaboratorsPreInvoke(IInvocationCollaborator[] webAppInvocationCollaborators,
            com.ibm.wsspi.webcontainer.metadata.WebComponentMetaData cmd) {

    }
420986
public final void addInjectionBinding(InjectionBinding<A> injectionBinding)
    {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isDebugEnabled())
            Tr.debug(tc, "addInjectionBinding: " + injectionBinding);

        // jndi name not found in collection, simple add
        ivAllAnnotationsCollection.put(injectionBinding.getJndiName(), injectionBinding);
    }
737628
@Override
    public void processXML() throws InjectionException {

        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(tc, "processXML : " + this);

        List<? extends AdministeredObject> administeredObjectDefinitions = ivNameSpaceConfig.getJNDIEnvironmentRefs(AdministeredObject.class);

        if (administeredObjectDefinitions != null)
        {
            for (AdministeredObject administeredObject : administeredObjectDefinitions)
            {
                String jndiName = administeredObject.getName();
                InjectionBinding<AdministeredObjectDefinition> injectionBinding = ivAllAnnotationsCollection.get(jndiName);
                AdministeredObjectDefinitionInjectionBinding binding;

                if (injectionBinding != null)
                {
                    binding = (AdministeredObjectDefinitionInjectionBinding) injectionBinding;
                }
                else
                {
                    binding = new AdministeredObjectDefinitionInjectionBinding(jndiName, ivNameSpaceConfig);
                    addInjectionBinding(binding);
                }

                binding.mergeXML(administeredObject);
            }
        }

        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(tc, "processXML : " + this);

    }
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);
		}
	}
274872
public void initializeAll(InjectionManager injectionManager) {
        if (injectionManager != null) {
            for (Converter<?> converter : _converters) {
                Field[] fields = ReflectionUtils.getFields(converter.getClass(), Inject.class);
                for (Field field : fields) {
                    final Object value;
                    if (field.getType() == Converter.class) {
                        // Injected converters are used as callbacks. They
                        // should be assigned to the outer converter, which is
                        // this.
                        value = this;
                    } else {
                        InjectionPoint<Object> injectionPoint = new MemberInjectionPoint<Object>(field, converter);
                        value = injectionManager.getInstance(injectionPoint);
                    }
                    field.setAccessible(true);
                    try {
                        field.set(converter, value);
                    } catch (Exception e) {
                        throw new IllegalStateException("Could not initialize converter: " + converter, e);
                    }
                }
            }
        }
    }
1148321
@Override
  public <T> void inject(T bean, String prefix)
  {
    Objects.requireNonNull(bean);

    ConfigStub stub = new ConfigStub(bean.getClass(), prefix);

    stub.inject(bean, this);
  }
905254
private void injectCache(IntConsumer cacheAware) {
      if (cacheAware instanceof CacheAware) {
         ((CacheAware) cacheAware).injectCache(registry.getComponent(Cache.class));
      }
   }
1161174
@Override
    public void processXML() throws InjectionException
    {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(tc, "processXML : " + ivNameSpaceConfig.getPersistenceUnitRefs());

        // d416151.3 Begins
        List<? extends PersistenceUnitRef> pUnitRefs = ivNameSpaceConfig.getPersistenceUnitRefs();
        if (pUnitRefs != null && pUnitRefs.size() > 0)
        {
            for (PersistenceUnitRef pUnitRef : pUnitRefs)
            {
                if (isTraceOn && tc.isDebugEnabled())
                    Tr.debug(tc, " pUnitRef = " + pUnitRef);

                // If XML has previously been read and an injection binding with the same
                // jndi name has been created, get the current injection binding and merge
                // the new PersistenceUnit Ref into it.
                String jndiName = pUnitRef.getName();
                InjectionBinding<PersistenceUnit> injectionBinding = ivAllAnnotationsCollection.get(jndiName);
                if (injectionBinding != null)
                {
                    ((JPAPUnitInjectionBinding) injectionBinding).merge(pUnitRef);
                }
                else
                {
                    injectionBinding = new JPAPUnitInjectionBinding(pUnitRef, ivNameSpaceConfig); // d662814
                    addInjectionBinding(injectionBinding);
                }

                ((AbstractJPAInjectionBinding<?>) injectionBinding).addRefComponents(jndiName); // F743-30682

                // Process any injection-targets that may be specified.    d429866.1
                // The code takes into account the possibility of duplicate InjectionTargets
                // and will only add if not already present, regardless of whether this is
                // a newly created binding, or a second one being merged.
                List<InjectionTarget> targets = pUnitRef.getInjectionTargets();
                if (targets != null && !targets.isEmpty())
                {
                    for (InjectionTarget target : targets)
                    {
                        String injectionClassName = target.getInjectionTargetClassName();
                        String injectionName = target.getInjectionTargetName();
                        injectionBinding.addInjectionTarget(EntityManagerFactory.class, injectionName, injectionClassName);
                    }
                }
            }
        }
        // d416151.3 Ends
        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(tc, "processXML : " + ivAllAnnotationsCollection.size());
    }
463378
public void setInjectionOptions(final InjectionOptions injectionOptions) {
        if (injectionOptions == null && this.injectionOptions == null) {
            return;
        } else if (injectionOptions == null) {
            removeChild(this.injectionOptions);
            this.injectionOptions = null;
        } else if (this.injectionOptions == null) {
            this.injectionOptions = new KeyValueNode<InjectionOptions>(CommonConstants.CS_INLINE_INJECTION_TITLE, injectionOptions);
            appendChild(this.injectionOptions, false);
        } else {
            this.injectionOptions.setValue(injectionOptions);
        }
    }
536004
public static void injectWith(InjectionProvider provider) {

		injectionProvider = provider;
		if (injectionProvider != null) {
			log.info("Registered injection provider: " + injectionProvider.getClass().getName());
		}
	}
1002928
public <T, K extends T> void alias(Class<T> abstraction, Class<K> implementation) {
        injectorConfiguration = injectorConfiguration.withAlias(abstraction, implementation);
    }
1308635
@Override
   public void onEndpointInstantiated(final Endpoint endpoint, final Invocation invocation)
   {
      final Object _targetBean = this.getTargetBean(invocation);
      // TODO: refactor injection to AS IL
      final Reference reference = endpoint.getInstanceProvider().getInstance(_targetBean.getClass().getName());
      final Object targetBean = reference.getValue();

      InjectionHelper.injectWebServiceContext(targetBean, ThreadLocalAwareWebServiceContext.getInstance());

      if (!reference.isInitialized())
      {
         InjectionHelper.callPostConstructMethod(targetBean);
         reference.setInitialized();
      }

      endpoint.addAttachment(PreDestroyHolder.class, new PreDestroyHolder(targetBean));
   }
761039
public static void inject(Object... objects) {
        try {
            for (Object object : objects) {
                Class clazz = object.getClass();
                for (Field field : ReflectionHelper.getFields(clazz)) {
                    if (field.isAnnotationPresent(InjectHere.class)) {
                        qualifiers.clear();
                        for (Annotation annotation : field.getAnnotations()) {
                            if (annotation.annotationType().isAnnotationPresent(Qualifier.class)) {
                                qualifiers.add(annotation.annotationType().getCanonicalName());
                            }
                        }
                        field.setAccessible(true);
                        field.set(object, dependencyContainer.get(DependencyIdentifier
                                .getDependencyIdentifierForClass(field, qualifiers)));
                    }
                }
            }
        } catch (Exception e) {
            throw new AvicennaRuntimeException(e);
        }
    }
25534
@Override
    public ResourceReferenceFactory<Object> registerResourceInjectionPoint(final InjectionPoint injectionPoint) {
        return new ResourceReferenceFactory<Object>() {
            @Override
            public ResourceReference<Object> createResource() {
                return new SimpleResourceReference<Object>(resolveResource(injectionPoint));
            }
        };
    }
51390
@Override
    protected void initialize(boolean reactivate) throws RemoteException, InvocationTargetException {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled()) {
            Tr.entry(tc, "initialize");
        }

        BeanMetaData bmd = home.beanMetaData;
        ivCallbackKind = bmd.ivCallbackKind;

        state = PRE_CREATE; // d159152

        CallbackContextHelper contextHelper = new CallbackContextHelper(this); // d630940
        try {
            // Disallow setRollbackOnly until create is done.
            allowRollbackOnly = false;

            // Set the BeanId for this MDB. Just like we do for SLSB,
            // we use the BeanId for the home bean so that the same ID
            // is used for all MDB instances. Note the ivStatelessId is
            // for the home bean, which is implemented as a SLSB.
            if (home != null) {
                setId(home.ivStatelessId); // d140003.12
            }

            // Note that the local transaction surrounds injection methods and
            // PostConstruct lifecycle callbacks.
            contextHelper.begin(CallbackContextHelper.Tx.CompatLTC,
                                CallbackContextHelper.Contexts.CallbackBean); // d630940

            InterceptorMetaData imd = bmd.ivInterceptorMetaData;
            createInterceptorsAndInstance(contextHelper);

            // Now set the MessageDrivenContext and/or do the dependency injection.
            // Note that dependency injection must occur while in PRE_CREATE state.
            injectInstance(ivManagedObject, ivEjbInstance, this);

            //---------------------------------------------------------
            // Now that the MessageDrivenContext is set and/or dependencies
            // injection has occured, change state to CREATING state to allow
            // additional methods to be called by the ejbCreate or
            // PostConstruct interceptor methods (e.g. getEJBObject).
            //---------------------------------------------------------
            setState(CREATING); //d399469.2

            // Determine of life cycle callback to make if any.
            if (ivCallbackKind == CallbackKind.MessageDrivenBean) {
                Method m = bmd.ivEjbCreateMethod; //d453778
                if (m != null) //d453778
                {
                    // This is a 2.x MDB that has a ejbCreate method in it.
                    try {
                        if (isTraceOn && // d527372
                            TEBeanLifeCycleInfo.isTraceEnabled()) {
                            TEBeanLifeCycleInfo.traceEJBCallEntry("ejbCreate");
                        }
                        m.invoke(ivEjbInstance, new Object[] {});
                    } catch (InvocationTargetException itex) {
                        //FFDCFilter.processException(itex, CLASS_NAME + ".MessageDrivenBeanO", "96", this);

                        // All exceptions returned through a reflect method call
                        // are wrapped... making it difficult to debug a problem
                        // since InovcationTargetException does not print the root
                        // exception. Unwrap the 'target' exception so that the
                        // client will see it as the cause of the
                        // CreateFailureException.                        d534353.1
                        Throwable targetEx = itex.getCause();
                        if (targetEx == null)
                            targetEx = itex;

                        // MDB 2.x is allowed to throw application exceptions as well as
                        // javax.ejb.CreateException. Continue to wrap with a CreateFailureException
                        // to ensure no behavior change with prior releases.
                        if (isTraceOn && tc.isDebugEnabled()) {
                            Tr.debug(tc, "MDB ejbCreate failure", targetEx);
                        }
                        throw new CreateFailureException(targetEx);
                    } catch (Throwable ex) {
                        //FFDCFilter.processException(ex, CLASS_NAME + ".MessageDrivenBeanO", "96", this);

                        // MDB 2.x is allowed to throw application exceptions as well as
                        // javax.ejb.CreateException. Continue to wrap with a CreateFailureException
                        // to ensure no behavior change with prior releases.
                        if (isTraceOn && tc.isDebugEnabled()) {
                            Tr.debug(tc, "MDB ejbCreate failure", ex);
                        }
                        throw new CreateFailureException(ex);
                    } finally {
                        if (isTraceOn && // d527372
                            TEBeanLifeCycleInfo.isTraceEnabled()) {
                            TEBeanLifeCycleInfo.traceEJBCallExit("ejbCreate");
                        }
                    }
                }
            } else if (ivCallbackKind == CallbackKind.InvocationContext) {
                // This is a MDB 3 that may have one or more PostConstruct interceptors
                // methods. Invoke PostContruct interceptors if there is atleast 1
                // PostConstruct interceptor.
                try {
                    if (imd != null) // d402681
                    {
                        InterceptorProxy[] proxies = imd.ivPostConstructInterceptors;
                        if (proxies != null) {
                            if (isTraceOn && // d527372
                                TEBeanLifeCycleInfo.isTraceEnabled()) {
                                TEBeanLifeCycleInfo.traceEJBCallEntry("PostConstruct");
                            }
                            InvocationContextImpl<?> inv = getInvocationContext();
                            inv.doLifeCycle(proxies, bmd._moduleMetaData); //d450431, F743-14982
                        }
                    }
                } catch (Throwable t) {
                    //FFDCFilter.processException(t, CLASS_NAME + ".MessageDrivenBeanO", "281", this);

                    // PostConstruct interceptors are allowed to throw system runtime exceptions,
                    // but NOT application exceptions. Therefore, wrap the caught Throwable
                    // in a javax.ejb.EJBException so that it gets handled as an unchecked
                    // exception.
                    if (isTraceOn && tc.isDebugEnabled()) {
                        Tr.debug(tc, "MDB PostConstruct failure", t);
                    }
                    throw ExceptionUtil.EJBException("MDB PostConstruct failure", t);
                } finally {
                    if (isTraceOn && // d527372
                        TEBeanLifeCycleInfo.isTraceEnabled() &&
                        imd != null &&
                        imd.ivPostConstructInterceptors != null) {
                        TEBeanLifeCycleInfo.traceEJBCallExit("PostConstruct");
                    }
                }
            } // d367572.1 end

            //---------------------------------------------------------
            // Now that create has completed, allow setRollbackOnly to
            // be called on the SessionContext and change state to the
            // POOLED state to indicate the MDB is in the method-ready
            // pool state and message listener methods are now allowed to be
            // invoked on this MDB.
            //---------------------------------------------------------
            allowRollbackOnly = true;
            setState(POOLED);
        } finally // d399469
        {
            contextHelper.complete(true);
        }

        if (isTraceOn && tc.isEntryEnabled()) {
            Tr.exit(tc, "initialize");
        }
    }
823371
void resolveInjectionBindings()
                    throws InjectionException
    {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(tc, "resolveInjectionBindings: " + this);

        Collection<InjectionBinding<A>> allInjectionBindings = ivAllAnnotationsCollection.values();
        for (InjectionBinding<A> injectionBinding : allInjectionBindings)
        {
            if (injectionBinding.ivResolveAttempted) // F87539
            {
                if (isTraceOn && tc.isDebugEnabled())
                    Tr.debug(tc, "skipping already resolved " + injectionBinding.toSimpleString());
                continue;
            }

            if (isTraceOn && tc.isDebugEnabled())
                Tr.debug(tc, "resolving " + injectionBinding.toSimpleString());

            injectionBinding.resolveJndiName(); // F743-29417
            resolve(injectionBinding);
            injectionBinding.ivResolveAttempted = true; // F87539

            InjectionScope scope = injectionBinding.getInjectionScope();
            if (scope != InjectionScope.COMP &&
                ivContext.ivSaveNonCompInjectionBindings) // F743-33811.2
            {
                if (isTraceOn && tc.isDebugEnabled())
                    Tr.debug(tc, "saving " + scope + " injection binding " + injectionBinding.toSimpleString());

                Map<Class<?>, Map<String, InjectionBinding<?>>> savedInjectionBindings;
                if (scope == InjectionScope.MODULE)
                {
                    savedInjectionBindings = ivContext.ivSavedModuleInjectionBindings;
                }
                else if (scope == InjectionScope.APP)
                {
                    savedInjectionBindings = ivContext.ivSavedAppInjectionBindings;
                }
                else
                {
                    savedInjectionBindings = ivContext.ivSavedGlobalInjectionBindings;
                }

                Map<String, InjectionBinding<A>> injectionBindingsMap = getSavedInjectionBindings(savedInjectionBindings, true);
                String jndiName = injectionBinding.getJndiName();
                InjectionBinding<A> savedBinding = injectionBindingsMap.get(jndiName);
                if (savedBinding == null)
                {
                    injectionBindingsMap.put(jndiName, injectionBinding);
                }
                else
                {
                    savedBinding.mergeSaved(injectionBinding);
                }
            }
        }

        // F743-21481
        // Add all of the InjectionBindings that this processor instance knows
        // about (these InjectionBinding instances are now resolved) so they can
        // later be used to determine the injection targets for a class.
        ivContext.ivProcessedInjectionBindings.addAll(allInjectionBindings); // F743-33811.1

        if (ivSimpleInjectionBindings != null) // F50309.5 PM88594
        {
            Collection<InjectionBinding<A>> injectionBindings = ivSimpleInjectionBindings.values();
            for (InjectionBinding<A> injectionBinding : injectionBindings)
            {
                if (isTraceOn && tc.isDebugEnabled())
                    Tr.debug(tc, "resolving " + injectionBinding.toSimpleString());

                resolve(injectionBinding);
            }

            ivContext.ivProcessedInjectionBindings.addAll(injectionBindings);
        }

        if (!ivMissingBindings.isEmpty()) {
            Iterator<String> missingBindingIter = ivMissingBindings.iterator();
            String resRefName;
            String displayName = ivNameSpaceConfig.getDisplayName();
            while (missingBindingIter.hasNext()) {
                resRefName = missingBindingIter.next();
                Tr.error(tc, "UNABLE_TO_RESOLVE_THE_RESOURCE_REFERENCE_CWNEN0044E", resRefName, displayName);
            }
            throw new InjectionException("CWNEN0044E: A resource reference binding could not be found for the following resource references " + ivMissingBindings.toString()
                                         + ", defined for the " + displayName + " component.");
        }

        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(tc, "resolveInjectionBindings");
    }