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)
Deprecated.
|
void |
registerNetworkIdForCleanup(String id)
Register a network to be cleaned up at JVM shutdown.
|
void |
removeNetworkById(String id)
Removes a network by ID.
|
void |
removeNetworks(String identifier)
Deprecated.
|
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.
|
void |
unregisterContainer(String identifier) |
void |
unregisterNetwork(String identifier) |
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 registerNetworkIdForCleanup(String id)
id
- the ID of the network@Deprecated public void registerNetworkForCleanup(String networkName)
registerNetworkIdForCleanup(String)
networkName
- the name of the networkpublic void removeNetworkById(String id)
id
- @Deprecated public void removeNetworks(String identifier)
removeNetworkById(String)
identifier
- public void unregisterNetwork(String identifier)
public void unregisterContainer(String identifier)
Copyright © 2017. All rights reserved.