Skip to content

Commit

Permalink
Merge pull request #751 from HubSpot/guicier
Browse files Browse the repository at this point in the history
use dropwizard-guicier 0.7.1.2
  • Loading branch information
Tom Petr committed Nov 17, 2015
2 parents 4c898d1 + 8711764 commit 5ced360
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 421 deletions.
20 changes: 5 additions & 15 deletions SingularityService/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@
<artifactId>protobuf-java</artifactId>
</dependency>

<dependency>
<groupId>com.hubspot.dropwizard</groupId>
<artifactId>dropwizard-guicier</artifactId>
</dependency>

<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
Expand Down Expand Up @@ -157,11 +162,6 @@
<artifactId>async-http-client</artifactId>
</dependency>

<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-servlets</artifactId>
</dependency>

<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-jdbi</artifactId>
Expand Down Expand Up @@ -273,16 +273,6 @@
<artifactId>jersey-server</artifactId>
</dependency>

<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-servlet</artifactId>
</dependency>

<dependency>
<groupId>com.sun.jersey.contribs</groupId>
<artifactId>jersey-guice</artifactId>
</dependency>

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.google.common.base.Optional;
import com.google.inject.Binder;
import com.google.inject.Module;
import com.google.inject.Scopes;
import com.google.inject.TypeLiteral;
import com.hubspot.singularity.auth.SingularityAuthorizationHelper;
import com.hubspot.singularity.auth.authenticator.SingularityAuthenticator;
Expand All @@ -21,6 +22,6 @@ public void configure(Binder binder) {
binder.bind(SingularityAuthenticator.class).to(configuration.getAuthConfiguration().getAuthenticator().getAuthenticatorClass());
binder.bind(SingularityAuthDatastore.class).to(configuration.getAuthConfiguration().getDatastore().getAuthDatastoreClass());
binder.bind(new TypeLiteral<Optional<SingularityUser>>() {}).toProvider(SingularityAuthenticator.class);
binder.bind(SingularityAuthorizationHelper.class);
binder.bind(SingularityAuthorizationHelper.class).in(Scopes.SINGLETON);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@

public class SingularityMainModule implements Module {

public static final String HOSTNAME_PROPERTY = "singularity.hostname";
public static final String HTTP_PORT_PROPERTY = "singularity.http.port";

public static final String TASK_TEMPLATE = "task.template";
public static final String REQUEST_IN_COOLDOWN_TEMPLATE = "request.in.cooldown.template";
public static final String REQUEST_MODIFIED_TEMPLATE = "request.modified.template";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,11 @@
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.datatype.guava.GuavaModule;
import com.google.common.collect.ImmutableList;
import com.google.inject.Binder;
import com.google.inject.Module;
import com.hubspot.dropwizard.guicier.GuiceBundle;
import com.hubspot.jackson.datatype.protobuf.ProtobufModule;
import com.hubspot.singularity.bundles.CorsBundle;
import com.hubspot.singularity.config.SingularityConfiguration;
import com.hubspot.singularity.guice.BootstrapAwareModule;
import com.hubspot.singularity.guice.GuiceBundle;
import com.palominolabs.metrics.guice.MetricsInstrumentationModule;

import io.dropwizard.Application;
import io.dropwizard.Bundle;
Expand All @@ -38,12 +35,6 @@ public void initialize(final Bootstrap<T> bootstrap) {

final GuiceBundle<SingularityConfiguration> guiceBundle = GuiceBundle.defaultBuilder(SingularityConfiguration.class)
.modules(new SingularityServiceModule())
.modules(new BootstrapAwareModule() {
@Override
protected void configure(Binder binder, Bootstrap<?> bootstrap) {
binder.install(new MetricsInstrumentationModule(bootstrap.getMetricRegistry()));
}
})
.modules(additionalModules)
.build();
bootstrap.addBundle(guiceBundle);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,36 +1,39 @@
package com.hubspot.singularity;

import com.google.inject.Binder;
import com.hubspot.dropwizard.guicier.DropwizardAwareModule;
import com.hubspot.mesos.client.SingularityMesosClientModule;
import com.hubspot.singularity.config.SingularityConfiguration;
import com.hubspot.singularity.data.SingularityDataModule;
import com.hubspot.singularity.data.history.SingularityHistoryModule;
import com.hubspot.singularity.data.transcoders.SingularityTranscoderModule;
import com.hubspot.singularity.data.zkmigrations.SingularityZkMigrationsModule;
import com.hubspot.singularity.event.SingularityEventModule;
import com.hubspot.singularity.guice.ConfigurationAwareModule;
import com.hubspot.singularity.jersey.SingularityJerseyModule;
import com.hubspot.singularity.mesos.SingularityMesosModule;
import com.hubspot.singularity.resources.SingularityResourceModule;
import com.hubspot.singularity.scheduler.SingularitySchedulerModule;
import com.palominolabs.metrics.guice.MetricsInstrumentationModule;

public class SingularityServiceModule extends ConfigurationAwareModule<SingularityConfiguration> {
public class SingularityServiceModule extends DropwizardAwareModule<SingularityConfiguration> {

@Override
protected void configure(Binder binder, SingularityConfiguration configuration) {
binder.install(new SingularityMainModule(configuration));
public void configure(Binder binder) {
binder.install(new MetricsInstrumentationModule(getBootstrap().getMetricRegistry()));

binder.install(new SingularityMainModule(getConfiguration()));
binder.install(new SingularityDataModule());
binder.install(new SingularitySchedulerModule());
binder.install(new SingularityResourceModule(configuration.getUiConfiguration()));
binder.install(new SingularityResourceModule(getConfiguration().getUiConfiguration()));
binder.install(new SingularityTranscoderModule());
binder.install(new SingularityHistoryModule(configuration));
binder.install(new SingularityHistoryModule(getConfiguration()));
binder.install(new SingularityMesosModule());
binder.install(new SingularityZkMigrationsModule());
binder.install(new SingularityMesosClientModule());
binder.install(new SingularityJerseyModule());

binder.install(new SingularityEventModule(configuration));
binder.install(new SingularityEventModule(getConfiguration()));

binder.install(new SingularityAuthModule(configuration));
binder.install(new SingularityAuthModule(getConfiguration()));
}
}

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 5ced360

Please sign in to comment.