public abstract class NuxeoLauncher extends Object
Modifier and Type | Field and Description |
---|---|
CommandSetInfo |
cset |
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() |
void |
init() |
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 |
printLongHelp() |
static void |
printShortHelp() |
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 CommandSetInfo cset
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 init()
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, IOException, org.nuxeo.connect.update.PackageException
ConfigurationException
IOException
org.nuxeo.connect.update.PackageException
public static void launch(NuxeoLauncher launcher) throws IOException, org.nuxeo.connect.update.PackageException
launcher
- launcherGUI
- command
- org.nuxeo.connect.update.PackageException
IOException
public boolean doStartAndWait() throws org.nuxeo.connect.update.PackageException
org.nuxeo.connect.update.PackageException
doStartAndWait(boolean)
public void stop()
stop(boolean)
public boolean doStart() throws org.nuxeo.connect.update.PackageException
doStart(boolean)
with false as parameter.org.nuxeo.connect.update.PackageException
doStart(boolean)
public boolean doStartAndWait(boolean logProcessOutput) throws org.nuxeo.connect.update.PackageException
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.org.nuxeo.connect.update.PackageException
public boolean wasStartupFine()
getStartupSummary()
public String getStartupSummary()
SocketTimeoutException
- if Nuxeo server is not respondingpublic boolean doStart(boolean logProcessOutput) throws org.nuxeo.connect.update.PackageException
org.nuxeo.connect.update.PackageException
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, org.apache.commons.cli.ParseException
org.apache.commons.cli.ParseException
ConfigurationException
- If server cannot be identifiedpublic static void printShortHelp()
public static void printLongHelp()
public boolean isRunning()
public boolean isStarted()
public File getLogFile()
public String getURL()
Copyright © 2012 Nuxeo SA. All Rights Reserved.