public interface Loader
In order for a Loader
implementation to successfully operate
with a Context
implementation that implements reloading, it
must obey the following constraints:
Lifecycle
so that the Context can indicate
that a new class loader is required.
start()
method must unconditionally create a new
ClassLoader
implementation.
stop()
method must throw away its reference to the
ClassLoader
previously utilized, so that the class loader,
all classes loaded by it, and all objects of those classes, can be
garbage collected.
stop()
to be followed by a call to
start()
on the same Loader
instance.
Context.reload()
method on the owning Context
when a change to one or more of the class files loaded by this class
loader is detected.
Modifier and Type | Method and Description |
---|---|
void |
addOverridablePackage(String packageName)
Adds the given package name to the list of packages that may always be
overriden, regardless of whether they belong to a protected namespace
|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Add a property change listener to this component.
|
void |
addRepository(String repository)
Add a new repository to the set of repositories for this class loader.
|
String[] |
findRepositories()
Return the set of repositories defined for this class loader.
|
ClassLoader |
getClassLoader()
Return the Java class loader to be used by this Container.
|
Container |
getContainer()
Return the Container with which this Loader has been associated.
|
boolean |
getDelegate()
Return the "follow standard delegation model" flag used to configure
our ClassLoader.
|
String |
getInfo()
Return descriptive information about this Loader implementation and
the corresponding version number, in the format
<description>/<version> . |
boolean |
getReloadable()
Return the reloadable flag for this Loader.
|
boolean |
modified()
Has the internal repository associated with this Loader been modified,
such that the loaded classes should be reloaded?
|
void |
removePropertyChangeListener(PropertyChangeListener listener)
Remove a property change listener from this component.
|
void |
setContainer(Container container)
Set the Container with which this Loader has been associated.
|
void |
setDelegate(boolean delegate)
Set the "follow standard delegation model" flag used to configure
our ClassLoader.
|
void |
setIgnoreHiddenJarFiles(boolean ignoreHiddenJarFiles) |
void |
setReloadable(boolean reloadable)
Set the reloadable flag for this Loader.
|
ClassLoader getClassLoader()
Container getContainer()
void setContainer(Container container)
container
- The associated Containerboolean getDelegate()
void setDelegate(boolean delegate)
delegate
- The new flagString getInfo()
<description>/<version>
.boolean getReloadable()
void setReloadable(boolean reloadable)
reloadable
- The new reloadable flagvoid addPropertyChangeListener(PropertyChangeListener listener)
listener
- The listener to addvoid addRepository(String repository)
repository
- Repository to be addedString[] findRepositories()
boolean modified()
void removePropertyChangeListener(PropertyChangeListener listener)
listener
- The listener to removevoid addOverridablePackage(String packageName)
void setIgnoreHiddenJarFiles(boolean ignoreHiddenJarFiles)
Copyright © 2020. All rights reserved.