use of org.eclipse.linuxtools.docker.core.DockerOpenConnectionException in project linuxtools by eclipse.
the class DockerConnection method open.
@Override
public void open(boolean registerContainerRefreshManager) throws DockerException {
// to the same Docker daemon
synchronized (this) {
if (this.client == null) {
try {
setClient(dockerClientFactory.getClient(this.connectionSettings));
if (registerContainerRefreshManager) {
// Add the container refresh manager to watch the
// containers
// list
DockerContainerRefreshManager dcrm = DockerContainerRefreshManager.getInstance();
addContainerListener(dcrm);
}
} catch (DockerCertificateException e) {
setState(EnumDockerConnectionState.CLOSED);
throw new DockerOpenConnectionException(NLS.bind(Messages.Open_Connection_Failure, this.name, this.getUri()), e);
}
}
// then try to ping the Docker daemon to verify the connection
ping();
}
}
Aggregations