java.lang.ObjectThe ResourceManager class facilitates the reading of JNDI resource files.com.sun.naming.internal.ResourceManager
Rosanna - LeeScott - Seligman| Method from com.sun.naming.internal.ResourceManager Summary: |
|---|
| getFactories, getFactory, getInitialEnvironment, getProperty |
| Methods from java.lang.Object: |
|---|
| equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method from com.sun.naming.internal.ResourceManager Detail: |
|---|
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. |
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. |
|
|