public abstract class NuxeoLauncher extends Object
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_RETRY_INTERVAL |
static long |
DEFAULT_RETRY_TIMEOUT |
Constructor and Description |
---|
NuxeoLauncher(ConfigurationGenerator configurationGenerator) |
Modifier and Type | Method and Description |
---|---|
void |
checkNoRunningServer()
Check if some server is already running (from another thread) and throw a
Runtime exception if it finds one.
|
void |
configure()
Configure the server after checking installation
|
static NuxeoLauncher |
createLauncher(String[] args) |
boolean |
doStart()
Call
doStart(boolean) with false as parameter. |
boolean |
doStart(boolean logProcessOutput)
Starts the server in background.
|
boolean |
doStartAndWait() |
boolean |
doStartAndWait(boolean logProcessOutput)
Whereas
doStart() considers the server as started when the
process is running, doStartAndWait() waits for effective start
by watching the logs |
String |
getCommand() |
ConfigurationGenerator |
getConfigurationGenerator() |
int |
getErrorValue()
Last error value set by any method.
|
NuxeoLauncherGUI |
getGUI() |
File |
getLogFile() |
String |
getStartupSummary() |
int |
getStatus()
Last status value set by
status() . |
String |
getURL() |
boolean |
isQuiet() |
boolean |
isRunning()
Work best with current nuxeoProcess.
|
boolean |
isStarted() |
boolean |
isUsingGui() |
static void |
launch(NuxeoLauncher launcher) |
ArrayList<ThreadedStreamGobbler> |
logProcessStreams(Process process,
boolean logProcessOutput) |
static void |
main(String[] args) |
static void |
printHelp()
Print class usage on standard system output.
|
void |
setGUI(NuxeoLauncherGUI gui) |
String |
status()
Return process status (running or not) as String, depending on OS
capability to manage processes.
|
void |
stop() |
void |
stop(boolean logProcessOutput)
Stops the server.
|
void |
waitForProcessStreams(ArrayList<ThreadedStreamGobbler> sgArray)
Stop stream gobblers contained in the given ArrayList
|
boolean |
wasStartupFine()
Must be called after
getStartupSummary() |
public static final long DEFAULT_RETRY_TIMEOUT
public static final long DEFAULT_RETRY_INTERVAL
public NuxeoLauncher(ConfigurationGenerator configurationGenerator)
public final ConfigurationGenerator getConfigurationGenerator()
public String getCommand()
public boolean isUsingGui()
public boolean isQuiet()
public NuxeoLauncherGUI getGUI()
public void setGUI(NuxeoLauncherGUI gui)
public void checkNoRunningServer() throws IllegalStateException
isRunning()
won't.IllegalThreadStateException
- Thrown if a server is already
running.IllegalStateException
public ArrayList<ThreadedStreamGobbler> logProcessStreams(Process process, boolean logProcessOutput)
public static void main(String[] args) throws ConfigurationException
ConfigurationException
public static void launch(NuxeoLauncher launcher)
launcher
- launcherGUI
- command
- public boolean doStartAndWait()
doStartAndWait(boolean)
public void stop()
stop(boolean)
public boolean doStart()
doStart(boolean)
with false as parameter.doStart(boolean)
public boolean doStartAndWait(boolean logProcessOutput)
doStart()
considers the server as started when the
process is running, doStartAndWait()
waits for effective start
by watching the logslogProcessOutput
- Must process output stream must be logged or not.public boolean wasStartupFine()
getStartupSummary()
public String getStartupSummary()
SocketTimeoutException
- if Nuxeo server is not respondingpublic boolean doStart(boolean logProcessOutput)
public void waitForProcessStreams(ArrayList<ThreadedStreamGobbler> sgArray)
InterruptedException
logProcessStreams(Process, boolean)
public void stop(boolean logProcessOutput)
STOP_NB_TRY
, waiting STOP_SECONDS_BEFORE_NEXT_TRY
between each try, then kill the process if still running.public void configure() throws ConfigurationException
ConfigurationException
- If an installation error is detected or if
configuration failspublic String status()
status
public int getStatus()
status()
.public int getErrorValue()
public static NuxeoLauncher createLauncher(String[] args) throws ConfigurationException
args
- Program argumentsConfigurationException
- If server cannot be identifiedpublic static void printHelp()
URISyntaxException
public boolean isRunning()
public boolean isStarted()
public File getLogFile()
public String getURL()
Copyright © 2011 Nuxeo SA. All Rights Reserved.