public class Loader
extends java.lang.Object
Loader
class provides utility methods for the actual
launchers to help launching the framework.Constructor and Description |
---|
Loader(java.io.File launchpadHome)
Creates a loader instance to load from the given launchpad home folder.
|
Modifier and Type | Method and Description |
---|---|
void |
cleanupVM()
Tries to remove as many traces of class loaded by the framework from the
Java VM as possible.
|
protected void |
info(java.lang.String msg)
Meant to be overridden to display or log info
|
boolean |
installLauncherJar(java.net.URL launcherJar)
Copies the contents of the launcher JAR as indicated by the URL to the
sling home directory.
|
java.lang.Object |
loadLauncher(java.lang.String launcherClassName)
Creates an URLClassLoader from a _launcher JAR_ file in the given
launchpadHome directory and loads and returns the launcher class
identified by the launcherClassName.
|
static void |
spool(java.io.InputStream ins,
java.io.File destFile)
Spools the contents of the input stream to the given file replacing the
contents of the file with the contents of the input stream.
|
public Loader(java.io.File launchpadHome)
launchpadHome
- The launchpad home folder. This must not be
null
or an empty string.java.lang.IllegalArgumentException
- If the launchpadHome
argument is null
or an empty string or if the
launchpad home folder exists but is not a directory or if the
Sling home folder cannot be created.public java.lang.Object loadLauncher(java.lang.String launcherClassName)
launcherClassName
- The fully qualified name of a class implementing
the Launcher interface. This class must have a public
constructor taking no arguments.java.lang.NullPointerException
- if launcherClassName is nulljava.lang.IllegalArgumentException
- if the launcherClassName cannot be
instantiated. The cause of the failure is contained as the
cause of the exception.public void cleanupVM()
This method must be called when the notifier is called.
public boolean installLauncherJar(java.net.URL launcherJar) throws java.io.IOException
true
if the launcher JAR file has been installed or
updated, false
otherwise.java.io.IOException
- If an error occurrs transferring the contentspublic static void spool(java.io.InputStream ins, java.io.File destFile) throws java.io.IOException
java.io.IOException
- If an error occurrs reading or writing the input
stream contents.protected void info(java.lang.String msg)
Copyright © 2018 The Apache Software Foundation. All rights reserved.