public final class ApplicationLoader
extends java.net.URLClassLoader
It provides the necessary services for setting up the execution environment and invoking the actual application code.
Further more it acts as a ClassLoader and URLStreamHandlerFactory making 3rd party jars which are
included in the application jar available to the application during runtime.
This class retrieves the actual application information from a file resource named ApplicationLoader which has be to
be located in the application root resource folder. The first line of this resource defines the actual Main
class to be loaded and executed. All remaining lines are considered as system properties that are set prior to
loading and invoking the main class.
| Modifier and Type | Method and Description |
|---|---|
static java.util.jar.JarFile |
getApplicationJarFile()
Get the
JarFile this application has been loaded from. |
static java.net.URL |
getDirectURL(java.net.URL u)
Get the direct URL and remove a possibly existing resource re-direct.
|
java.lang.Class<?> |
loadClass(java.lang.String name) |
static void |
main(java.lang.String[] args)
Generic application main function.
|
addURL, close, definePackage, findClass, findResource, findResources, getPermissions, getResourceAsStream, getURLs, newInstance, newInstanceclearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResource, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners@Nullable public static java.net.URL getDirectURL(java.net.URL u)
By using this function the application can provide resource access via one of the JDK's standard
URLStreamHandler classes for code that cannot handle our custom URLStreamHandler.
u - The URL to get the direct URL.null if the resource does not exist.public java.lang.Class<?> loadClass(@Nullable java.lang.String name) throws java.lang.ClassNotFoundException
loadClass in class java.lang.ClassLoaderjava.lang.ClassNotFoundException@Nullable public static java.util.jar.JarFile getApplicationJarFile() throws java.io.IOException
JarFile this application has been loaded from.JarFile, or null if the application was not loaded from a release Jar.java.io.IOException - if an I/O error occurs while opening the Jar.public static void main(java.lang.String[] args)
args - The application's command line.