Search in sources :

Example 1 with JsonResource

use of com.example.helloworld.resources.JsonResource in project FrameworkBenchmarks by TechEmpower.

the class HelloWorldService method run.

@Override
public void run(HelloWorldConfiguration config, Environment environment) throws UnknownHostException {
    if ("com.mysql.cj.jdbc.Driver".equals(config.getDatabaseConfiguration().getDriverClass())) {
        // register below for default dropwizard test only
        // Test type 1: JSON serialization
        environment.jersey().register(new JsonResource());
        // Test type 6: Plaintext
        environment.jersey().register(new TextResource());
    }
    // Test types 2, 3 & 5: Single database query, Multiple database queries & Database updates
    environment.jersey().register(new WorldResource(new WorldHibernateImpl(hibernate.getSessionFactory())));
    // Test type 4: Fortunes
    environment.jersey().register(new FortuneResource(new FortuneHibernateImpl(hibernate.getSessionFactory())));
}
Also used : TextResource(com.example.helloworld.resources.TextResource) WorldResource(com.example.helloworld.resources.WorldResource) FortuneResource(com.example.helloworld.resources.FortuneResource) JsonResource(com.example.helloworld.resources.JsonResource) FortuneHibernateImpl(com.example.helloworld.db.hibernate.FortuneHibernateImpl) WorldHibernateImpl(com.example.helloworld.db.hibernate.WorldHibernateImpl)

Aggregations

FortuneHibernateImpl (com.example.helloworld.db.hibernate.FortuneHibernateImpl)1 WorldHibernateImpl (com.example.helloworld.db.hibernate.WorldHibernateImpl)1 FortuneResource (com.example.helloworld.resources.FortuneResource)1 JsonResource (com.example.helloworld.resources.JsonResource)1 TextResource (com.example.helloworld.resources.TextResource)1 WorldResource (com.example.helloworld.resources.WorldResource)1