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

use dropwizard-guicier 0.7.1.2 #751

Merged
merged 3 commits into from
Nov 17, 2015
Merged
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
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