Package org.jumpmind.symmetric.wrapper
Class WindowsService
java.lang.Object
org.jumpmind.symmetric.wrapper.WrapperService
org.jumpmind.symmetric.wrapper.WindowsService
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Stringprotected com.sun.jna.platform.win32.WinNT.HANDLEprotected org.jumpmind.symmetric.wrapper.WindowsService.ServiceControlHandlerprotected com.sun.jna.platform.win32.Winsvc.SERVICE_STATUSprotected Advapi32Ex.SERVICE_STATUS_HANDLEFields inherited from class org.jumpmind.symmetric.wrapper.WrapperService
child, config, keepRunning -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcloseServiceHandle(com.sun.jna.platform.win32.Winsvc.SC_HANDLE handle) protected intprotected com.sun.jna.platform.win32.WinNT.HANDLEprotected intgetProcessPid(Process process) protected Stringvoidinit()protected voidvoidinstall()booleanprotected booleanisPidRunning(int pid) booleanbooleanprotected voidkillProcess(int pid, boolean isTerminate) protected voidprotected voidprotected com.sun.jna.platform.win32.Winsvc.SC_HANDLEvoidrelaunchAsPrivileged(String className) protected booleanvoidstart()voidstop()protected voidthrowException(String name) voidprotected voidupdateStatus(int status, int controlsAccepted) protected voidupdateStatus(Constants.Status status) protected com.sun.jna.platform.win32.Winsvc.SERVICE_STATUS_PROCESSwaitForService(com.sun.jna.platform.win32.Winsvc.SC_HANDLE manager, com.sun.jna.platform.win32.Winsvc.SC_HANDLE service) Methods inherited from class org.jumpmind.symmetric.wrapper.WrapperService
commandToString, console, deletePidFile, execJava, getConfig, getInstance, getServerPid, getWrapperCommand, getWrapperPid, loadConfig, readPidFromFile, restart, shutdown, status, stopProcess, stopProcesses, waitForPid, writePidToFile
-
Field Details
-
APP_EVENT_LOG
- See Also:
-
serviceControlHandler
protected org.jumpmind.symmetric.wrapper.WindowsService.ServiceControlHandler serviceControlHandler -
serviceStatusHandle
-
serviceStatus
protected com.sun.jna.platform.win32.Winsvc.SERVICE_STATUS serviceStatus -
eventHandle
protected com.sun.jna.platform.win32.WinNT.HANDLE eventHandle
-
-
Constructor Details
-
WindowsService
public WindowsService()
-
-
Method Details
-
setWorkingDirectory
- Specified by:
setWorkingDirectoryin classWrapperService
-
init
public void init()- Overrides:
initin classWrapperService
-
initEnvironment
- Overrides:
initEnvironmentin classWrapperService
-
start
public void start()- Overrides:
startin classWrapperService
-
stop
public void stop()- Overrides:
stopin classWrapperService
-
isRunning
public boolean isRunning()- Overrides:
isRunningin classWrapperService
-
isPidRunning
protected boolean isPidRunning(int pid) - Specified by:
isPidRunningin classWrapperService
-
getCurrentPid
protected int getCurrentPid()- Specified by:
getCurrentPidin classWrapperService
-
isPrivileged
public boolean isPrivileged()- Specified by:
isPrivilegedin classWrapperService
-
relaunchAsPrivileged
- Overrides:
relaunchAsPrivilegedin classWrapperService
-
isInstalled
public boolean isInstalled()- Specified by:
isInstalledin classWrapperService
-
getProcessPid
- Specified by:
getProcessPidin classWrapperService
-
killProcess
protected void killProcess(int pid, boolean isTerminate) - Specified by:
killProcessin classWrapperService
-
install
public void install()- Specified by:
installin classWrapperService
-
getServiceCommand
-
uninstall
public void uninstall()- Specified by:
uninstallin classWrapperService
-
openServiceManager
protected com.sun.jna.platform.win32.Winsvc.SC_HANDLE openServiceManager() -
updateStatus
- Overrides:
updateStatusin classWrapperService
-
updateStatus
protected void updateStatus(int status, int controlsAccepted) -
logEvent
-
logEvent
-
getEventHandle
protected com.sun.jna.platform.win32.WinNT.HANDLE getEventHandle() -
waitForService
protected com.sun.jna.platform.win32.Winsvc.SERVICE_STATUS_PROCESS waitForService(com.sun.jna.platform.win32.Winsvc.SC_HANDLE manager, com.sun.jna.platform.win32.Winsvc.SC_HANDLE service) -
closeServiceHandle
protected void closeServiceHandle(com.sun.jna.platform.win32.Winsvc.SC_HANDLE handle) -
throwException
-
getWrapperCommandQuote
- Overrides:
getWrapperCommandQuotein classWrapperService
-