org.apache.sling.testing.tools.jarexec
Class JarExecutor

java.lang.Object
  extended by org.apache.sling.testing.tools.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
static class JarExecutor.ExecutorException
           
 
Field Summary
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_PREFIX
           
static String PROP_SERVER_PORT
           
static String PROP_VM_OPTIONS
           
static String PROP_WORK_FOLDER
           
 
Constructor Summary
JarExecutor(Properties config)
          Build a JarExecutor, locate the jar to run, etc
 
Method Summary
 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 returning
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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
Constructor Detail

JarExecutor

public JarExecutor(Properties config)
            throws JarExecutor.ExecutorException
Build a JarExecutor, locate the jar to run, etc

Throws:
JarExecutor.ExecutorException
Method Detail

toString

public String toString()
Overrides:
toString in class Object

getServerPort

public int getServerPort()

start

public void start()
           throws Exception
Start the jar if not done yet, and setup runtime hook to stop it.

Throws:
Exception

stop

public void stop()
Stop the process that we started, if any, and wait for it to exit before returning



Copyright © 2007-2013 The Apache Software Foundation. All Rights Reserved.