@Override
    public InjectionTarget[] getInjectionTargets(final Class<?> classToInjectInto) throws InjectionException {
        // This method attempts to cache the InjectTargets that are associated
        // with the specified class, so that if this method is invoked again and
        // the same class is specified, we can just grab the list from the Map
        // and not re-calculate it.
        //
        // EJB container should not need this caching, because it caches the list
        // of InjectionTargets in BeanMetaData and InterceptorMetaData.
        //
        // However, WebContainer will use this caching.  Under most circumstances,
        // they only inject into a class once...but I WebContainer team lead says
        // its possible to have multiple servlets share the same class, and in that
        // scenario they would be injecting into the same class multiple times,
        // and take advantage of the caching.

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

        InjectionTarget[] injectionTargetsForClass = ivInjectionTargetMap.get(classToInjectInto);
        if (injectionTargetsForClass == null) {
            synchronized (ivInjectionTargetMap) {
                injectionTargetsForClass = ivInjectionTargetMap.get(classToInjectInto);
                if (injectionTargetsForClass == null) {
                    // If targets were not found in cache from app start, then rebuilding them
                    // needs to run privileged, as this may run in the context of tha appliation
                    try {
                        injectionTargetsForClass = AccessController.doPrivileged(new PrivilegedExceptionAction<InjectionTarget[]>() {
                            @Override
                            public InjectionTarget[] run() throws Exception {
                                return ivInjectionEngine.getInjectionTargets(ivDeclaredInjectionTargets, classToInjectInto, ivCheckAppConfig);
                            }
                        });
                    } catch (PrivilegedActionException ex) {
                        Throwable cause = ex.getCause();
                        if (cause instanceof InjectionException) {
                            throw (InjectionException) cause;
                        }
                        if (cause instanceof RuntimeException) {
                            throw (RuntimeException) cause;
                        }
                        throw new InjectionException(cause);
                    }
                    if (ivInjectionTargetMap.size() <= svInjTarMapCacheSize || injectionTargetsForClass.length > 0) {
                        ivInjectionTargetMap.put(classToInjectInto, injectionTargetsForClass);
                    }
                }
            }
        }

        if (isTraceOn && tc.isDebugEnabled())
            Tr.exit(tc, "getInjectionTargets", Arrays.asList(injectionTargetsForClass));
        return injectionTargetsForClass;
    }
@ Override public InjectionTarget [ ] getInjectionTargets ( final Class < ? > classToInjectInto ) throws InjectionException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . entry ( tc , "getInjectionTargets: " + classToInjectInto + ", " + this ) ; InjectionTarget [ ] injectionTargetsForClass = ivInjectionTargetMap . get ( classToInjectInto ) ; if ( injectionTargetsForClass == null ) { synchronized ( ivInjectionTargetMap ) { injectionTargetsForClass = ivInjectionTargetMap . get ( classToInjectInto ) ; if ( injectionTargetsForClass == null ) { try { injectionTargetsForClass = AccessController . doPrivileged ( new PrivilegedExceptionAction < InjectionTarget [ ] > ( ) { @ Override public InjectionTarget [ ] run ( ) throws Exception { return ivInjectionEngine . getInjectionTargets ( ivDeclaredInjectionTargets , classToInjectInto , ivCheckAppConfig ) ; } } ) ; } catch ( PrivilegedActionException ex ) { Throwable cause = ex . getCause ( ) ; if ( cause instanceof InjectionException ) { throw ( InjectionException ) cause ; } if ( cause instanceof RuntimeException ) { throw ( RuntimeException ) cause ; } throw new InjectionException ( cause ) ; } if ( ivInjectionTargetMap . size ( ) <= svInjTarMapCacheSize || injectionTargetsForClass . length > 0 ) { ivInjectionTargetMap . put ( classToInjectInto , injectionTargetsForClass ) ; } } } } if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . exit ( tc , "getInjectionTargets" , Arrays . asList ( injectionTargetsForClass ) ) ; return injectionTargetsForClass ; }
Gets the <code>InjectionTarget</code> instances visible to the specified Class.

If there are no <code>InjectionTarget</code> instances visible to the Class,
then an empty (non-null) list is returned.