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.
|
boolean |
equals(java.lang.Object obj) |
java.lang.Integer |
getMaximumRetryCount() |
java.lang.String |
getName() |
int |
hashCode() |
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:2
RestartPolicy
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.Object
RestartPolicy
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
Copyright © 2019. All Rights Reserved.