Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move guice dependencies into slack-java-client-guice module #334

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
package com.hubspot.slack.client.guice;

import com.google.inject.AbstractModule;
import com.hubspot.slack.client.SlackClientFactory;
import com.hubspot.slack.client.SlackWebClient;
import com.hubspot.slack.client.http.NioHttpClient;
import com.hubspot.slack.client.http.NioHttpClientFactory;
import com.hubspot.slack.client.request.verifier.SlackRequestVerifierModule;

public class SlackClientModule extends AbstractModule {

@Override
protected void configure() {
install(new com.hubspot.slack.client.SlackClientModule());
bind(NioHttpClientFactory.class).toInstance(NioHttpClientFactory.defaultFactory());
bind(NioHttpClient.Factory.class).toInstance(NioHttpClientFactory.defaultFactory());

bind(SlackClientFactory.class).toInstance(SlackClientFactory.defaultFactory());
bind(SlackWebClient.Factory.class).toInstance(SlackClientFactory.defaultFactory());

install(new SlackRequestVerifierModule());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ protected void configure() {
binder().requireAtInjectOnConstructors();

install(new SlackClientModule());
install(new com.hubspot.slack.client.SlackClientModule());
}
}
);
Expand Down
9 changes: 0 additions & 9 deletions slack-java-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,6 @@
<artifactId>guava</artifactId>
</dependency>

<!-- temporary -->
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
</dependency>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-assistedinject</artifactId>
</dependency>
<dependency>
<groupId>com.hubspot</groupId>
<artifactId>algebra</artifactId>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Multimap;
import com.google.inject.assistedinject.Assisted;
import com.google.inject.assistedinject.AssistedInject;
import com.hubspot.algebra.Result;
import com.hubspot.horizon.HttpConfig;
import com.hubspot.horizon.HttpRequest;
Expand Down Expand Up @@ -218,16 +216,15 @@ public class SlackWebClient implements SlackClient {
private final ResponseDebugger responseDebugger;

public interface Factory {
SlackWebClient build(@Assisted SlackClientRuntimeConfig config);
SlackWebClient build(SlackClientRuntimeConfig config);
}

@AssistedInject
public SlackWebClient(
DefaultHttpRequestDebugger defaultHttpRequestDebugger,
DefaultHttpResponseDebugger defaultHttpResponseDebugger,
NioHttpClient.Factory nioHttpClientFactory,
ByMethodRateLimiter defaultRateLimiter,
@Assisted SlackClientRuntimeConfig config
SlackClientRuntimeConfig config
) {
this.nioHttpClient =
config
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package com.hubspot.slack.client.http;

import com.google.common.util.concurrent.ListenableFuture;
import com.google.inject.Inject;
import com.google.inject.assistedinject.Assisted;
import com.hubspot.horizon.AsyncHttpClient;
import com.hubspot.horizon.AsyncHttpClient.Callback;
import com.hubspot.horizon.HttpRequest;
Expand All @@ -27,11 +25,10 @@ public class NioHttpClient implements Closeable {
private final AsyncHttpClient delegate;

public interface Factory {
NioHttpClient wrap(@Assisted AsyncHttpClient delegate);
NioHttpClient wrap(AsyncHttpClient delegate);
}

@Inject
public NioHttpClient(@Assisted AsyncHttpClient delegate) {
public NioHttpClient(AsyncHttpClient delegate) {
this.delegate = delegate;
}

Expand Down

This file was deleted.

Loading