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


Java ImmediateInstanceFactory类代码示例

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


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

示例1: addServlet

import io.undertow.servlet.util.ImmediateInstanceFactory; //导入依赖的package包/类
@Override
public ServletRegistration.Dynamic addServlet(final String servletName, final Servlet servlet) {
    ensureNotProgramaticListener();
    ensureNotInitialized();
    if (deploymentInfo.getServlets().containsKey(servletName)) {
        return null;
    }
    ServletInfo s = new ServletInfo(servletName, servlet.getClass(), new ImmediateInstanceFactory<>(servlet));
    readServletAnnotations(s);
    deploymentInfo.addServlet(s);
    ServletHandler handler = deployment.getServlets().addServlet(s);
    return new ServletRegistrationImpl(s, handler.getManagedServlet(), deployment);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:14,代码来源:ServletContextImpl.java

示例2: addFilter

import io.undertow.servlet.util.ImmediateInstanceFactory; //导入依赖的package包/类
@Override
public FilterRegistration.Dynamic addFilter(final String filterName, final Filter filter) {
    ensureNotProgramaticListener();
    ensureNotInitialized();

    if (deploymentInfo.getFilters().containsKey(filterName)) {
        return null;
    }
    FilterInfo f = new FilterInfo(filterName, filter.getClass(), new ImmediateInstanceFactory<>(filter));
    deploymentInfo.addFilter(f);
    deployment.getFilters().addFilter(f);
    return new FilterRegistrationImpl(f, deployment, this);

}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:15,代码来源:ServletContextImpl.java

示例3: addListener

import io.undertow.servlet.util.ImmediateInstanceFactory; //导入依赖的package包/类
@Override
public <T extends EventListener> void addListener(final T t) {
    ensureNotInitialized();
    ensureNotProgramaticListener();
    if (ApplicationListeners.listenerState() != NO_LISTENER &&
            ServletContextListener.class.isAssignableFrom(t.getClass())) {
        throw UndertowServletMessages.MESSAGES.cannotAddServletContextListener();
    }
    ListenerInfo listener = new ListenerInfo(t.getClass(), new ImmediateInstanceFactory<EventListener>(t));
    deploymentInfo.addListener(listener);
    deployment.getApplicationListeners().addListener(new ManagedListener(listener, true));
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:13,代码来源:ServletContextImpl.java

示例4: registerServletContainerInitializerToDriveServletContextInitializers

import io.undertow.servlet.util.ImmediateInstanceFactory; //导入依赖的package包/类
private void registerServletContainerInitializerToDriveServletContextInitializers(
		DeploymentInfo deployment, ServletContextInitializer... initializers) {
	ServletContextInitializer[] mergedInitializers = mergeInitializers(initializers);
	Initializer initializer = new Initializer(mergedInitializers);
	deployment.addServletContainerInitalizer(new ServletContainerInitializerInfo(
			Initializer.class,
			new ImmediateInstanceFactory<ServletContainerInitializer>(initializer),
			NO_CLASSES));
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:10,代码来源:UndertowEmbeddedServletContainerFactory.java

示例5: createFathomDeploymentManager

import io.undertow.servlet.util.ImmediateInstanceFactory; //导入依赖的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

示例6: postProcess

import io.undertow.servlet.util.ImmediateInstanceFactory; //导入依赖的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

示例7: getServletContainerInitializers

import io.undertow.servlet.util.ImmediateInstanceFactory; //导入依赖的package包/类
private List<ServletContainerInitializerInfo> getServletContainerInitializers() {
    List<ServletContainerInitializerInfo> infos = new ArrayList<>();
    for (ServletContainerInitializer initializer : ServiceLoader.load(ServletContainerInitializer.class)) {
        HandlesTypes types = initializer.getClass().getAnnotation(HandlesTypes.class);
        infos.add(new ServletContainerInitializerInfo(
            initializer.getClass(),
            new ImmediateInstanceFactory<>(initializer),
            types == null ? Collections.emptySet() : new LinkedHashSet<>(Arrays.asList(types.value()))));
    }
    return infos;
}
 
开发者ID:guestful,项目名称:module.jersey-container-undertow,代码行数:12,代码来源:UndertowContainer.java

示例8: handleDeployment

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

    String componentName = "";
    String resourceName = "";
    Pattern insecureEndpointPattern = null;
    Pattern postQueryPattern = null;
    // file to contain configurations options for this Servlet Extension
    InputStream is = servletContext.getResourceAsStream(PROPERTY_FILE);
    if (is != null) {
        try {
            Properties props = new Properties();
            props.load(is);
            componentName = props.getProperty("component");
            resourceName = props.getProperty("resource-name");
            String insecurePatternString = props.getProperty("unsecure-endpoints");
            String postQueryPatternString = props.getProperty("post-query");

            if (insecurePatternString != null) {
                insecureEndpointPattern = Pattern.compile(insecurePatternString);
            }

            if (postQueryPatternString != null) {
                postQueryPattern = Pattern.compile(postQueryPatternString);
            }
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

    if (componentName == null || componentName.isEmpty()) {
        throw new RuntimeException("Missing or empty 'component' key from the " + PROPERTY_FILE + " configuration file.");
    }

    if (resourceName == null || resourceName.isEmpty()) {
        throw new RuntimeException("Missing or empty 'resource-name' key from the " + PROPERTY_FILE + " configuratin file.");
    }

    final String cName = componentName;
    final String rName = resourceName;
    final Pattern insecurePattern = insecureEndpointPattern;
    final Pattern postQuery = postQueryPattern;

    if (DISABLE_NAMESPACE_FILTER.equalsIgnoreCase("true")) {
        log.info("The OpenShift Namespace Filter has been disabled via the 'DISABLE_NAMESPACE_FILTER' system property.");
    }
    else {
        log.info("Enabling the OpenShift Namespace Filter.");
        deploymentInfo.addInitialHandlerChainWrapper(containerHandler -> {
            namespaceHandler = new NamespaceHandler(containerHandler);
            return namespaceHandler;
        });
    }

    ImmediateInstanceFactory<EventListener> instanceFactory = new ImmediateInstanceFactory<>(new SCListener());
    deploymentInfo.addListener(new ListenerInfo(SCListener.class, instanceFactory));
    deploymentInfo.addInitialHandlerChainWrapper(containerHandler -> {
        openshiftAuthHandler = new OpenshiftAuthHandler(containerHandler, cName, rName, insecurePattern, postQuery);
        return openshiftAuthHandler;
    });

}
 
开发者ID:hawkular,项目名称:hawkular-metrics,代码行数:63,代码来源:OpenshiftAuthServletExtension.java

示例9: addPippoFilter

import io.undertow.servlet.util.ImmediateInstanceFactory; //导入依赖的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

示例10: sciInfo

import io.undertow.servlet.util.ImmediateInstanceFactory; //导入依赖的package包/类
private static ServletContainerInitializerInfo sciInfo() {
    return new ServletContainerInitializerInfo(ContainerInitializer.class,
            new ImmediateInstanceFactory<>(new ContainerInitializer()),
            Collections.singleton(FrameworkStartupHandler.class));
}
 
开发者ID:AdeptJ,项目名称:adeptj-runtime,代码行数:6,代码来源:Server.java


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