Java Code Examples for com.yammer.dropwizard.config.Environment#addProvider()

The following examples show how to use com.yammer.dropwizard.config.Environment#addProvider() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SocialiteService.java    From socialite with Apache License 2.0 6 votes vote down vote up
@Override
public void run(SocialiteConfiguration config, Environment environment) throws Exception {
  	        
   	// Get the configured default MongoDB URI
    MongoClientURI default_uri = config.mongodb.default_database_uri;
    
    // Initialize the services as per configuration
    ServiceManager services = new ServiceManager(config.services, default_uri);
    environment.manage(services);
           
    // Register the custom ExceptionMapper to handle ServiceExceptions
    environment.addProvider(new ServiceExceptionMapper());
    
    environment.addResource( new UserResource( services.getContentService(),
            services.getFeedService(), services.getUserGraphService() ) );
}
 
Example 2
Source File: HVDFService.java    From hvdf with Apache License 2.0 5 votes vote down vote up
@Override
public void run(HVDFConfiguration config, Environment environment) throws Exception {
  	        
   	// Get the configured default MongoDB URI
    MongoClientURI default_uri = config.mongodb.default_database_uri;
    
    // Initialize the services as per configuration
    ServiceManager services = new ServiceManager(config.services, default_uri);
    environment.manage(services);
           
    // Register the custom ExceptionMapper to handle ServiceExceptions
    environment.addProvider(new ServiceExceptionMapper());
    
    environment.addResource( new FeedResource( services.getChannelService()) );
}
 
Example 3
Source File: PizzaService.java    From jersey-hmac-auth with Apache License 2.0 4 votes vote down vote up
@Override
public void run(Configuration configuration, Environment environment) throws Exception {
    environment.addResource(new PizzaResource());
    environment.addHealthCheck(new PizzaHealthCheck());
    environment.addProvider(new HmacAuthProvider<>(new DefaultRequestHandler<>(new PizzaAuthenticator())));
}
 
Example 4
Source File: SpringSecurityProvider.java    From osiris with Apache License 2.0 2 votes vote down vote up
public void registerProvider(Environment environment) {

		registerSpringSecurityFilters(environment);

		environment.addProvider(this);
	}