|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.sling.launchpad.base.shared.Loader
public class Loader
The Loader
class provides utility methods for the actual
launchers to help launching the framework.
Constructor Summary | |
---|---|
Loader(String slingHome)
Creates a loader instance to load from the given Sling home folder. |
Method Summary | |
---|---|
void |
cleanupVM()
Tries to remove as many traces of class loaded by the framework from the Java VM as possible. |
protected void |
info(String msg)
Meant to be overridden to display or log info |
boolean |
installLauncherJar(URL launcherJar)
Copies the contents of the launcher JAR as indicated by the URL to the sling home directory. |
Object |
loadLauncher(String launcherClassName)
Creates an URLClassLoader from a _launcher JAR_ file in the given slingHome directory and loads and returns the launcher class identified by the launcherClassName. |
static void |
spool(InputStream ins,
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Loader(String slingHome) throws IllegalArgumentException
slingHome
- The Sling home folder. If this is null
the
default value SharedConstants.SLING_HOME_DEFAULT
is
assumed.
IllegalArgumentException
- If the Sling home folder exists but is
not a directory or if the Sling home folder cannot be
created.Method Detail |
---|
public Object loadLauncher(String launcherClassName)
launcherClassName
- The fully qualified name of a class implementing
the Launcher interface. This class must have a public
constructor taking no arguments.
NullPointerException
- if launcherClassName is null
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(URL launcherJar) throws IOException
true
if the launcher JAR file has been installed or
updated, false
otherwise.
IOException
- If an error occurrs transferring the contentspublic static void spool(InputStream ins, File destFile) throws IOException
IOException
- If an error occurrs reading or writing the input
stream contents.protected void info(String msg)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |