public class URLClassLoaderType extends java.lang.Object implements ValueFactory<java.lang.ClassLoader>, ArooaLifeAware
The class loader is created when this type is configured, and the same
class loader is then shared with all jobs that reference this type.
Because creating numerous class loader can use up the permgen heap space
it is best to avoid creating the type in a loop. Instead add it to
VariablesJob
outside the loop and only reference it inside the
loop.
<oddjob id="this"> <job> <oddjob id="nested" file="${this.dir}/URLClassLoaderInner.xml"> <classLoader> <url-class-loader> <files> <file file="${this.args[0]}/test/classloader"/> </files> </url-class-loader> </classLoader> </oddjob> </job> </oddjob>
ValueFactory.Conversions
Constructor and Description |
---|
URLClassLoaderType() |
Modifier and Type | Method and Description |
---|---|
void |
configured()
The configuration for the bean has been fully configured.
|
protected java.lang.ClassLoader |
createClassLoader() |
void |
destroy()
The configuration for the bean is about to be destroyed.
|
java.io.File[] |
getFiles() |
java.lang.ClassLoader |
getParent() |
java.net.URL[] |
getUrls() |
void |
initialised()
The configuration for the bean has been initialised.
|
boolean |
isNoInherit() |
void |
setFiles(java.io.File[] files) |
void |
setNoInherit(boolean noInherit) |
void |
setParent(java.lang.ClassLoader parent) |
void |
setUrls(java.net.URL[] urls) |
java.lang.String |
toString() |
java.lang.ClassLoader |
toValue()
Provide an instance of the type this is a factory for.
|
public java.lang.ClassLoader toValue()
ValueFactory
toValue
in interface ValueFactory<java.lang.ClassLoader>
protected java.lang.ClassLoader createClassLoader()
public java.net.URL[] getUrls()
public void setUrls(java.net.URL[] urls)
Property: urls
Description: URLs to add to the classpath.
Required: No.
public java.io.File[] getFiles()
public void setFiles(java.io.File[] files)
Property: files
Description: Files to add to the classpath.
Required: No.
public boolean isNoInherit()
public void setNoInherit(boolean noInherit)
Property: noInherit
Description: Don't inherit the parent class loader.
Required: No.
public java.lang.ClassLoader getParent()
@Inject public void setParent(java.lang.ClassLoader parent)
Property: parent
Description: The parent class loader to inherit.
Required: No, defaults to any existing Oddjob class loader.
public void initialised()
ArooaLifeAware
initialised
in interface ArooaLifeAware
public void configured()
ArooaLifeAware
configured
in interface ArooaLifeAware
public void destroy()
ArooaLifeAware
destroy
in interface ArooaLifeAware
public java.lang.String toString()
toString
in class java.lang.Object