Search in sources :

Example 1 with GuiceServiceDiscovery

use of io.crnk.guice.GuiceServiceDiscovery in project crnk-framework by crnk-project.

the class DropwizardService method run.

@Override
public void run(DropwizardConfiguration dropwizardConfiguration, Environment environment) throws Exception {
    environment.lifecycle().manage(guiceBundle.getInjector().getInstance(MongoManaged.class));
    CrnkFeature crnkFeature = new CrnkFeature();
    crnkFeature.getBoot().setObjectMapper(environment.getObjectMapper());
    crnkFeature.getBoot().setServiceDiscovery(new GuiceServiceDiscovery(guiceBundle.getInjector()));
    environment.jersey().register(crnkFeature);
}
Also used : GuiceServiceDiscovery(io.crnk.guice.GuiceServiceDiscovery) CrnkFeature(io.crnk.rs.CrnkFeature) MongoManaged(io.crnk.example.dropwizard.mongo.managed.MongoManaged)

Example 2 with GuiceServiceDiscovery

use of io.crnk.guice.GuiceServiceDiscovery in project crnk-framework by crnk-project.

the class GuiceServiceDiscoveryTest method setup.

@Before
public void setup() {
    Injector injector = Guice.createInjector(new TestModule());
    discovery = new GuiceServiceDiscovery(injector);
}
Also used : GuiceServiceDiscovery(io.crnk.guice.GuiceServiceDiscovery) Injector(com.google.inject.Injector) Before(org.junit.Before)

Aggregations

GuiceServiceDiscovery (io.crnk.guice.GuiceServiceDiscovery)2 Injector (com.google.inject.Injector)1 MongoManaged (io.crnk.example.dropwizard.mongo.managed.MongoManaged)1 CrnkFeature (io.crnk.rs.CrnkFeature)1 Before (org.junit.Before)1