Example #1
0
  @Override
  public void run(GCMDemoConfiguration gcmDemoConfiguration, Environment environment)
      throws Exception {
    AppIdDAO dao = new AppIdDAO(hibernateBundle.getSessionFactory());

    Client client =
        new JerseyClientBuilder(environment)
            .using(gcmDemoConfiguration.getJerseyClient())
            .build("GCM demo");

    environment.jersey().register(new AppServiceResource(dao));
    environment
        .jersey()
        .register(new PushNotificationResource(dao, client, gcmDemoConfiguration.getApiKey()));

    environment
        .healthChecks()
        .register("apiKey", new KeyHealthCheck(client, gcmDemoConfiguration.getApiKey()));
  }
Example #2
0
 @Override
 public DataSourceFactory getDataSourceFactory(GCMDemoConfiguration configuration) {
   return configuration.getDataSourceFactory();
 }