Top Fields Constructors Methods
jakarta.el

pack-priv Class FactoryFinder

extends Object
Class Inheritance
Static Imports
java.io.File.separator

Field Summary

Modifier and TypeField and Description
private static final boolean

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv static Object

Returns:

the Class object of the specified message factory; may not be null
find
(Class<?>
The class to use when searching for the factory using the ServiceLoader mechanism
serviceClass
,
String
the name of the factory to find, which is a system property
factoryId
,
String
the implementation class name, which is to be used only if nothing else is found; null to indicate that there is no fallback class name
fallbackClassName
,
Properties properties)

Finds the implementation Class object for the given factory.

private static String
private static Object
newInstance(String className, ClassLoader classLoader, Properties properties)

Creates an instance of the specified class using the specified ClassLoader object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

IS_SECURITY_ENABLEDback to summary
private static final boolean IS_SECURITY_ENABLED

Constructor Detail

FactoryFinderback to summary
pack-priv FactoryFinder()

Method Detail

findback to summary
pack-priv static Object find(Class<?> serviceClass, String factoryId, String fallbackClassName, Properties properties)

Finds the implementation Class object for the given factory. The following search order is used:

  1. ServiceLoader lookup using serviceClass
  2. Property file located as $java.home/lib/el.properties
  3. System property lookup using factoryId
  4. Create an instance of fallbackClassName
This method is package private so that this code can be shared.
Parameters
serviceClass:Class<?>

The class to use when searching for the factory using the ServiceLoader mechanism

factoryId:String

the name of the factory to find, which is a system property

fallbackClassName:String

the implementation class name, which is to be used only if nothing else is found; null to indicate that there is no fallback class name

Returns:Object

the Class object of the specified message factory; may not be null

Exceptions
ELException:
if there is an error
getFactoryClassNameback to summary
private static String getFactoryClassName(String factoryId)
newInstanceback to summary
private static Object newInstance(String className, ClassLoader classLoader, Properties properties)

Creates an instance of the specified class using the specified ClassLoader object.

Exceptions
ELException:
if the given class could not be found or could not be instantiated