Package org.jumpmind.symmetric.wrapper
Class WrapperService
java.lang.Object
org.jumpmind.symmetric.wrapper.WrapperService
- Direct Known Subclasses:
UnixService,WindowsService
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringcommandToString(ArrayList<String> cmd) voidconsole()protected voiddeletePidFile(String filename) protected voidexecJava(boolean isConsole) protected abstract intstatic WrapperServiceprotected abstract intgetProcessPid(Process process) intgetWrapperCommand(String arg, boolean isQuotedArguments) protected Stringintvoidinit()protected voidabstract voidinstall()abstract booleanprotected abstract booleanisPidRunning(int pid) abstract booleanbooleanprotected abstract voidkillProcess(int pid, boolean isTerminate) voidloadConfig(String applHomeDir, String configFile, String jarFile) protected intreadPidFromFile(String filename) voidrelaunchAsPrivileged(String className) voidrestart()protected abstract booleanprotected voidshutdown()voidstart()voidstatus()voidstop()protected booleanstopProcess(int pid, String name) protected voidstopProcesses(boolean isStopAbandoned) abstract voidprotected voidupdateStatus(Constants.Status status) protected booleanwaitForPid(int pid) protected voidwritePidToFile(int pid, String filename)
-
Field Details
-
config
-
keepRunning
protected boolean keepRunning -
child
-
-
Constructor Details
-
WrapperService
public WrapperService()
-
-
Method Details
-
getInstance
-
loadConfig
- Throws:
IOException
-
getConfig
-
start
public void start() -
init
public void init() -
console
public void console() -
execJava
protected void execJava(boolean isConsole) -
initEnvironment
-
stop
public void stop() -
stopProcesses
protected void stopProcesses(boolean isStopAbandoned) -
stopProcess
-
shutdown
protected void shutdown() -
restart
public void restart() -
relaunchAsPrivileged
-
status
public void status() -
isRunning
public boolean isRunning() -
getWrapperPid
public int getWrapperPid() -
getServerPid
public int getServerPid() -
commandToString
-
getWrapperCommand
-
getWrapperCommandQuote
-
readPidFromFile
-
writePidToFile
-
deletePidFile
-
waitForPid
protected boolean waitForPid(int pid) -
updateStatus
-
install
public abstract void install() -
uninstall
public abstract void uninstall() -
isInstalled
public abstract boolean isInstalled() -
isPrivileged
public abstract boolean isPrivileged() -
setWorkingDirectory
-
getProcessPid
-
getCurrentPid
protected abstract int getCurrentPid() -
isPidRunning
protected abstract boolean isPidRunning(int pid) -
killProcess
protected abstract void killProcess(int pid, boolean isTerminate)
-