Skip to content

Commit 9fcfee3

Browse files
author
Marcus Linke
committed
Merge branch 'master' into issue-246
2 parents 10a5907 + 2a4bf8a commit 9fcfee3

File tree

4 files changed

+9
-36
lines changed

4 files changed

+9
-36
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
Change Log
22
===
3-
Latest SNAPSHOT version
3+
v2.1.2
44
---
5+
* [#350] (https://github.com/docker-java/docker-java/pull/350) Remove ServiceLoader logic
56
* [#344] (https://github.com/docker-java/docker-java/pull/344) Implement equals/hashCode for Filters
67
* [#335] (https://github.com/docker-java/docker-java/pull/335) Improve backward-compatibility support for older API versions
78
* [#333] (https://github.com/docker-java/docker-java/pull/333) Adding support for withPidMode

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ listening on TCP port. To allow Docker server to use TCP add the following line
3636

3737
DOCKER_OPTS="-H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock"
3838

39-
However you can force docker-java to use UNIX socket communication by configure the following url:
39+
However you can force docker-java to use UNIX socket communication by configuring the following url:
4040

4141
unix:///var/run/docker.sock
4242

43-
More details setting up Docker server can be found in official documentation: http://docs.docker.io/en/latest/use/basics/
43+
More details about setting up Docker server can be found in official documentation: http://docs.docker.io/en/latest/use/basics/
4444

4545
Now make sure that docker is up:
4646

@@ -64,7 +64,7 @@ Run build without integration tests:
6464
<dependency>
6565
<groupId>com.github.docker-java</groupId>
6666
<artifactId>docker-java</artifactId>
67-
<version>2.1.1</version>
67+
<version>2.1.2</version>
6868
</dependency>
6969

7070
### Latest SNAPSHOT version
@@ -74,7 +74,7 @@ You can find the latest SNAPSHOT version including javadoc and source files on [
7474
<dependency>
7575
<groupId>com.github.docker-java</groupId>
7676
<artifactId>docker-java</artifactId>
77-
<version>2.1.2-SNAPSHOT</version>
77+
<version>2.1.3-SNAPSHOT</version>
7878
</dependency>
7979

8080
## Documentation

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<groupId>com.github.docker-java</groupId>
1111
<artifactId>docker-java</artifactId>
1212
<packaging>jar</packaging>
13-
<version>2.1.2-SNAPSHOT</version>
13+
<version>2.1.3-SNAPSHOT</version>
1414

1515
<name>docker-java</name>
1616
<url>https://github.com/docker-java/docker-java</url>

src/main/java/com/github/dockerjava/core/DockerClientBuilder.java

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,12 @@
11
package com.github.dockerjava.core;
22

3-
import java.util.Iterator;
4-
import java.util.ServiceLoader;
5-
63
import com.github.dockerjava.api.DockerClient;
74
import com.github.dockerjava.api.command.DockerCmdExecFactory;
85
import com.github.dockerjava.core.DockerClientConfig.DockerClientConfigBuilder;
6+
import com.github.dockerjava.jaxrs.DockerCmdExecFactoryImpl;
97

108
public class DockerClientBuilder {
119

12-
private static Class<? extends DockerCmdExecFactory> factoryClass;
13-
14-
private static ServiceLoader<DockerCmdExecFactory> serviceLoader = ServiceLoader.load(DockerCmdExecFactory.class);
15-
16-
static {
17-
serviceLoader.reload();
18-
Iterator<DockerCmdExecFactory> iterator = serviceLoader.iterator();
19-
if (iterator.hasNext()) {
20-
factoryClass = iterator.next().getClass();
21-
}
22-
}
23-
2410
private DockerClientImpl dockerClient = null;
2511

2612
private DockerCmdExecFactory dockerCmdExecFactory = null;
@@ -46,28 +32,14 @@ public static DockerClientBuilder getInstance(String serverUrl) {
4632
}
4733

4834
public static DockerCmdExecFactory getDefaultDockerCmdExecFactory() {
49-
if (factoryClass == null) {
50-
throw new RuntimeException("Fatal: Can't find any implementation of '"
51-
+ DockerCmdExecFactory.class.getName() + "' in the current classpath.");
52-
}
53-
54-
try {
55-
return factoryClass.newInstance();
56-
} catch (InstantiationException | IllegalAccessException e) {
57-
throw new RuntimeException("Fatal: Can't create new instance of '" + factoryClass.getName() + "'");
58-
}
35+
return new DockerCmdExecFactoryImpl();
5936
}
6037

6138
public DockerClientBuilder withDockerCmdExecFactory(DockerCmdExecFactory dockerCmdExecFactory) {
6239
this.dockerCmdExecFactory = dockerCmdExecFactory;
6340
return this;
6441
}
6542

66-
public DockerClientBuilder withServiceLoaderClassLoader(ClassLoader classLoader) {
67-
serviceLoader = ServiceLoader.load(DockerCmdExecFactory.class, classLoader);
68-
return this;
69-
}
70-
7143
public DockerClient build() {
7244
if (dockerCmdExecFactory != null) {
7345
dockerClient.withDockerCmdExecFactory(dockerCmdExecFactory);

0 commit comments

Comments
 (0)