Search in sources :

Example 66 with ResourceConfig

use of org.glassfish.jersey.server.ResourceConfig in project jersey by jersey.

the class NonJaxRsBeanJaxRsInjectionTest method startGrizzlyContainer.

private void startGrizzlyContainer() throws IOException {
    final ResourceConfig firstConfig = ResourceConfig.forApplicationClass(MainApplication.class);
    final ResourceConfig secondConfig = ResourceConfig.forApplicationClass(SecondaryApplication.class);
    httpServer = GrizzlyHttpServerFactory.createHttpServer(MAIN_APP_URI, firstConfig, false);
    final HttpHandler secondHandler = createGrizzlyContainer(secondConfig);
    httpServer.getServerConfiguration().addHttpHandler(secondHandler, SECONDARY_URI);
    httpServer.start();
}
Also used : HttpHandler(org.glassfish.grizzly.http.server.HttpHandler) ResourceConfig(org.glassfish.jersey.server.ResourceConfig)

Example 67 with ResourceConfig

use of org.glassfish.jersey.server.ResourceConfig in project jersey by jersey.

the class CombinedTest method startGrizzlyContainer.

private void startGrizzlyContainer() throws IOException {
    final ResourceConfig cdiConfig = ResourceConfig.forApplicationClass(CdiApplication.class);
    final ResourceConfig hk2Config = ResourceConfig.forApplicationClass(Hk2Application.class);
    cdiServer = GrizzlyHttpServerFactory.createHttpServer(BASE_CDI_URI, cdiConfig, false);
    final HttpHandler hk2Handler = createGrizzlyContainer(hk2Config);
    cdiServer.getServerConfiguration().addHttpHandler(hk2Handler, HK2_URI);
    cdiServer.start();
}
Also used : HttpHandler(org.glassfish.grizzly.http.server.HttpHandler) ResourceConfig(org.glassfish.jersey.server.ResourceConfig)

Example 68 with ResourceConfig

use of org.glassfish.jersey.server.ResourceConfig in project jersey by jersey.

the class ErrorTest method configure.

@Override
protected Application configure() {
    ResourceConfig config = new ResourceConfig(ErrorResource.class);
    config.register(new LoggingFeature(LOGGER, LoggingFeature.Verbosity.PAYLOAD_ANY));
    return config;
}
Also used : LoggingFeature(org.glassfish.jersey.logging.LoggingFeature) ResourceConfig(org.glassfish.jersey.server.ResourceConfig)

Example 69 with ResourceConfig

use of org.glassfish.jersey.server.ResourceConfig in project jersey by jersey.

the class FollowRedirectsTest method configure.

@Override
protected Application configure() {
    ResourceConfig config = new ResourceConfig(RedirectResource.class);
    config.register(new LoggingFeature(LOGGER, LoggingFeature.Verbosity.PAYLOAD_ANY));
    return config;
}
Also used : LoggingFeature(org.glassfish.jersey.logging.LoggingFeature) ResourceConfig(org.glassfish.jersey.server.ResourceConfig)

Example 70 with ResourceConfig

use of org.glassfish.jersey.server.ResourceConfig in project jersey by jersey.

the class HelloWorldTest method configure.

@Override
protected Application configure() {
    ResourceConfig config = new ResourceConfig(HelloWorldResource.class);
    config.register(new LoggingFeature(LOGGER, LoggingFeature.Verbosity.PAYLOAD_ANY));
    return config;
}
Also used : LoggingFeature(org.glassfish.jersey.logging.LoggingFeature) ResourceConfig(org.glassfish.jersey.server.ResourceConfig)

Aggregations

ResourceConfig (org.glassfish.jersey.server.ResourceConfig)357 Test (org.junit.Test)135 ApplicationHandler (org.glassfish.jersey.server.ApplicationHandler)105 ContainerResponse (org.glassfish.jersey.server.ContainerResponse)62 LoggingFeature (org.glassfish.jersey.logging.LoggingFeature)33 ServletContainer (org.glassfish.jersey.servlet.ServletContainer)29 Response (javax.ws.rs.core.Response)28 HttpServer (org.glassfish.grizzly.http.server.HttpServer)28 Resource (org.glassfish.jersey.server.model.Resource)24 URI (java.net.URI)23 ServletHolder (org.eclipse.jetty.servlet.ServletHolder)23 IOException (java.io.IOException)22 ContainerRequestContext (javax.ws.rs.container.ContainerRequestContext)22 ServletContextHandler (org.eclipse.jetty.servlet.ServletContextHandler)18 Server (org.eclipse.jetty.server.Server)17 ApplicationInfoListener (org.glassfish.jersey.server.internal.monitoring.ApplicationInfoListener)17 MonitoringEventListener (org.glassfish.jersey.server.internal.monitoring.MonitoringEventListener)17 MBeanExposer (org.glassfish.jersey.server.internal.monitoring.jmx.MBeanExposer)17 MetricRegistry (com.codahale.metrics.MetricRegistry)15 ContainerRequest (org.glassfish.jersey.server.ContainerRequest)15