com.sun.faces.spi
public class InjectionProviderFactory extends java.lang.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 java.lang.String[] |
EMPTY_ARRAY |
private static InjectionProvider |
GENERIC_WEB_PROVIDER |
private static java.lang.String |
INJECTION_PROVIDER_PROPERTY
The system property that will be checked for alternate
InjectionProvider implementations. |
private static java.lang.String |
INJECTION_SERVICE |
private static java.util.logging.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(java.lang.Class<?> clazz)
Determine if the specified class extends the
DiscoverableInjectionProvider interfaces. |
private static java.lang.String |
findProviderClass(javax.faces.context.ExternalContext extContext)
Attempt to find an
InjectionProvider based on the following
algorithm: |
private static java.lang.String |
getProviderFromEntry(java.util.Map<java.lang.String,java.lang.Object> appMap,
java.lang.String entry) |
private static InjectionProvider |
getProviderInstance(java.lang.String className,
javax.faces.context.ExternalContext extContext) |
private static java.lang.String[] |
getServiceEntries() |
private static boolean |
implementsInjectionProvider(java.lang.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 java.lang.String INJECTION_SERVICE
private static final java.lang.String INJECTION_PROVIDER_PROPERTY
The system property that will be checked for alternate
InjectionProvider
implementations.
private static final java.util.logging.Logger LOGGER
private static final java.lang.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(java.lang.String className, javax.faces.context.ExternalContext extContext)
private static boolean implementsInjectionProvider(java.lang.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(java.lang.Class<?> clazz)
Determine if the specified class extends the
DiscoverableInjectionProvider
interfaces.
clazz
- the class in questiontrue
if clazz
implements
the InjectionProvider
interfaceprivate static java.lang.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 java.lang.String getProviderFromEntry(java.util.Map<java.lang.String,java.lang.Object> appMap, java.lang.String entry)
private static java.lang.String[] getServiceEntries()
Copyright © 2002-2010 Oracle America, Inc. All Rights Reserved.