- Enclosing class:
- PreferredClassProvider
private static class PreferredClassProvider.LoaderKey
extends WeakReference<ClassLoader>
Loader table key: a codebase annotation and a weak reference to
a parent class loader (possibly null). The weak reference is
registered with "refQueue" so that the entry can be removed
after the loader has become unreachable.
LoaderKey used to be a combination of URL path and weak reference to a
parent class loader.
It was updated to also allow Uri for the following reasons:
1. Modern environments have dynamically assigned IP addresses, Uri can provide a
level of indirection for Dynamic DNS and Dynamic IP.
2. Virtual hosting is broken with URL.
4. Testing revealed that all Jini specification tests pass with Uri.
Although this doesn't eliminate the possibility of breakage in user code,
it does provide a level of confidence that indicates the benefits
outweigh any disadvantages. Illegal characters are escaped prior
to parsing; to maximise compatibility and minimise deployment issues.
5. Sun bug ID 4434494 states:
However, to address URL parsing in general, we introduced a new
class called URI in Merlin (jdk1.4). People are encouraged to use
URI for parsing and Uri comparison, and leave URL class for
accessing the URL itself, getting at the protocol handler,
interacting with the protocol etc.