本文整理汇总了Java中org.jboss.resteasy.plugins.server.servlet.FilterBootstrap类的典型用法代码示例。如果您正苦于以下问题:Java FilterBootstrap类的具体用法?Java FilterBootstrap怎么用?Java FilterBootstrap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FilterBootstrap类属于org.jboss.resteasy.plugins.server.servlet包,在下文中一共展示了FilterBootstrap类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import org.jboss.resteasy.plugins.server.servlet.FilterBootstrap; //导入依赖的package包/类
@Override
public void init(FilterConfig servletConfig) throws ServletException {
logger.entry();
servletContainerDispatcher = new ServletContainerDispatcher();
FilterBootstrap bootstrap = new FilterBootstrap(servletConfig);
servletContext = servletConfig.getServletContext();
servletContainerDispatcher.init(servletContext, bootstrap, this, this);
servletContainerDispatcher.getDispatcher().getDefaultContextObjects().put(FilterConfig.class, servletConfig);
if (injector == null)
injector = (Injector) servletConfig.getServletContext().getAttribute(Injector.class.getName());
Registry registry = getDispatcher().getRegistry();
ResteasyProviderFactory providerFactory = getDispatcher().getProviderFactory();
for (final Binding<?> binding : injector.getBindings().values()) {
Type type = binding.getKey().getTypeLiteral().getType();
if (type instanceof Class) {
Class<?> beanClass = (Class<?>) type;
if (GetRestful.isRootResource(beanClass)) {
ResourceFactory resourceFactory = new GuiceResourceFactory(binding.getProvider(), beanClass);
logger.info("registering factory for {}", beanClass.getName());
registry.addResourceFactory(resourceFactory);
}
if (beanClass.isAnnotationPresent(Provider.class)) {
logger.info("registering provider instance for {}", beanClass.getName());
providerFactory.registerProviderInstance(binding.getProvider().get());
}
}
}
logger.exit();
}
示例2: init
import org.jboss.resteasy.plugins.server.servlet.FilterBootstrap; //导入依赖的package包/类
@Override
public void init(FilterConfig servletConfig) throws ServletException {
logger.entry();
servletContainerDispatcher = new ServletContainerDispatcher();
FilterBootstrap bootstrap = new FilterBootstrap(servletConfig);
servletContext = servletConfig.getServletContext();
servletContainerDispatcher.init(servletContext, bootstrap, this, this);
servletContainerDispatcher.getDispatcher().getDefaultContextObjects().put(FilterConfig.class, servletConfig);
if(injector == null)
injector = (Injector) servletConfig.getServletContext().getAttribute(Injector.class.getName());
Registry registry = getDispatcher().getRegistry();
ResteasyProviderFactory providerFactory = getDispatcher().getProviderFactory();
for (final Binding<?> binding : injector.getBindings().values()) {
Type type = binding.getKey().getTypeLiteral().getType();
if (type instanceof Class) {
Class<?> beanClass = (Class<?>) type;
if (GetRestful.isRootResource(beanClass)) {
ResourceFactory resourceFactory = new GuiceResourceFactory(binding.getProvider(), beanClass);
logger.info("registering factory for {}", beanClass.getName());
registry.addResourceFactory(resourceFactory);
}
if (beanClass.isAnnotationPresent(Provider.class)) {
logger.info("registering provider instance for {}", beanClass.getName());
providerFactory.registerProviderInstance(binding.getProvider().get());
}
}
}
logger.exit();
}
示例3: init
import org.jboss.resteasy.plugins.server.servlet.FilterBootstrap; //导入依赖的package包/类
@Override
public void init(FilterConfig config) throws ServletException
{
GuiceBuilder builder = new GuiceBuilder().withRole(new WebappGuiceRole(config));
this.registry = new GuiceRegistry(builder);
dispatcher = new GuicedResteasy(registry, config, new FilterBootstrap(config), false);
startInitialise();
}