@Override public void run(HelloWorldConfiguration configuration, Environment environment) throws Exception { final HelloWorldResource resource = new HelloWorldResource(configuration.getTemplate(), configuration.getDefaultName()); final TemplateHealthCheck healthCheck = new TemplateHealthCheck(configuration.getTemplate()); environment.healthChecks().register("template", healthCheck); environment.jersey().register(resource); }
public void run(HelloWorldConfiguration configuration, Environment environment) throws Exception { final PersonDAO personDao = new PersonDAO(hibernateBundle.getSessionFactory()); final HelloWorldResource helloWorldResource = new HelloWorldResource(configuration.getTemplate(), configuration.getDefaultName()); final TemplateHealthCheck healthCheck = new TemplateHealthCheck(configuration.getTemplate()); environment.healthChecks().register("template", healthCheck); environment.jersey().register(helloWorldResource); environment.jersey().register(new PeopleResource(personDao)); environment.jersey().register(new PersonResource(personDao)); }
@Override public void run(HelloWorldConfiguration configuration, Environment environment) throws ClassNotFoundException { final UserDAO dao = new UserDAO(hibernateBundle.getSessionFactory()); final Client client = new JerseyClientBuilder(environment) .using(configuration.getJerseyClient()) .build(getName()); final ClientSecretsConfiguration clientSecrets = configuration.getClientSecrets(); environment.jersey().register(new ClientResource()); environment.jersey().register(new UserResource(dao)); environment.jersey().register(new AuthResource(client, dao, clientSecrets)); environment .servlets() .addFilter("AuthFilter", new AuthFilter()) .addMappingForUrlPatterns(null, true, "/api/me"); }
@Override public DataSourceFactory getDataSourceFactory(HelloWorldConfiguration configuration) { return configuration.getDataSourceFactory(); }