public final class ResourceReaper extends Object
Modifier and Type | Method and Description |
---|---|
static ResourceReaper |
instance() |
void |
performCleanup()
Perform a cleanup.
|
void |
registerContainerForCleanup(String containerId,
String imageName)
Register a container to be cleaned up, either on explicit call to stopAndRemoveContainer, or at JVM shutdown.
|
void |
registerNetworkForCleanup(String networkName)
Register a network to be cleaned up at JVM shutdown.
|
void |
removeNetworks(String identifier)
Removes any networks that contain the identifier.
|
void |
stopAndRemoveContainer(String containerId)
Stop a potentially running container and remove it, including associated volumes.
|
void |
stopAndRemoveContainer(String containerId,
String imageName)
Stop a potentially running container and remove it, including associated volumes.
|
public static ResourceReaper instance()
public void performCleanup()
public void registerContainerForCleanup(String containerId, String imageName)
containerId
- the ID of the containerimageName
- the image name of the container (used for logging)public void stopAndRemoveContainer(String containerId)
containerId
- the ID of the containerpublic void stopAndRemoveContainer(String containerId, String imageName)
containerId
- the ID of the containerimageName
- the image name of the container (used for logging)public void registerNetworkForCleanup(String networkName)
networkName
- the image name of the networkpublic void removeNetworks(String identifier)
identifier
- Copyright © 2017. All rights reserved.