• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ServletContainerDispatcher类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: init

import org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher; //导入依赖的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.ServletContainerDispatcher; //导入依赖的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: getDispatcher

import org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher; //导入依赖的package包/类
private synchronized ServletContainerDispatcher getDispatcher() throws ServletException
{
	if (!registered.get())
	{
		dispatcher = new ServletContainerDispatcher();

		configure(dispatcher);

		registered.set(true);
	}

	return dispatcher;
}
 
开发者ID:petergeneric,项目名称:stdlib,代码行数:14,代码来源:GuicedResteasy.java


示例4: setupCmd

import org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher; //导入依赖的package包/类
public void setupCmd(ClassLoader classLoader, Object context, Object servletContainerDispatcher, String className, Class<?> original) {
	this.classLoader = classLoader;
	this.context = (ServletContext) context;
	this.servletContainerDispatcher = (ServletContainerDispatcher) servletContainerDispatcher;
	this.className = className;
	this.original = original;
}
 
开发者ID:HotswapProjects,项目名称:HotswapAgent,代码行数:8,代码来源:RefreshRegistryCommand.java


示例5: configure

import org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher; //导入依赖的package包/类
/**
 * Try to initialise a ServletContainerDispatcher with the connection to the Guice REST services
 */
protected void configure(ServletContainerDispatcher dispatcher) throws ServletException
{
	// Make sure we are registered with the Guice registry
	registry.register(this, true);

	// Configure the dispatcher
	final Registry resteasyRegistry;
	final ResteasyProviderFactory providerFactory;
	{
		final ResteasyRequestResponseFactory converter = new ResteasyRequestResponseFactory(dispatcher);

		dispatcher.init(context, bootstrap, converter, converter);

		if (filterConfig != null)
			dispatcher.getDispatcher().getDefaultContextObjects().put(FilterConfig.class, filterConfig);
		if (servletConfig != null)
			dispatcher.getDispatcher().getDefaultContextObjects().put(ServletConfig.class, servletConfig);

		resteasyRegistry = dispatcher.getDispatcher().getRegistry();
		providerFactory = dispatcher.getDispatcher().getProviderFactory();
	}


	// Register the REST provider classes
	for (Class<?> providerClass : ResteasyProviderRegistry.getClasses())
	{
		log.debug("Registering REST providers: " + providerClass.getName());
		providerFactory.registerProvider(providerClass);
	}

	// Register the REST provider singletons
	for (Object provider : ResteasyProviderRegistry.getSingletons())
	{
		log.debug("Registering REST provider singleton: " + provider);
		providerFactory.registerProviderInstance(provider);
	}

	providerFactory.registerProviderInstance(new LogReportMessageBodyReader());
	// Register the JAXBContext provider
	providerFactory.registerProviderInstance(jaxbContextResolver);

	// Register the exception mapper
	{
		// Register the ExceptionMapper for ApplicationException
		providerFactory.register(this.exceptionMapper);

		log.trace("ExceptionMapper registered for ApplicationException");
	}

	// Register the REST resources
	for (RestResource resource : RestResourceRegistry.getResources())
	{
		log.debug("Registering REST resource: " + resource.getResourceClass().getName());

		resteasyRegistry.addResourceFactory(new ResteasyGuiceResource(injector, resource.getResourceClass()));
	}
}
 
开发者ID:petergeneric,项目名称:stdlib,代码行数:61,代码来源:GuicedResteasy.java


示例6: ResteasyRequestResponseFactory

import org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher; //导入依赖的package包/类
public ResteasyRequestResponseFactory(ServletContainerDispatcher dispatcher)
{
	this.dispatcher = dispatcher;
}
 
开发者ID:petergeneric,项目名称:stdlib,代码行数:5,代码来源:ResteasyRequestResponseFactory.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java WireFeedInput类代码示例发布时间:2022-05-22
下一篇:
Java MetricsAssertHelper类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap