Search in sources :

Example 86 with ApplicationHandler

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

the class JsonProcessingAutoDiscoverableServerTest method _test.

private void _test(final String response, final Boolean globalDisable, final Boolean serverDisable) throws Exception {
    final ResourceConfig resourceConfig = new ResourceConfig(Resource.class, Filter.class);
    if (globalDisable != null) {
        resourceConfig.property(CommonProperties.JSON_PROCESSING_FEATURE_DISABLE, globalDisable);
    }
    if (serverDisable != null) {
        resourceConfig.property(ServerProperties.JSON_PROCESSING_FEATURE_DISABLE, serverDisable);
    }
    final ApplicationHandler app = new ApplicationHandler(resourceConfig);
    final URI baseUri = URI.create("/");
    assertEquals(response, app.apply(new ContainerRequest(baseUri, baseUri, "GET", null, new MapPropertiesDelegate())).get().getEntity());
}
Also used : MapPropertiesDelegate(org.glassfish.jersey.internal.MapPropertiesDelegate) ApplicationHandler(org.glassfish.jersey.server.ApplicationHandler) ContainerRequest(org.glassfish.jersey.server.ContainerRequest) ResourceConfig(org.glassfish.jersey.server.ResourceConfig) URI(java.net.URI)

Example 87 with ApplicationHandler

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

the class GrizzlyHttpContainer method reload.

@Override
public void reload(final ResourceConfig configuration) {
    appHandler.onShutdown(this);
    appHandler = new ApplicationHandler(configuration, new GrizzlyBinder());
    appHandler.onReload(this);
    appHandler.onStartup(this);
    cacheConfigSetStatusOverSendError();
    cacheConfigEnableLeadingContextPathSlashes();
}
Also used : ApplicationHandler(org.glassfish.jersey.server.ApplicationHandler)

Example 88 with ApplicationHandler

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

the class SimpleContainer method reload.

@Override
public void reload(final ResourceConfig configuration) {
    appHandler.onShutdown(this);
    appHandler = new ApplicationHandler(configuration.register(new SimpleBinder()));
    scheduler = new ScheduledThreadPoolExecutor(2, new DaemonFactory(TimeoutDispatcher.class));
    appHandler.onReload(this);
    appHandler.onStartup(this);
}
Also used : ScheduledThreadPoolExecutor(java.util.concurrent.ScheduledThreadPoolExecutor) ApplicationHandler(org.glassfish.jersey.server.ApplicationHandler) DaemonFactory(org.simpleframework.common.thread.DaemonFactory)

Example 89 with ApplicationHandler

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

the class JdkHttpHandlerContainer method reload.

@Override
public void reload(final ResourceConfig configuration) {
    appHandler.onShutdown(this);
    appHandler = new ApplicationHandler(configuration);
    appHandler.onReload(this);
    appHandler.onStartup(this);
}
Also used : ApplicationHandler(org.glassfish.jersey.server.ApplicationHandler)

Example 90 with ApplicationHandler

use of org.glassfish.jersey.server.ApplicationHandler in project divide by HiddenStage.

the class AuthServerHelper method init.

public void init(String url) throws Exception {
    URI uri = URI.create(url);
    ApplicationHandler h = new ApplicationHandler(TestApplication.class);
    WebContainerFactory factory = new WebContainerFactory();
    factory.enableEncrementPort(false);
    container = factory.create(uri, h);
    container.start();
}
Also used : ApplicationHandler(org.glassfish.jersey.server.ApplicationHandler) URI(java.net.URI)

Aggregations

ApplicationHandler (org.glassfish.jersey.server.ApplicationHandler)162 Test (org.junit.Test)142 ResourceConfig (org.glassfish.jersey.server.ResourceConfig)104 ContainerResponse (org.glassfish.jersey.server.ContainerResponse)99 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 ContainerRequestContext (javax.ws.rs.container.ContainerRequestContext)12 Response (javax.ws.rs.core.Response)10 MediaType (javax.ws.rs.core.MediaType)8 ContainerRequest (org.glassfish.jersey.server.ContainerRequest)7 MonitoringFeature (org.glassfish.jersey.server.internal.monitoring.MonitoringFeature)6 Resource (org.glassfish.jersey.server.model.Resource)6 ContainerResponseFilter (javax.ws.rs.container.ContainerResponseFilter)5 ArrayList (java.util.ArrayList)4 Ignore (org.junit.Ignore)4 IOException (java.io.IOException)3 ContainerRequestFilter (javax.ws.rs.container.ContainerRequestFilter)3 Inflector (org.glassfish.jersey.process.Inflector)3 Before (org.junit.Before)3