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 variables outside the loop and only reference it inside the loop.
files | Files to add to the classpath. |
noInherit | Don't inherit the parent class loader. |
parent | The parent class loader to inherit. |
urls | URLs to add to the classpath. |
Example 1 | A simple example. |
Configured By | ELEMENT |
Access | READ_WRITE |
Required | No. |
Files to add to the classpath.
Configured By | ATTRIBUTE |
Access | READ_WRITE |
Required | No. |
Don't inherit the parent class loader.
Configured By | ELEMENT |
Access | READ_WRITE |
Required | No, defaults to any existing Oddjob class loader. |
The parent class loader to inherit.
Configured By | ELEMENT |
Access | READ_WRITE |
Required | No. |
URLs to add to the classpath.
A simple example. A single directory is added to the class path.
<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>