本文整理汇总了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");
}
示例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);
}
});
}
示例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();
}
示例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");
}
示例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);
}
示例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;
}
示例7: onShutdown
import org.glassfish.jersey.server.spi.Container; //导入依赖的package包/类
@Override
public void onShutdown(Container container) {
logger.debug("onShutdown; got container: {}", container);
}
示例8: NettyRestServerListener
import org.glassfish.jersey.server.spi.Container; //导入依赖的package包/类
public NettyRestServerListener(Container container) {
this.container = container;
}
示例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();
}
示例10: onReload
import org.glassfish.jersey.server.spi.Container; //导入依赖的package包/类
@Override
public void onReload(Container container) {
}
示例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");
}
示例12: onReload
import org.glassfish.jersey.server.spi.Container; //导入依赖的package包/类
@Override
public void onReload(Container container) {
onShutdown(container);
onStartup(container);
}
示例13: onStartup
import org.glassfish.jersey.server.spi.Container; //导入依赖的package包/类
@Override
public void onStartup(Container container) {
this.container = container;
}
示例14: onShutdown
import org.glassfish.jersey.server.spi.Container; //导入依赖的package包/类
@Override
public void onShutdown(Container container) {
}
示例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);