use of org.glassfish.jersey.server.ApplicationHandler in project jersey by jersey.
the class JettyHttpContainer method reload.
@Override
public void reload(final ResourceConfig configuration) {
appHandler.onShutdown(this);
appHandler = new ApplicationHandler(configuration.register(new JettyBinder()));
appHandler.onReload(this);
appHandler.onStartup(this);
cacheConfigSetStatusOverSendError();
}
use of org.glassfish.jersey.server.ApplicationHandler in project jersey by jersey.
the class NettyHttpContainer method reload.
@Override
public void reload(ResourceConfig configuration) {
appHandler.onShutdown(this);
appHandler = new ApplicationHandler(configuration);
appHandler.onReload(this);
appHandler.onStartup(this);
}
use of org.glassfish.jersey.server.ApplicationHandler in project jersey by jersey.
the class ContextBasedInjectionTest method setupApplication.
@Before
public void setupApplication() {
ResourceConfig rc = new ResourceConfig();
Resource.Builder rb;
rb = Resource.builder("a/b/c");
rb.addMethod("GET").handledBy(new AsyncInflector("A-B-C"));
rc.registerResources(rb.build());
rb = Resource.builder("a/b/d");
rb.addMethod("GET").handledBy(new AsyncInflector("A-B-D"));
rc.registerResources(rb.build());
app = new ApplicationHandler(rc);
}
use of org.glassfish.jersey.server.ApplicationHandler in project jersey by jersey.
the class LayeredFiltersTest method testResourceSubresourceMethodMultiple.
@Test
public void testResourceSubresourceMethodMultiple() throws ExecutionException, InterruptedException {
final ResourceConfig resourceConfig = new ResourceConfig(ResourceWithMethodMultiple.class).register(FilterOne.class).register(FilterTwo.class);
final ApplicationHandler application = new ApplicationHandler(resourceConfig);
final ContainerResponse response = application.apply(RequestContextBuilder.from("/submethod", "GET").build()).get();
assertEquals(200, response.getStatus());
assertEquals("onetwo", response.getEntity());
List<Object> xTest = response.getHeaders().get("X-TEST");
assertEquals(2, xTest.size());
assertEquals("two", xTest.get(0));
assertEquals("one", xTest.get(1));
}
use of org.glassfish.jersey.server.ApplicationHandler in project jersey by jersey.
the class BackgroundSchedulerProviderTest method testCustomRuntimeThreadProviderSupport.
@Test
public void testCustomRuntimeThreadProviderSupport() throws ExecutionException, InterruptedException {
ApplicationHandler ah = createApplication(CustomThreadProvider.class, TestResource.class);
final ContainerResponse response = ah.apply(RequestContextBuilder.from("/executors-test", "GET").build()).get();
assertEquals(200, response.getStatus());
assertEquals("Some executor test assertions failed.", 11, response.getEntity());
}
Aggregations