當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。