public class ServiceConfiguration
extends java.lang.Object
implements java.io.Serializable
WinServices
. If you don't set a property the original value will be preserved for existing services.Constructor and Description |
---|
ServiceConfiguration() |
Modifier and Type | Method and Description |
---|---|
ServiceConfiguration |
binaryName(java.lang.String binaryName)
The path to the binary.
|
ServiceConfiguration |
delayedAutoStart(java.lang.Boolean delayedAutoStart)
If startType is set to AUTO, you can specify with this property that the service is started with a short delay after all other auto-start services.
|
ServiceConfiguration |
dependencies(java.lang.String dependencies)
A comma separated list of dependencies
|
ServiceConfiguration |
description(java.lang.String description)
An additional description for the service
|
ServiceConfiguration |
displayName(java.lang.String displayName)
The display name.
|
java.lang.Integer |
getMaxRestarts() |
java.lang.Integer |
getResetSeconds() |
java.lang.Integer |
getRestartMillis() |
ServiceConfiguration |
maxRestarts(int maxRestarts)
The maximum number of restarts when
restartOnFailure is set to true. |
ServiceConfiguration |
otherAccountName(java.lang.String otherAccountName)
The service account name to be used.
|
ServiceConfiguration |
otherAccountPassword(java.lang.String otherAccountPassword)
The service account password to be used.
|
ServiceConfiguration |
resetSeconds(int resetSeconds)
The time without failure in seconds after which to reset the restart counter configured with
maxRestarts . |
ServiceConfiguration |
restartMillis(int restartMillis)
The restart period when
restartOnFailure is set to true. |
ServiceConfiguration |
restartOnFailure(java.lang.Boolean restartOnFailure)
If set to true, the service will be restarted after a period defined with
restartMillis (defaults to one second) if it was terminated with an error |
ServiceConfiguration |
serviceAccount(ServiceAccount serviceAccount)
The service account to be used.
|
ServiceConfiguration |
startType(ServiceStartType startType)
The start type
|
public ServiceConfiguration binaryName(java.lang.String binaryName)
binaryName
- the binary namepublic ServiceConfiguration displayName(java.lang.String displayName)
displayName
- the display namepublic ServiceConfiguration startType(ServiceStartType startType)
startType
- the start typepublic ServiceConfiguration dependencies(java.lang.String dependencies)
dependencies
- the dependenciespublic ServiceConfiguration description(java.lang.String description)
description
- the descriptionpublic ServiceConfiguration delayedAutoStart(java.lang.Boolean delayedAutoStart)
delayedAutoStart
- true if the service start should be delayedpublic ServiceConfiguration restartOnFailure(java.lang.Boolean restartOnFailure)
restartMillis
(defaults to one second) if it was terminated with an errorrestartOnFailure
- true if a restart should be performedpublic ServiceConfiguration restartMillis(int restartMillis)
restartOnFailure
is set to true. Defaults to one second.restartMillis
- the restart period in millisecondspublic ServiceConfiguration maxRestarts(int maxRestarts)
restartOnFailure
is set to true. Defaults to 0 which means unlimited restarts. With resetSeconds
you can define the period after which this counter will be reset.
Should be a value between 0 and 2 to fit into the Windows service UI.maxRestarts
- the number of restarts to trypublic ServiceConfiguration resetSeconds(int resetSeconds)
maxRestarts
. Defaults to 0.resetSeconds
- the time in secondspublic ServiceConfiguration serviceAccount(ServiceAccount serviceAccount)
serviceAccount
- the account to be usedpublic ServiceConfiguration otherAccountName(java.lang.String otherAccountName)
otherAccountName
- the account name or SIDpublic ServiceConfiguration otherAccountPassword(java.lang.String otherAccountPassword)
otherAccountPassword
- the account passwordpublic java.lang.Integer getRestartMillis()
public java.lang.Integer getMaxRestarts()
public java.lang.Integer getResetSeconds()