当前位置: 首页>>代码示例>>Java>>正文


Java Container类代码示例

本文整理汇总了Java中org.glassfish.jersey.server.spi.Container的典型用法代码示例。如果您正苦于以下问题:Java Container类的具体用法?Java Container怎么用?Java Container使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Container类属于org.glassfish.jersey.server.spi包,在下文中一共展示了Container类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onStartup

import org.glassfish.jersey.server.spi.Container; //导入依赖的package包/类
@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");
}
 
开发者ID:KolonelKustard,项目名称:discodj,代码行数:17,代码来源:DiscoDjContainerLifecycleListener.java

示例2: setupGuiceBridge

import org.glassfish.jersey.server.spi.Container; //导入依赖的package包/类
/**
 * 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);
        }
    });
}
 
开发者ID:MyCoRe-Org,项目名称:mycore,代码行数:24,代码来源:MCRJerseyDefaultConfiguration.java

示例3: onShutdown

import org.glassfish.jersey.server.spi.Container; //导入依赖的package包/类
@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();
}
 
开发者ID:icode,项目名称:ameba,代码行数:11,代码来源:ConfigHelper.java

示例4: onStartup

import org.glassfish.jersey.server.spi.Container; //导入依赖的package包/类
@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");
}
 
开发者ID:documents4j,项目名称:documents4j,代码行数:15,代码来源:StandaloneWebConverterConfiguration.java

示例5: onStartup

import org.glassfish.jersey.server.spi.Container; //导入依赖的package包/类
@Override
public void onStartup(Container container) {
    this.container = container;
    logger.debug("onStartup; got container: {}", container);
}
 
开发者ID:dsukhoroslov,项目名称:bagri,代码行数:6,代码来源:Reloader.java

示例6: onReload

import org.glassfish.jersey.server.spi.Container; //导入依赖的package包/类
@Override
public void onReload(Container container) {
    logger.debug("onReload; old container: {}, new container: {}", this.container, container);
    //this.container = container;
}
 
开发者ID:dsukhoroslov,项目名称:bagri,代码行数:6,代码来源:Reloader.java

示例7: onShutdown

import org.glassfish.jersey.server.spi.Container; //导入依赖的package包/类
@Override
public void onShutdown(Container container) {
    logger.debug("onShutdown; got container: {}", container);
}
 
开发者ID:dsukhoroslov,项目名称:bagri,代码行数:5,代码来源:Reloader.java

示例8: NettyRestServerListener

import org.glassfish.jersey.server.spi.Container; //导入依赖的package包/类
public NettyRestServerListener(Container container) {
  this.container = container;
}
 
开发者ID:apache,项目名称:tajo,代码行数:4,代码来源:NettyRestServerListener.java

示例9: ContainerDelegate

import org.glassfish.jersey.server.spi.Container; //导入依赖的package包/类
public ContainerDelegate(Container container) {
    this.container = container;
    this.config = container.getConfiguration();
    this.handler = container.getApplicationHandler();
}
 
开发者ID:icode,项目名称:ameba,代码行数:6,代码来源:ConfigHelper.java

示例10: onReload

import org.glassfish.jersey.server.spi.Container; //导入依赖的package包/类
@Override
public void onReload(Container container) {
}
 
开发者ID:KolonelKustard,项目名称:discodj,代码行数:4,代码来源:DiscoDjContainerLifecycleListener.java

示例11: onShutdown

import org.glassfish.jersey.server.spi.Container; //导入依赖的package包/类
@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");
}
 
开发者ID:documents4j,项目名称:documents4j,代码行数:7,代码来源:StandaloneWebConverterConfiguration.java

示例12: onReload

import org.glassfish.jersey.server.spi.Container; //导入依赖的package包/类
@Override
public void onReload(Container container) {
    onShutdown(container);
    onStartup(container);
}
 
开发者ID:documents4j,项目名称:documents4j,代码行数:6,代码来源:StandaloneWebConverterConfiguration.java

示例13: onStartup

import org.glassfish.jersey.server.spi.Container; //导入依赖的package包/类
@Override
public void onStartup(Container container) {
    this.container = container;
}
 
开发者ID:levants,项目名称:lightmare,代码行数:5,代码来源:RestReloader.java

示例14: onShutdown

import org.glassfish.jersey.server.spi.Container; //导入依赖的package包/类
@Override
public void onShutdown(Container container) {
}
 
开发者ID:levants,项目名称:lightmare,代码行数:4,代码来源:RestReloader.java

示例15: onReloadShutdown

import org.glassfish.jersey.server.spi.Container; //导入依赖的package包/类
/**
 * 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);
 
开发者ID:icode,项目名称:ameba,代码行数:12,代码来源:ConfigHelper.java


注:本文中的org.glassfish.jersey.server.spi.Container类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。