public class DockerHelper extends PortMapper implements Initializable, Killable
This basically uses docker.file from the system config to determine which compser file to use and start / stops docker for each test run or staging environment.
Also it provides a PortMapper
to map the desired production ports to the
ones provided by the docker containers.
DEFAULT_PRIORITY
Constructor and Description |
---|
DockerHelper() |
Modifier and Type | Method and Description |
---|---|
void |
awaitTermination()
Called after
Stoppable.stopped() has been called to wait until all tasks are fully finished. |
int |
getPriority()
Returns the priority of this element.
|
void |
initialize()
Invoked by the injector once the system is completely initialized.
|
protected Tuple<String,Integer> |
map(String service,
String host,
int port)
Maps the given port for the given service.
|
mapPort, setMapper
public int getPriority()
Priorized
getPriority
in interface Priorized
getPriority
in interface Killable
protected Tuple<String,Integer> map(String service, String host, int port)
PortMapper
map
in class PortMapper
service
- the service used to identify to container which provides the servicehost
- the host to mapport
- the port to mappublic void initialize() throws Exception
Initializable
Can be used to perform initial actions where access to dependent parts is required.
initialize
in interface Initializable
Exception
- in case of any error during the initialization.public void awaitTermination()
Killable
Stoppable.stopped()
has been called to wait until all tasks are fully finished.
This method may block for a certain amount of time to permit the subsystem to shut down properly. However, it should not block infinitely...
awaitTermination
in interface Killable
Copyright © 2018. All rights reserved.