Examples of ApplicationHandler


Examples of org.glassfish.jersey.server.ApplicationHandler

     * Create a new Grizzly HTTP container.
     *
     * @param application JAX-RS / Jersey application to be deployed on Grizzly HTTP container.
     */
    GrizzlyHttpContainer(final Application application) {
        this.appHandler = new ApplicationHandler(application, new GrizzlyBinder());
        this.containerListener = ConfigHelper.getContainerLifecycleListener(appHandler);
        cacheConfigSetStatusOverSendError();
    }
View Full Code Here

Examples of org.glassfish.jersey.server.ApplicationHandler

     * @param application   JAX-RS / Jersey application to be deployed on Grizzly HTTP container.
     * @param parentLocator {@link org.glassfish.hk2.api.ServiceLocator} to becaome a parent of the locator used
     *                      in {@link org.glassfish.jersey.server.ApplicationHandler}
     */
    GrizzlyHttpContainer(final Application application, final ServiceLocator parentLocator) {
        this.appHandler = new ApplicationHandler(application, new GrizzlyBinder(), parentLocator);
        this.containerListener = ConfigHelper.getContainerLifecycleListener(appHandler);
        cacheConfigSetStatusOverSendError();
    }
View Full Code Here

Examples of org.glassfish.jersey.server.ApplicationHandler

    }

    @Override
    public void reload(final ResourceConfig configuration) {
        this.containerListener.onShutdown(this);
        appHandler = new ApplicationHandler(configuration, new GrizzlyBinder());
        this.containerListener = ConfigHelper.getContainerLifecycleListener(appHandler);
        containerListener.onReload(this);
        containerListener.onStartup(this);
        cacheConfigSetStatusOverSendError();
    }
View Full Code Here

Examples of org.glassfish.jersey.server.ApplicationHandler

    @Override
    public void done() {
    }

    private ApplicationContext createSpringContext() {
        ApplicationHandler applicationHandler = locator.getService(ApplicationHandler.class);
        ApplicationContext springContext = (ApplicationContext) applicationHandler.getConfiguration().getProperty(PARAM_SPRING_CONTEXT);
        if (springContext == null) {
            String contextConfigLocation = (String) applicationHandler.getConfiguration().getProperty(PARAM_CONTEXT_CONFIG_LOCATION);
            springContext = createXmlSpringConfiguration(contextConfigLocation);
        }
        return springContext;
    }
View Full Code Here

Examples of org.glassfish.jersey.server.ApplicationHandler

     * Create new lightweight Java SE HTTP server container.
     *
     * @param application JAX-RS / Jersey application to be deployed on the container.
     */
    JdkHttpHandlerContainer(final Application application) {
        this.appHandler = new ApplicationHandler(application);
        this.containerListener = ConfigHelper.getContainerLifecycleListener(appHandler);
    }
View Full Code Here

Examples of org.glassfish.jersey.server.ApplicationHandler

     * Create new lightweight Java SE HTTP server container.
     *
     * @param application JAX-RS / Jersey application to be deployed on the container.
     */
    JdkHttpHandlerContainer(final Application application, final ServiceLocator parentLocator) {
        this.appHandler = new ApplicationHandler(application, null, parentLocator);
        this.containerListener = ConfigHelper.getContainerLifecycleListener(appHandler);
    }
View Full Code Here

Examples of org.glassfish.jersey.server.ApplicationHandler

    }

    @Override
    public void reload(final ResourceConfig configuration) {
        containerListener.onShutdown(this);
        appHandler = new ApplicationHandler(configuration);
        containerListener = ConfigHelper.getContainerLifecycleListener(appHandler);
        containerListener.onReload(this);
        containerListener.onStartup(this);
    }
View Full Code Here

Examples of org.glassfish.jersey.server.ApplicationHandler

    private static class ServiceLocatorShutdownListener extends AbstractContainerLifecycleListener {

        @Override
        public void onShutdown(final Container container) {
            final ApplicationHandler handler = container.getApplicationHandler();
            final ServiceLocator locator = handler.getServiceLocator();

            // Call @PreDestroy method on Application.
            locator.preDestroy(getWrappedApplication(handler.getConfiguration()));
            // Shutdown ServiceLocator.
            Injections.shutdownLocator(locator);
        }
View Full Code Here

Examples of org.glassfish.jersey.server.ApplicationHandler

public class RuntimeExecutorsBinderTest {

    private ApplicationHandler createApplication(Class<?>... classes) {
        final ResourceConfig resourceConfig = new ResourceConfig(classes);

        return new ApplicationHandler(resourceConfig);
    }
View Full Code Here

Examples of org.glassfish.jersey.server.ApplicationHandler

        }
    }

    @Test
    public void testCustomRuntimeThreadProviderSupport() throws ExecutionException, InterruptedException {
        ApplicationHandler ah = createApplication(CustomThreadProvider.class, ExecutorsTestResource.class);

        final ContainerResponse response = ah.apply(RequestContextBuilder.from("/executors-test", "GET").build()).get();

        assertEquals(200, response.getStatus());
        assertEquals("Some executor test assertions failed.", 111, response.getEntity());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.