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


Java JarScannerCallback类代码示例

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


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

示例1: startTomcat

import org.apache.tomcat.JarScannerCallback; //导入依赖的package包/类
@BeforeClass
public static void startTomcat() throws ServletException, LifecycleException {
    SLF4JBridgeHandler.removeHandlersForRootLogger();
    SLF4JBridgeHandler.install();

    tomcat = new Tomcat();
    tomcat.setPort(8081);
    tomcat.setBaseDir(".");
    Context ctx = tomcat.addWebapp("/", "src/main/webapp");
    ctx.setJarScanner(new JarScanner() {
        @Override
        public void scan(ServletContext context, ClassLoader classloader, JarScannerCallback callback, Set<String> jarsToSkip) {
        }
    });
    ((Host) ctx.getParent()).setAppBase("");
    tomcat.start();
    server = tomcat.getServer();
    server.start();
}
 
开发者ID:nidi3,项目名称:raml-tester-uc-servlet,代码行数:20,代码来源:ServerTest.java

示例2: servletContainer

import org.apache.tomcat.JarScannerCallback; //导入依赖的package包/类
@Bean
public EmbeddedServletContainerFactory servletContainer() {
    TomcatEmbeddedServletContainerFactory factory = new TomcatEmbeddedServletContainerFactory();
    MockService config = MockService.getInstance();
    factory.setPort(config.getPort());
    factory.setSessionTimeout(10, TimeUnit.MINUTES);
    factory.addContextCustomizers(new TomcatContextCustomizer() {
        @Override
        public void customize(Context context) {
            JarScanner jarScanner = new JarScanner() {
                @Override
                public void scan(ServletContext arg0, ClassLoader arg1,
                                 JarScannerCallback arg2, Set<String> arg3) {
                }
            };
            context.setJarScanner(jarScanner);
        }
    });
    return factory;
}
 
开发者ID:groupon,项目名称:odo,代码行数:21,代码来源:TestHttpProxyContainer.java

示例3: scan

import org.apache.tomcat.JarScannerCallback; //导入依赖的package包/类
@Override
public void scan(final JarScanType scanType, final ServletContext context, final JarScannerCallback callback) {
    super.scan(scanType, context, callback);
    if (!embeddedSurefireScanning(scanType, context, callback) && isScanClassPath() && !URLClassLoader.class.isInstance(getSystemClassLoader())
            && !Boolean.getBoolean("tomee.classpath.scanning.disabled")) {
        // TODO: check on tomcat upgrade if it is fixed
        final String cp = System.getProperty("java.class.path");
        final Collection<URL> urls = new HashSet<>();
        for (final String jar : cp.split(File.pathSeparator)) {
            try {
                urls.add(new File(jar).toURI().toURL());
            } catch (MalformedURLException e) {
                // no-op
            }
        }
        doScan(scanType, callback, new LinkedList<>(urls));
    }
}
 
开发者ID:apache,项目名称:tomee,代码行数:19,代码来源:TomEEJarScanner.java

示例4: doScan

import org.apache.tomcat.JarScannerCallback; //导入依赖的package包/类
private void doScan(final JarScanType scanType, final JarScannerCallback callback, final Deque<URL> urls) {
    Method process = null;
    final boolean scanAllDirectories = isScanAllDirectories();
    for (final URL url : urls) {
        final File cpe = URLs.toFile(url);
        if ((cpe.getName().endsWith(".jar") ||
                scanType == JarScanType.PLUGGABILITY ||
                scanAllDirectories) &&
                getJarScanFilter().check(scanType, cpe.getName())) {
            try {
                if (process == null) {
                    process = StandardJarScanner.class.getDeclaredMethod("process",
                            JarScanType.class, JarScannerCallback.class, URL.class, String.class, boolean.class, Deque.class);
                    if (!process.isAccessible()) {
                        process.setAccessible(true);
                    }
                }
                process.invoke(this, scanType, callback, url, null, true, urls);
            } catch (final Exception ioe) {
                // no-op
            }
        }
    }
}
 
开发者ID:apache,项目名称:tomee,代码行数:25,代码来源:TomEEJarScanner.java

示例5: scan

import org.apache.tomcat.JarScannerCallback; //导入依赖的package包/类
public void scan(ServletContext context, ClassLoader classloader,
		JarScannerCallback callback, Set<String> jarsToSkip) {
	Method scanMethod = ReflectionUtils.findMethod(this.jarScanner.getClass(), "scan",
			ServletContext.class, ClassLoader.class, JarScannerCallback.class,
			Set.class);
	Assert.notNull(scanMethod, "Unable to find scan method");
	try {
		scanMethod.invoke(this.jarScanner, context, classloader, callback,
				(jarsToSkip == null ? this.pattern.asSet() : jarsToSkip));
	}
	catch (Exception ex) {
		throw new IllegalStateException("Tomcat 7 reflection failed", ex);
	}
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:15,代码来源:SkipPatternJarScanner.java

示例6: embeddedSurefireScanning

import org.apache.tomcat.JarScannerCallback; //导入依赖的package包/类
private boolean embeddedSurefireScanning(final JarScanType scanType, final ServletContext context, final JarScannerCallback callback) {
    if (isScanClassPath() && System.getProperty("surefire.real.class.path") != null) {
        try {
            final Set<URL> urls = ClassLoaders.findUrls(context.getClassLoader().getParent());
            doScan(scanType, callback, new LinkedList<>(urls));
            return true;
        } catch (final IOException e) {
            // no-op
        }
    }
    return false;
}
 
开发者ID:apache,项目名称:tomee,代码行数:13,代码来源:TomEEJarScanner.java

示例7: scan

import org.apache.tomcat.JarScannerCallback; //导入依赖的package包/类
@Override
public void scan(JarScanType scanType, ServletContext context, JarScannerCallback callback) {
}
 
开发者ID:RapturePlatform,项目名称:Rapture,代码行数:4,代码来源:RaptureWebServer.java

示例8: init

import org.apache.tomcat.JarScannerCallback; //导入依赖的package包/类
@BeforeClass
public static void init() throws LifecycleException, ServletException {
    SLF4JBridgeHandler.removeHandlersForRootLogger();
    SLF4JBridgeHandler.install();

    tomcat = new Tomcat();
    tomcat.setPort(8080);
    tomcat.setBaseDir(".");
    Context ctx = tomcat.addWebapp("", "src/test");
    ctx.setJarScanner(new JarScanner() {
        @Override
        public void scan(JarScanType jarScanType, ServletContext servletContext, JarScannerCallback jarScannerCallback) {
        }

        @Override
        public JarScanFilter getJarScanFilter() {
            return null;
        }

        @Override
        public void setJarScanFilter(JarScanFilter jarScanFilter) {
        }
    });
    ((Host) ctx.getParent()).setAppBase("");

    final Wrapper multiRaml = ctx.createWrapper();
    multiRaml.setServletClass(RamlDocServlet.class.getName());
    multiRaml.setName("app");
    multiRaml.addInitParameter("ramlLocations", "classpath://data/basic.raml,classpath://data/second.raml,classpath://data/markdown.raml");
    multiRaml.addInitParameter("features", "online,tryout,download,docson");
    multiRaml.addInitParameter("baseUriParameters", "host=$host/$path,path=mirror");
    multiRaml.addInitParameter("customization", "classpath://");
    ctx.addChild(multiRaml);
    ctx.addServletMapping("/api/*", "app");

    final Wrapper singleRaml = ctx.createWrapper();
    singleRaml.setServletClass(RamlDocServlet.class.getName());
    singleRaml.setName("sapp");
    singleRaml.addInitParameter("ramlLocations", "classpath://data/basic.raml");
    singleRaml.addInitParameter("features", "online");
    singleRaml.addInitParameter("baseUriParameters", "host=$host/$path,path=mirror");
    ctx.addChild(singleRaml);
    ctx.addServletMapping("/sapi/*", "sapp");

    Tomcat.addServlet(ctx, "mirror", new MirrorServlet());
    ctx.addServletMapping("/mirror/v1/*", "mirror");

    tomcat.start();
    Server server = tomcat.getServer();
    server.start();
}
 
开发者ID:nidi3,项目名称:raml-doc,代码行数:52,代码来源:ServletTest.java

示例9: scan

import org.apache.tomcat.JarScannerCallback; //导入依赖的package包/类
@Override
public void scan(ServletContext context, ClassLoader classloader, JarScannerCallback callback, Set<String> jarsToSkip) {
}
 
开发者ID:nidi3,项目名称:raml-tester,代码行数:4,代码来源:ServerTest.java

示例10: scan

import org.apache.tomcat.JarScannerCallback; //导入依赖的package包/类
@Override
public void scan(final JarScanType scanType, final ServletContext context,
                 final JarScannerCallback callback) {
    // no-op
}
 
开发者ID:apache,项目名称:tomee,代码行数:6,代码来源:EmptyScanner.java


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