public class RestartPolicy
extends java.lang.Object
implements java.io.Serializable
| Constructor and Description |
|---|
RestartPolicy() |
| Modifier and Type | Method and Description |
|---|---|
static RestartPolicy |
alwaysRestart()
Always restart the container no matter what exit code is returned.
|
java.lang.Integer |
getMaximumRetryCount() |
java.lang.String |
getName() |
static RestartPolicy |
noRestart()
Do not restart the container if it dies.
|
static RestartPolicy |
onFailureRestart(int maximumRetryCount)
Restart the container if it exits with a non-zero exit code.
|
static RestartPolicy |
parse(java.lang.String serialized)
Parses a textual restart polixy specification (as used by the Docker CLI) to a
RestartPolicy. |
java.lang.String |
toString()
Returns a string representation of this
RestartPolicy. |
static RestartPolicy |
unlessStoppedRestart()
Restart the container unless it has been stopped
|
public static RestartPolicy noRestart()
public static RestartPolicy alwaysRestart()
public static RestartPolicy onFailureRestart(int maximumRetryCount)
maximumRetryCount - the maximum number of restarts. Set to 0 for unlimited retries.public static RestartPolicy unlessStoppedRestart()
public java.lang.Integer getMaximumRetryCount()
public java.lang.String getName()
public static RestartPolicy parse(java.lang.String serialized) throws java.lang.IllegalArgumentException
RestartPolicy.serialized - the specification, e.g. on-failure:2RestartPolicy matching the specificationjava.lang.IllegalArgumentException - if the specification cannot be parsedpublic java.lang.String toString()
RestartPolicy. The format is name[:count], like the argument in
parse(String).toString in class java.lang.ObjectRestartPolicyCopyright © 2020. All Rights Reserved.