| Modifier and Type | Field and Description |
|---|---|
| private static final String | |
| private static final String | |
| private static final WeakHashMap | |
| private static final VersionHelper | |
| private static final String | |
| private static final String[] | |
| private static final WeakReference | |
| private static final WeakHashMap | |
| private static final String | |
| private static final WeakHashMap |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static Hashtable | |
| public static FactoryEnumeration | Returns: An enumeration of factory classes/objects; null if none.The non-null property name propName, Hashtable<?, ?> The possibly null environment properties env, Context The possibly null context ctx)Retrieves an enumeration of factory classes/object specified by a property. |
| public static Object | Returns: An factory object; null if none.The non-null property name propName, Hashtable<?, ?> The possibly null environment properties env, Context The possibly null context ctx, String The non-null class name
(e.g. ".ldap.ldapURLContextFactory). classSuffix, String The non-null default package prefix.
(e.g., "com.sun.jndi.url"). defaultPkgPrefix)Retrieves a factory from a list of packages specified in a property. |
| public static Hashtable | getInitialEnvironment(Hashtable<?, ?>
environment passed to initial context constructor.
Null indicates an empty environment. env)Given the environment parameter passed to the initial context constructor, returns the full environment for that initial context (never null). |
| public static String | Returns: the property value, or null is there is none.The non-null property name propName, Hashtable<?, ?> The possibly null environment properties env, Context The possibly null context ctx, boolean True if multiple values should be concatenated concat)Retrieves the property from the environment, or from the provider resource file associated with the given context. |
| private static Hashtable | |
| private static boolean | |
| private static void |
| APP_RESOURCE_FILE_NAME | back to summary |
|---|---|
| private static final String APP_RESOURCE_FILE_NAME | |
| DISABLE_APP_RESOURCE_FILES | back to summary |
|---|---|
| private static final String DISABLE_APP_RESOURCE_FILES | |
| factoryCache | back to summary |
|---|---|
| private static final WeakHashMap<ClassLoader, Map<String, List<NamedWeakReference<Object>>>> factoryCache | |
| helper | back to summary |
|---|---|
| private static final VersionHelper helper | |
| JRE_CONF_PROPERTY_FILE_NAME | back to summary |
|---|---|
| private static final String JRE_CONF_PROPERTY_FILE_NAME | |
| listProperties | back to summary |
|---|---|
| private static final String[] listProperties | |
| NO_FACTORY | back to summary |
|---|---|
| private static final WeakReference<Object> NO_FACTORY | |
| propertiesCache | back to summary |
|---|---|
| private static final WeakHashMap<Object, Hashtable<? super String, Object>> propertiesCache | |
| PROVIDER_RESOURCE_FILE_NAME | back to summary |
|---|---|
| private static final String PROVIDER_RESOURCE_FILE_NAME | |
| urlFactoryCache | back to summary |
|---|---|
| private static final WeakHashMap<ClassLoader, Map<String, WeakReference<Object>>> urlFactoryCache | |
| ResourceManager | back to summary |
|---|---|
| private ResourceManager() | |
| getApplicationResources | back to summary |
|---|---|
| private static Hashtable | |
| getFactories | back to summary |
|---|---|
| public static FactoryEnumeration getFactories(String propName, Hashtable<?, ?> env, Context ctx) throws NamingException Retrieves an enumeration of factory classes/object specified by a property. The property is gotten from the environment and the provider resource file associated with the given context and concatenated. See getProperty(). The resulting property value is a list of class names. This method then loads each class using the current thread's context class loader and keeps them in a list. Any class that cannot be loaded is ignored. The resulting list is then cached in a two-level hash table, keyed first by the context class loader and then by the property's value. The next time threads of the same context class loader call this method, they can use the cached list. After obtaining the list either from the cache or by creating one from the property value, this method then creates and returns a FactoryEnumeration using the list. As the FactoryEnumeration is traversed, the cached Class object in the list is instantiated and replaced by an instance of the factory object itself. Both class objects and factories are wrapped in weak references so as not to prevent GC of the class loader. Note that multiple threads can be accessing the same cached list via FactoryEnumeration, which locks the list during each next(). The size of the list will not change, but a cached Class object might be replaced by an instantiated factory object.
| |
| getFactory | back to summary |
|---|---|
| public static Object getFactory(String propName, Hashtable<?, ?> env, Context ctx, String classSuffix, String defaultPkgPrefix) throws NamingException Retrieves a factory from a list of packages specified in a property. The property is gotten from the environment and the provider resource file associated with the given context and concatenated. classSuffix is added to the end of this list. See getProperty(). The resulting property value is a list of package prefixes. This method then constructs a list of class names by concatenating each package prefix with classSuffix and attempts to load and instantiate the class until one succeeds. Any class that cannot be loaded is ignored. The resulting object is then cached in a two-level hash table, keyed first by the context class loader and then by the property's value and classSuffix. The next time threads of the same context class loader call this method, they use the cached factory. If no factory can be loaded, NO_FACTORY is recorded in the table so that next time it'll return quickly.
| |
| getInitialEnvironment | back to summary |
|---|---|
| public static Hashtable Given the environment parameter passed to the initial context constructor, returns the full environment for that initial context (never null). This is based on the environment parameter, the system properties, and all application resource files. This method will modify
| |
| getProperty | back to summary |
|---|---|
| public static String getProperty(String propName, Hashtable<?, ?> env, Context ctx, boolean concat) throws NamingException Retrieves the property from the environment, or from the provider
resource file associated with the given context. The environment
may in turn contain values that come from system properties,
or application resource files.
If
| |
| getProviderResource | back to summary |
|---|---|
| private static Hashtable | |
| isListProperty | back to summary |
|---|---|
| private static boolean isListProperty(String prop) | |
| mergeTables | back to summary |
|---|---|
| private static void mergeTables(Hashtable<? super String, Object> props1, Hashtable<? super String, Object> props2) | |