public class InjectionProviderFactory extends Object
A factory for creating InjectionProvider
instances.
Modifier and Type | Class and Description |
---|---|
private static class |
InjectionProviderFactory.NoopInjectionProvider
A no-op implementation of
InjectionProvider which will
be used when the #INJECTION_PROVIDER_PROPERTY is not specified or
is invalid. |
Modifier and Type | Field and Description |
---|---|
private static String[] |
EMPTY_ARRAY |
private static InjectionProvider |
GENERIC_WEB_PROVIDER |
private static String |
INJECTION_PROVIDER_PROPERTY
The system property that will be checked for alternate
InjectionProvider implementations. |
private static String |
INJECTION_SERVICE |
private static Logger |
LOGGER |
private static InjectionProvider |
NOOP_PROVIDER
Our no-op
InjectionProvider . |
Constructor and Description |
---|
InjectionProviderFactory() |
Modifier and Type | Method and Description |
---|---|
static InjectionProvider |
createInstance(javax.faces.context.ExternalContext extContext)
Creates a new instance of the class specified by the
com.sun.faces.InjectionProvider system property. |
private static boolean |
extendsDiscoverableInjectionProvider(Class<?> clazz)
Determine if the specified class extends the
DiscoverableInjectionProvider interfaces. |
private static String |
findProviderClass(javax.faces.context.ExternalContext extContext)
Attempt to find an
InjectionProvider based on the following
algorithm: |
private static String |
getProviderFromEntry(String entry) |
private static InjectionProvider |
getProviderInstance(String className,
javax.faces.context.ExternalContext extContext) |
private static String[] |
getServiceEntries() |
private static boolean |
implementsInjectionProvider(Class<?> clazz)
Determine if the specified class implements the
InjectionProvider interfaces. |
private static final InjectionProvider NOOP_PROVIDER
Our no-op InjectionProvider
.
private static final InjectionProvider GENERIC_WEB_PROVIDER
private static final String INJECTION_SERVICE
private static final String INJECTION_PROVIDER_PROPERTY
The system property that will be checked for alternate
InjectionProvider
implementations.
private static final Logger LOGGER
private static final String[] EMPTY_ARRAY
public static InjectionProvider createInstance(javax.faces.context.ExternalContext extContext)
Creates a new instance of the class specified by the
com.sun.faces.InjectionProvider
system property.
If this propery is not defined, then a default, no-op,
InjectionProvider
will be returned.
extContext
- ExteranlContext for the current requestInjectionProvider
interfacesprivate static InjectionProvider getProviderInstance(String className, javax.faces.context.ExternalContext extContext)
private static boolean implementsInjectionProvider(Class<?> clazz)
Determine if the specified class implements the
InjectionProvider
interfaces.
clazz
- the class in questiontrue
if clazz
implements
the InjectionProvider
interfaceprivate static boolean extendsDiscoverableInjectionProvider(Class<?> clazz)
Determine if the specified class extends the
DiscoverableInjectionProvider
interfaces.
clazz
- the class in questiontrue
if clazz
implements
the InjectionProvider
interfaceprivate static String findProviderClass(javax.faces.context.ExternalContext extContext)
Attempt to find an InjectionProvider
based on the following
algorithm:
com.sun.faces.injectionProvider
. If found,
return the value.com.sun.faces.InjectionProvider
.
If found, return the value.META-INF/services/com.sun.faces.injectionprovider
.
If entries are found and the entries extend DiscoverableInjectionProvider
,
invoke isInjectionFeatureAvailable(String)
passing in the configured
delegate. If isInjectionFeatureAvailable(String)
returns true
return the service entry.InjectionProviders are found, return null
extContext
- The ExternalContext for this requestnull
if not found.private static String[] getServiceEntries()
Copyright ? 2002-2010 Oracle America, Inc. All Rights Reserved.