Java 类org.glassfish.jersey.server.spi.Container 实例源码

项目:discodj    文件:DiscoDjContainerLifecycleListener.java   
@Override
public void onStartup(Container container) {
    logger.trace("Setting up Guice bridge {}", container);
    ServiceLocator locator = container.getApplicationHandler()
            .getServiceLocator();
    GuiceBridge.getGuiceBridge().initializeGuiceBridge(locator);
    GuiceIntoHK2Bridge guiceBridge = locator
            .getService(GuiceIntoHK2Bridge.class);
    guiceBridge.bridgeGuiceInjector(injector);
    logger.trace("Finished setting up Guice bridge {}", container);

    logger.trace("Starting up catalogue synchroniser");
    backgroundSync = injector.getInstance(BackgroundSync.class);
    backgroundSync.start();
    logger.trace("Started up catalogue synchroniser");
}
项目:mycore    文件:MCRJerseyDefaultConfiguration.java   
/**
 * Adds the binding between guice and hk2. This binding is one directional.
 * You can add guice services into hk2 (jersey) resources. You cannot add
 * a hk2 service into guice.
 * <p>
 * <a href="https://hk2.java.net/guice-bridge/">about the bridge</a>
 * </p>
 *
 * @param resourceConfig the jersey resource configuration
 */
protected void setupGuiceBridge(ResourceConfig resourceConfig) {
    LogManager.getLogger().info("Initialize hk2 - guice bridge...");
    resourceConfig.register(new AbstractContainerLifecycleListener() {
        @Override
        public void onStartup(Container container) {
            ServiceLocator serviceLocator = container.getApplicationHandler().getServiceLocator();
            Injector injector = MCRInjectorConfig.injector();
            GuiceBridge.getGuiceBridge().initializeGuiceBridge(serviceLocator);
            GuiceIntoHK2Bridge guiceBridge = serviceLocator.getService(GuiceIntoHK2Bridge.class);
            guiceBridge.bridgeGuiceInjector(injector);
        }
    });
}
项目:ameba    文件:ConfigHelper.java   
@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();
}
项目:documents4j    文件:StandaloneWebConverterConfiguration.java   
@Override
public void onStartup(Container container) {
    LOGGER.info("Standalone conversion server is starting: starting up local converter");
    LocalConverter.Builder builder = LocalConverter.builder()
            .baseFolder(baseFolder)
            .processTimeout(processTimeout, TimeUnit.MILLISECONDS)
            .workerPool(corePoolSize, maximumPoolSize, keepAliveTime, TimeUnit.MILLISECONDS);
    for (Map.Entry<Class<? extends IExternalConverter>, Boolean> entry : converterConfiguration.entrySet()) {
        LOGGER.info("{} converter: %s", entry.getValue() ? "ENABLED" : "DISABLED", entry.getKey());
        builder = entry.getValue() ? builder.enable(entry.getKey()) : builder.disable(entry.getKey());
    }
    this.converter = builder.build();
    LOGGER.info("Standalone conversion server is starting: local converter is started");
}
项目:bagri    文件:Reloader.java   
@Override
public void onStartup(Container container) {
    this.container = container;
    logger.debug("onStartup; got container: {}", container);
}
项目:bagri    文件:Reloader.java   
@Override
public void onReload(Container container) {
    logger.debug("onReload; old container: {}, new container: {}", this.container, container);
    //this.container = container;
}
项目:bagri    文件:Reloader.java   
@Override
public void onShutdown(Container container) {
    logger.debug("onShutdown; got container: {}", container);
}
项目:tajo    文件:NettyRestServerListener.java   
public NettyRestServerListener(Container container) {
  this.container = container;
}
项目:ameba    文件:ConfigHelper.java   
public ContainerDelegate(Container container) {
    this.container = container;
    this.config = container.getConfiguration();
    this.handler = container.getApplicationHandler();
}
项目:discodj    文件:DiscoDjContainerLifecycleListener.java   
@Override
public void onReload(Container container) {
}
项目:documents4j    文件:StandaloneWebConverterConfiguration.java   
@Override
public void onShutdown(Container container) {
    LOGGER.info("Standalone conversion server is shutting down: shutting local converter down");
    converter.shutDown();
    LOGGER.info("Standalone conversion server is shutting down: local converter was shut down");
}
项目:documents4j    文件:StandaloneWebConverterConfiguration.java   
@Override
public void onReload(Container container) {
    onShutdown(container);
    onStartup(container);
}
项目:lightmare    文件:RestReloader.java   
@Override
public void onStartup(Container container) {
    this.container = container;
}
项目:lightmare    文件:RestReloader.java   
@Override
public void onReload(Container container) {
}
项目:lightmare    文件:RestReloader.java   
@Override
public void onShutdown(Container container) {
}
项目:ameba    文件:ConfigHelper.java   
/**
 * 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);