java.lang.Objectjwrapper.jwutils.JWService
public class JWService
JWService is a utility class that allows JWrapper virtual apps to be run as an operating system service. JWService launches an elevated ManageService helper app which performs the installation and managed of the OS service.
Nested Class Summary | |
---|---|
static class |
JWService.ServiceManagementException
|
static class |
JWService.ServiceMessageHandler
We use this message handler to receive messages from the elevated service install component. |
Constructor Summary | |
---|---|
JWService()
|
Method Summary | |
---|---|
static java.lang.String |
getDefaultServiceName()
Get the default service name used when setting up a JWrapper service. |
static java.lang.String |
getServicePID()
Return the process identifier reported by the last running service. |
static void |
installService(java.lang.String startVirtualApp,
boolean requiresUI)
Install an OS service which launches the specified virtual app. |
static void |
installService(java.lang.String startVirtualApp,
java.lang.String stopVirtualApp,
boolean requiresUI)
Install an OS service which launches the specified virtual app. |
static void |
installService(java.lang.String startVirtualApp,
java.lang.String stopVirtualApp,
java.net.URL overrideUpdateURL,
boolean requiresUI)
Install an OS service which launches the specified virtual app. |
static boolean |
isServiceRunning()
Check whether an instance of the service is running. |
static void |
removeService()
Called to remove the OS service. |
static void |
setServiceRestartOnFailure(java.lang.String serviceName,
boolean on,
boolean neverGiveUp)
Currently only on Windows |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JWService()
Method Detail |
---|
public static java.lang.String getDefaultServiceName()
public static java.lang.String getServicePID()
public static void installService(java.lang.String startVirtualApp, boolean requiresUI) throws java.lang.Exception
startVirtualApp
- the name of the virtual app that should be started by the service.requiresUI
- set to true if this service requires access to the UI service.
java.lang.Exception
public static void installService(java.lang.String startVirtualApp, java.lang.String stopVirtualApp, boolean requiresUI) throws java.lang.Exception
startVirtualApp
- the name of the virtual app that should be started by the service.stopVirtualApp
- the name of the virtual app to call when the service should be stopped.requiresUI
- set to true if this service requires access to the UI service.
java.lang.Exception
public static void installService(java.lang.String startVirtualApp, java.lang.String stopVirtualApp, java.net.URL overrideUpdateURL, boolean requiresUI) throws java.lang.Exception
startVirtualApp
- the name of the virtual app that should be started by the service.stopVirtualApp
- the name of the virtual app that should be called when the OS service wishes to stop the service app. This can be null.overrideUpdateURL
- a new update URL to use for the virtual app launchers, or null if no update URL overriding is required.requiresUI
- set to true if this service requires access to the UI service.
java.lang.Exception
public static boolean isServiceRunning()
public static void removeService() throws JWService.ServiceManagementException, java.io.IOException, java.lang.Exception
JWService.ServiceManagementException
java.io.IOException
java.lang.Exception
public static void setServiceRestartOnFailure(java.lang.String serviceName, boolean on, boolean neverGiveUp)
b
-