| Modifier and Type | Field and Description |
|---|---|
| private List | |
| private ClassLoader | |
| private int |
| Access | Constructor and Description |
|---|---|
| pack-priv | FactoryEnumeration(List<NamedWeakReference<Object>>
A non-null list factories, ClassLoader The class loader of the list's contents
This internal method is used with Thread Context Class Loader (TCCL),
please don't expose this method as public. loader)Records the input list and uses it directly to satisfy hasMore()/next() requests. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public Object |
| factories | back to summary |
|---|---|
| private List<NamedWeakReference<Object>> factories | |
| loader | back to summary |
|---|---|
| private ClassLoader loader | |
| posn | back to summary |
|---|---|
| private int posn | |
| FactoryEnumeration | back to summary |
|---|---|
| pack-priv FactoryEnumeration(List<NamedWeakReference<Object>> factories, ClassLoader loader) Records the input list and uses it directly to satisfy hasMore()/next() requests. An alternative would have been to use an enumeration/iterator from the list, but we want to update the list so we keep the original list. The list initially contains Class objects. As each element is used, the Class object is replaced by an instance of the Class itself; eventually, the list contains only a list of factory instances and no more updates are required. Both Class objects and factories are wrapped in weak references so as not to prevent GC of the class loader. Each weak reference is tagged with the factory's class name so the class can be reloaded if the reference is cleared.
| |
| hasMore | back to summary |
|---|---|
| public boolean hasMore() | |
| next | back to summary |
|---|---|
| public Object next() throws NamingException | |