org.glassfish.jersey.server.spi.Container Java Examples

The following examples show how to use org.glassfish.jersey.server.spi.Container. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DefaultContainerLifecycleListener.java    From jweb-cms with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public void onStartup(Container container) {
    InjectionManager injectionManager = container.getApplicationHandler().getInjectionManager();
    if (injectionManager instanceof ImmediateHk2InjectionManager) {
        app.serviceLocator = ((ImmediateHk2InjectionManager) injectionManager).getServiceLocator();
    } else if (injectionManager instanceof DelayedHk2InjectionManager) {
        app.serviceLocator = ((DelayedHk2InjectionManager) injectionManager).getServiceLocator();
    } else {
        throw new ApplicationException("unknown injection manager");
    }
    app.onStartup();
}
 
Example #2
Source File: RequestBuilderImpl.java    From jweb-cms with GNU Affero General Public License v3.0 5 votes vote down vote up
public RequestBuilderImpl(String httpMethod, URI requestURI, Container container) {

        this.httpMethod = httpMethod;
        this.requestURI = requestURI;
        this.container = container;
        this.applicationHandler = container.getApplicationHandler();
    }
 
Example #3
Source File: ConfigHelper.java    From ameba with MIT License 5 votes vote down vote up
@Override
public void onShutdown(final Container container) {
    final ApplicationHandler handler = container.getApplicationHandler();
    final InjectionManager injectionManager = handler.getInjectionManager();

    // Call @PreDestroy method on Application.
    injectionManager.preDestroy(getWrappedApplication(handler.getConfiguration()));
    // Shutdown ServiceLocator.
    injectionManager.shutdown();
}
 
Example #4
Source File: DefaultContainerLifecycleListener.java    From jweb-cms with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public void onShutdown(Container container) {
    app.onShutdown();
}
 
Example #5
Source File: MockContainerResponseWriter.java    From jweb-cms with GNU Affero General Public License v3.0 4 votes vote down vote up
MockContainerResponseWriter(RequestBuilderImpl requestBuilder, Container container) {
    this.requestBuilder = requestBuilder;
    this.container = container;
}
 
Example #6
Source File: NettyRestServerListener.java    From tajo with Apache License 2.0 4 votes vote down vote up
public NettyRestServerListener(Container container) {
  this.container = container;
}
 
Example #7
Source File: ConfigHelper.java    From ameba with MIT License 4 votes vote down vote up
public ContainerDelegate(Container container) {
    this.container = container;
    this.config = container.getConfiguration();
    this.handler = container.getApplicationHandler();
}
 
Example #8
Source File: ConfigHelper.java    From ameba with MIT License 2 votes vote down vote up
/**
 * use for reload Container.
 * <p>
 * the tryScope must run success then shutdown ServiceLocator
 * <p>
 * otherwise not shut down ServiceLocator
 *
 * @param container {@link Container}
 * @param tryScope try scope
 */
public abstract void onReloadShutdown(final Container container, Runnable tryScope);