Skip to content

Instantly share code, notes, and snippets.

@GuiSim
Last active January 26, 2017 22:09
Show Gist options
  • Save GuiSim/04a006e65831314f8cf7cf66843d2740 to your computer and use it in GitHub Desktop.
Save GuiSim/04a006e65831314f8cf7cf66843d2740 to your computer and use it in GitHub Desktop.

Revisions

  1. GuiSim revised this gist Jan 26, 2017. 1 changed file with 9 additions and 4 deletions.
    13 changes: 9 additions & 4 deletions MyServiceClient.java
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,14 @@
    public class MyServiceClient {
    @Inject
    public MyServiceClient(@Named("service.endpoint") Prop<String> endpoint,
    @Named("service.username") Prop<String> username,
    @Named("service.password") Prop<String> password,
    @Named("service.readTimeout") Prop<Duration> readTimeout) {

    @Named("service.readTimeout") Prop<Duration> readTimeout,
    HttpClient httpClient) {
    this.endpoint = endpoint;
    this.readTimeout = readTimeout;
    this.httpClient = httpClient;
    }

    public void getSomething() {
    httpClient.post(endpoint.get()).withTimeout(readTimeout.get());
    }
    }
  2. GuiSim renamed this gist Jan 26, 2017. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. GuiSim created this gist Jan 26, 2017.
    9 changes: 9 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    public class MyServiceClient {
    @Inject
    public MyServiceClient(@Named("service.endpoint") Prop<String> endpoint,
    @Named("service.username") Prop<String> username,
    @Named("service.password") Prop<String> password,
    @Named("service.readTimeout") Prop<Duration> readTimeout) {

    }
    }