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


Java FilterBootstrap类代码示例

本文整理汇总了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();
}
 
开发者ID:pabiagioli,项目名称:webshooters,代码行数:34,代码来源:GuiceRestEasyFilterDispatcher.java

示例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();
}
 
开发者ID:pabiagioli,项目名称:shiro-guice-async-webapp,代码行数:34,代码来源:GuiceRestEasyFilterDispatcher.java

示例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();
}
 
开发者ID:petergeneric,项目名称:stdlib,代码行数:12,代码来源:ResteasyDispatcher.java


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