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


Java FilterInfo类代码示例

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


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

示例1: addFilter

import io.undertow.servlet.api.FilterInfo; //导入依赖的package包/类
@Override
public FilterRegistration.Dynamic addFilter(final String filterName, final String className) {
    ensureNotProgramaticListener();
    ensureNotInitialized();
    if (deploymentInfo.getFilters().containsKey(filterName)) {
        return null;
    }
    try {
        FilterInfo filter = new FilterInfo(filterName, (Class<? extends Filter>) deploymentInfo.getClassLoader().loadClass(className));
        deploymentInfo.addFilter(filter);
        deployment.getFilters().addFilter(filter);
        return new FilterRegistrationImpl(filter, deployment, this);
    } catch (ClassNotFoundException e) {
        throw UndertowServletMessages.MESSAGES.cannotLoadClass(className, e);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:17,代码来源:ServletContextImpl.java

示例2: configurePathInfoFilter

import io.undertow.servlet.api.FilterInfo; //导入依赖的package包/类
@SuppressWarnings({ "rawtypes", "unchecked" })
private void configurePathInfoFilter(DeploymentInfo servletBuilder) throws ClassNotFoundException, IOException {
    if(serverOptions.isFilterPathInfoEnabled()) {
        log.debug("enabling path_info filter");
        Class regexPathInfoFilter;
        try{
            regexPathInfoFilter = _classLoader.loadClass("org.cfmlprojects.regexpathinfofilter.RegexPathInfoFilter");
        } catch (java.lang.ClassNotFoundException e) {
            regexPathInfoFilter = Server.class.getClassLoader().loadClass("org.cfmlprojects.regexpathinfofilter.RegexPathInfoFilter");
        }
        servletBuilder.addFilter(new FilterInfo("RegexPathInfoFilter", regexPathInfoFilter));
        servletBuilder.addFilterUrlMapping("RegexPathInfoFilter", "/*", DispatcherType.REQUEST);
        servletBuilder.addFilterUrlMapping("RegexPathInfoFilter", "/*", DispatcherType.FORWARD);
    } else {
        log.debug("path_info filter is disabled");
    }
}
 
开发者ID:cfmlprojects,项目名称:runwar,代码行数:18,代码来源:Server.java

示例3: getDeploymentInfo

import io.undertow.servlet.api.FilterInfo; //导入依赖的package包/类
@Override
public DeploymentInfo getDeploymentInfo() {
	FilterInfo filter = Servlets.filter(RACK_FILTER, RackFilter.class);
	// TODO extend listener and setup the jruby env based on reloaded gems
	// and jars
	// Override appfactory?

	ListenerInfo listenerInfo = Servlets.listener(ServletContextListener.class);

	DeploymentInfo di = new DeploymentInfo().addListener(listenerInfo).setContextPath(config.getRootUrlPath()).addFilter(filter)
			.addFilterUrlMapping(RACK_FILTER, "/*", DispatcherType.REQUEST).setDeploymentName(config.getName())
			.setClassLoader(ClassLoader.getSystemClassLoader());
	setupInitParams(di);
	return di;
}
 
开发者ID:stokesdrift,项目名称:stokesdrift,代码行数:16,代码来源:RackApplication.java

示例4: testUndertowLoading

import io.undertow.servlet.api.FilterInfo; //导入依赖的package包/类
@Test
public void testUndertowLoading() throws Exception {
	int port = 8888;
	FilterInfo filter = Servlets.filter("RackFilter", RackFilter.class);
	ListenerInfo listenerInfo = Servlets.listener(RackServletContextListener.class);
	DeploymentInfo di = new DeploymentInfo()
			.addListener(listenerInfo)
	        .setContextPath("/")
	        // .addInitParameter(name, value)
	        .addFilter(filter)
	        .addFilterUrlMapping("RackFilter", "/*", DispatcherType.ASYNC)
	        // .addServlet(servletInfo)
	        .setDeploymentName("RackServlet")
	        .setClassLoader(ClassLoader.getSystemClassLoader());
	DeploymentManager deploymentManager = Servlets.defaultContainer().addDeployment(di);
	deploymentManager.deploy();
	Undertow server = Undertow.builder()
	        .addHttpListener(port, "localhost")
	        .setHandler(deploymentManager.start())
	        .build();
	Assert.assertNotNull(server);
	//	server.start();

}
 
开发者ID:stokesdrift,项目名称:stokesdrift,代码行数:25,代码来源:UndertowTest.java

示例5: handleDeployment

import io.undertow.servlet.api.FilterInfo; //导入依赖的package包/类
@Override
public void handleDeployment(DeploymentInfo deploymentInfo, ServletContext servletContext) {

    if (!contextBlacklist.contains(deploymentInfo.getContextPath())) {
        LOG.info("Adding metrics filter to  deployment for context " + deploymentInfo.getContextPath());
        FilterInfo metricsFilterInfo = new FilterInfo("metricsfilter", ServletMetricsFilter.class);
        metricsFilterInfo.setAsyncSupported(true);
        metricsFilterInfo.addInitParam(ServletMetricsFilter.BUCKET_CONFIG_PARAM,System.getProperty("prometheus.wildfly.filter.buckets",""));
        deploymentInfo.addFilter(metricsFilterInfo);
        deploymentInfo.addFilterUrlMapping("metricsfilter", "/*", DispatcherType.REQUEST);
    } else {
        LOG.info("Metrics filter not added to black listed context " + deploymentInfo.getContextPath());
        LOG.info(contextBlacklist.toString());
    }
}
 
开发者ID:nlighten,项目名称:wildfly_exporter,代码行数:16,代码来源:MetricFilterExtension.java

示例6: getFilterRegistration

import io.undertow.servlet.api.FilterInfo; //导入依赖的package包/类
@Override
public FilterRegistration getFilterRegistration(final String filterName) {
    ensureNotProgramaticListener();
    final FilterInfo filterInfo = deploymentInfo.getFilters().get(filterName);
    if (filterInfo == null) {
        return null;
    }
    return new FilterRegistrationImpl(filterInfo, deployment, this);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:ServletContextImpl.java

示例7: getFilterRegistrations

import io.undertow.servlet.api.FilterInfo; //导入依赖的package包/类
@Override
public Map<String, ? extends FilterRegistration> getFilterRegistrations() {
    ensureNotProgramaticListener();
    final Map<String, FilterRegistration> ret = new HashMap<>();
    for (Map.Entry<String, FilterInfo> entry : deploymentInfo.getFilters().entrySet()) {
        ret.put(entry.getKey(), new FilterRegistrationImpl(entry.getValue(), deployment, this));
    }
    return ret;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:ServletContextImpl.java

示例8: LifecyleInterceptorInvocation

import io.undertow.servlet.api.FilterInfo; //导入依赖的package包/类
LifecyleInterceptorInvocation(List<LifecycleInterceptor> list, FilterInfo filterInfo, Filter filter,  FilterConfig filterConfig) {
    this.list = list;
    this.servlet = null;
    this.servletConfig = null;
    this.filter = filter;
    this.filterConfig = filterConfig;
    this.filterInfo = filterInfo;
    this.servletInfo = null;
    i = list.size();
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:11,代码来源:LifecyleInterceptorInvocation.java

示例9: createServletsAndFilters

import io.undertow.servlet.api.FilterInfo; //导入依赖的package包/类
private void createServletsAndFilters(final DeploymentImpl deployment, final DeploymentInfo deploymentInfo) {
    for (Map.Entry<String, ServletInfo> servlet : deploymentInfo.getServlets().entrySet()) {
        deployment.getServlets().addServlet(servlet.getValue());
    }
    for (Map.Entry<String, FilterInfo> filter : deploymentInfo.getFilters().entrySet()) {
        deployment.getFilters().addFilter(filter.getValue());
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:9,代码来源:DeploymentManagerImpl.java

示例10: addFilter

import io.undertow.servlet.api.FilterInfo; //导入依赖的package包/类
public ManagedFilter addFilter(final FilterInfo filterInfo) {
    ManagedFilter managedFilter = new ManagedFilter(filterInfo, deployment.getServletContext());
    managedFilterMap.put(filterInfo.getName(),managedFilter);
    deployment.addLifecycleObjects(managedFilter);
    servletPathMatches.invalidate();
    return managedFilter;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:8,代码来源:ManagedFilters.java

示例11: createFathomDeploymentManager

import io.undertow.servlet.api.FilterInfo; //导入依赖的package包/类
protected DeploymentManager createFathomDeploymentManager() throws ServletException {

        DeploymentInfo info = Servlets.deployment();
        info.setDeploymentName("Fathom");
        info.setClassLoader(this.getClass().getClassLoader());
        info.setContextPath(settings.getContextPath());
        info.setIgnoreFlush(true);
        info.setDefaultEncoding("UTF-8");

        FilterInfo guiceFilter = new FilterInfo("GuiceFilter", GuiceFilter.class);
        guiceFilter.setAsyncSupported(true);

        info.addFilterUrlMapping("GuiceFilter", "/*", DispatcherType.REQUEST);
        info.addFilters(guiceFilter);

        ServletInfo defaultServlet = new ServletInfo("DefaultServlet", DefaultServlet.class);
        defaultServlet.setAsyncSupported(true);
        defaultServlet.addMapping("/");

        ServletContextListener fathomListener = new ServletContextListener(settings);

        info.addListeners(new ListenerInfo(ServletContextListener.class, new ImmediateInstanceFactory<>(fathomListener)));

        MultipartConfigElement multipartConfig = new MultipartConfigElement(settings.getUploadFilesLocation(), settings.getUploadFilesMaxSize(), -1L, 0);
        defaultServlet.setMultipartConfig(multipartConfig);
        info.addServlets(defaultServlet);

        DeploymentManager deploymentManager = Servlets.defaultContainer().addDeployment(info);
        deploymentManager.deploy();

        return deploymentManager;
    }
 
开发者ID:gitblit,项目名称:fathom,代码行数:33,代码来源:Server.java

示例12: postProcess

import io.undertow.servlet.api.FilterInfo; //导入依赖的package包/类
@Override
public void postProcess(BootContext context) {
  CachePolicy cachePolicy = new CachePolicy(context.properties());
  if(!cachePolicy.enabled) {
    return;
  }

  EtagCache etagCache = context.getService(EtagCache.class);
  InstanceFactory<CacheFilter> instanceFactory = new ImmediateInstanceFactory<>(new CacheFilter(etagCache));
  FilterInfo filterInfo = Servlets.filter(FILTER_NAME, CacheFilter.class, instanceFactory);
  context.deploymentInfo().addFilter(filterInfo);
  context.deploymentInfo().addFilterUrlMapping(FILTER_NAME, StationsAroundJaxrsDescriptor.MAPPING,
    DispatcherType.REQUEST);
}
 
开发者ID:vvergnolle,项目名称:vas,代码行数:15,代码来源:HttpCacheHttpHandlerPostProcessorDescriptor.java

示例13: addPippoFilter

import io.undertow.servlet.api.FilterInfo; //导入依赖的package包/类
private void addPippoFilter(DeploymentInfo info) {
    if (pippoFilterPath == null) {
        pippoFilterPath = "/*"; // default value
    }

    info.addFilter(new FilterInfo("PippoFilter", PippoFilter.class, new ImmediateInstanceFactory<>(getPippoFilter())));
    info.addFilterUrlMapping("PippoFilter", pippoFilterPath, DispatcherType.REQUEST);
    log.debug("Using pippo filter for path '{}'", pippoFilterPath);
}
 
开发者ID:decebals,项目名称:pippo,代码行数:10,代码来源:UndertowServer.java

示例14: FilterConfigImpl

import io.undertow.servlet.api.FilterInfo; //导入依赖的package包/类
public FilterConfigImpl(final FilterInfo filterInfo, final ServletContext servletContext) {
    this.filterInfo = filterInfo;
    this.servletContext = servletContext;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:FilterConfigImpl.java

示例15: FilterRegistrationImpl

import io.undertow.servlet.api.FilterInfo; //导入依赖的package包/类
public FilterRegistrationImpl(final FilterInfo filterInfo, final Deployment deployment, ServletContextImpl servletContext) {
    this.filterInfo = filterInfo;
    this.deployment = deployment;
    this.servletContext = servletContext;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:6,代码来源:FilterRegistrationImpl.java


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