Class JarExecutor
- java.lang.Object
-
- org.apache.sling.testing.serversetup.jarexec.JarExecutor
-
public class JarExecutor extends Object
Start a runnable jar by forking a JVM process, and terminate the process when this VM exits.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JarExecutor.ExecutorException
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_EXIT_TIMEOUT
static String
DEFAULT_JAR_FOLDER
static String
DEFAULT_JAR_NAME_REGEXP
static int
DEFAULT_PORT
static String
PROP_EXIT_TIMEOUT_SECONDS
static String
PROP_JAR_FOLDER
static String
PROP_JAR_NAME_REGEXP
static String
PROP_JAR_OPTIONS
static String
PROP_JAVA_PATH
static String
PROP_PREFIX
static String
PROP_SERVER_PORT
static String
PROP_SYNC_EXEC
static String
PROP_SYNC_EXEC_EXPECTED
static String
PROP_VM_OPTIONS
static String
PROP_WAIT_ONSHUTDOWN
static String
PROP_WORK_FOLDER
-
Constructor Summary
Constructors Constructor Description JarExecutor(Properties config)
Build a JarExecutor, locate the jar to run, etc
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getServerPort()
void
start()
Start the jar if not done yet, and setup runtime hook to stop it.void
stop()
Stop the process that we started, if any, and wait for it to exit before returningString
toString()
-
-
-
Field Detail
-
DEFAULT_PORT
public static final int DEFAULT_PORT
- See Also:
- Constant Field Values
-
DEFAULT_EXIT_TIMEOUT
public static final int DEFAULT_EXIT_TIMEOUT
- See Also:
- Constant Field Values
-
DEFAULT_JAR_FOLDER
public static final String DEFAULT_JAR_FOLDER
- See Also:
- Constant Field Values
-
DEFAULT_JAR_NAME_REGEXP
public static final String DEFAULT_JAR_NAME_REGEXP
- See Also:
- Constant Field Values
-
PROP_PREFIX
public static final String PROP_PREFIX
- See Also:
- Constant Field Values
-
PROP_SERVER_PORT
public static final String PROP_SERVER_PORT
- See Also:
- Constant Field Values
-
PROP_JAR_FOLDER
public static final String PROP_JAR_FOLDER
- See Also:
- Constant Field Values
-
PROP_JAR_NAME_REGEXP
public static final String PROP_JAR_NAME_REGEXP
- See Also:
- Constant Field Values
-
PROP_VM_OPTIONS
public static final String PROP_VM_OPTIONS
- See Also:
- Constant Field Values
-
PROP_WORK_FOLDER
public static final String PROP_WORK_FOLDER
- See Also:
- Constant Field Values
-
PROP_JAR_OPTIONS
public static final String PROP_JAR_OPTIONS
- See Also:
- Constant Field Values
-
PROP_EXIT_TIMEOUT_SECONDS
public static final String PROP_EXIT_TIMEOUT_SECONDS
- See Also:
- Constant Field Values
-
PROP_WAIT_ONSHUTDOWN
public static final String PROP_WAIT_ONSHUTDOWN
- See Also:
- Constant Field Values
-
PROP_JAVA_PATH
public static final String PROP_JAVA_PATH
- See Also:
- Constant Field Values
-
PROP_SYNC_EXEC
public static final String PROP_SYNC_EXEC
- See Also:
- Constant Field Values
-
PROP_SYNC_EXEC_EXPECTED
public static final String PROP_SYNC_EXEC_EXPECTED
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JarExecutor
public JarExecutor(Properties config) throws JarExecutor.ExecutorException
Build a JarExecutor, locate the jar to run, etc- Throws:
JarExecutor.ExecutorException
-
-