Package org.dspace.app.launcher
Class ScriptLauncher
- java.lang.Object
-
- org.dspace.app.launcher.ScriptLauncher
-
public class ScriptLauncher extends Object
A DSpace script launcher.- Author:
- Stuart Lewis, Mark Diggory
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static org.jdom.DocumentgetConfig()Load the launcher configuration filestatic org.jdom.DocumentgetConfig(DSpaceKernelImpl kernelImpl)static inthandleScript(String[] args, org.jdom.Document commandConfigs, DSpaceRunnableHandler dSpaceRunnableHandler, DSpaceKernelImpl kernelImpl)This method will take the arguments from a commandline input and it'll find the script that the first argument refers to and it'll execute this script.static voidmain(String[] args)Execute the DSpace script launcherprotected static intrunOneCommand(org.jdom.Document commandConfigs, String[] args)protected static intrunOneCommand(org.jdom.Document commandConfigs, String[] args, DSpaceKernelImpl kernelImpl)Recognize and execute a single command.
-
-
-
Method Detail
-
main
public static void main(String[] args) throws FileNotFoundException, IOException, IllegalAccessException, InstantiationException
Execute the DSpace script launcher- Parameters:
args- Any parameters required to be passed to the scripts it executes- Throws:
IOException- if IO errorFileNotFoundException- if file doesn't existIllegalAccessExceptionInstantiationException
-
handleScript
public static int handleScript(String[] args, org.jdom.Document commandConfigs, DSpaceRunnableHandler dSpaceRunnableHandler, DSpaceKernelImpl kernelImpl) throws InstantiationException, IllegalAccessException
This method will take the arguments from a commandline input and it'll find the script that the first argument refers to and it'll execute this script. It can return a 1 or a 0 depending on whether the script failed or passed respectively- Parameters:
args- The arguments for the script and the script as first one in the arraycommandConfigs- The DocumentdSpaceRunnableHandler- The DSpaceRunnableHandler for this executionkernelImpl- The relevant DSpaceKernelImpl- Returns:
- A 1 or 0 depending on whether the script failed or passed respectively
- Throws:
InstantiationExceptionIllegalAccessException
-
runOneCommand
protected static int runOneCommand(org.jdom.Document commandConfigs, String[] args)
-
runOneCommand
protected static int runOneCommand(org.jdom.Document commandConfigs, String[] args, DSpaceKernelImpl kernelImpl)Recognize and execute a single command.- Parameters:
commandConfigs- Documentargs- the command line arguments given
-
getConfig
protected static org.jdom.Document getConfig()
Load the launcher configuration file- Returns:
- The XML configuration file Document
-
getConfig
public static org.jdom.Document getConfig(DSpaceKernelImpl kernelImpl)
-
-