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 String
protected com.sun.jna.platform.win32.WinNT.HANDLE
protected org.jumpmind.symmetric.wrapper.WindowsService.ServiceControlHandler
protected com.sun.jna.platform.win32.Winsvc.SERVICE_STATUS
protected Advapi32Ex.SERVICE_STATUS_HANDLE
Fields inherited from class org.jumpmind.symmetric.wrapper.WrapperService
child, config, keepRunning
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
closeServiceHandle
(com.sun.jna.platform.win32.Winsvc.SC_HANDLE handle) protected int
protected com.sun.jna.platform.win32.WinNT.HANDLE
protected int
getProcessPid
(Process process) protected String
void
init()
protected void
void
install()
boolean
protected boolean
isPidRunning
(int pid) boolean
boolean
protected void
killProcess
(int pid, boolean isTerminate) protected void
protected void
protected com.sun.jna.platform.win32.Winsvc.SC_HANDLE
void
relaunchAsPrivileged
(String className) protected boolean
void
start()
void
stop()
protected void
throwException
(String name) void
protected void
updateStatus
(int status, int controlsAccepted) protected void
updateStatus
(Constants.Status status) 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) Methods inherited from class org.jumpmind.symmetric.wrapper.WrapperService
commandToString, console, deletePidFile, execJava, getConfig, getInstance, getServerPid, getWrapperCommand, getWrapperPid, loadConfig, readPidFromFile, restart, scrubCommand, 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:
setWorkingDirectory
in classWrapperService
-
init
public void init()- Overrides:
init
in classWrapperService
-
initEnvironment
- Overrides:
initEnvironment
in classWrapperService
-
start
public void start()- Overrides:
start
in classWrapperService
-
stop
public void stop()- Overrides:
stop
in classWrapperService
-
isRunning
public boolean isRunning()- Overrides:
isRunning
in classWrapperService
-
isPidRunning
protected boolean isPidRunning(int pid) - Specified by:
isPidRunning
in classWrapperService
-
getCurrentPid
protected int getCurrentPid()- Specified by:
getCurrentPid
in classWrapperService
-
isPrivileged
public boolean isPrivileged()- Specified by:
isPrivileged
in classWrapperService
-
relaunchAsPrivileged
- Overrides:
relaunchAsPrivileged
in classWrapperService
-
isInstalled
public boolean isInstalled()- Specified by:
isInstalled
in classWrapperService
-
getProcessPid
- Specified by:
getProcessPid
in classWrapperService
-
killProcess
protected void killProcess(int pid, boolean isTerminate) - Specified by:
killProcess
in classWrapperService
-
install
public void install()- Specified by:
install
in classWrapperService
-
getServiceCommand
-
uninstall
public void uninstall()- Specified by:
uninstall
in classWrapperService
-
openServiceManager
protected com.sun.jna.platform.win32.Winsvc.SC_HANDLE openServiceManager() -
updateStatus
- Overrides:
updateStatus
in 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:
getWrapperCommandQuote
in classWrapperService
-