本文整理汇总了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;未经允许,请勿转载。 |
请发表评论