Package org.apache.catalina

Examples of org.apache.catalina.JarRepository


        while (jarPaths.hasNext()) {
            String jarPath = jarPaths.next();
            if (jarPath.equals("")) {
                continue;
            }
            JarRepository jarRepository = context.getJarRepository();
            JarFile jarFile = jarRepository.findJar(jarPath);
            Iterator<String> jarTLDsIterator =  TLDs.get(jarPath).iterator();
            while (jarTLDsIterator.hasNext()) {
                try {
                    String tldPath = jarTLDsIterator.next();
                    stream = jarFile.getInputStream(jarFile.getEntry(tldPath));
View Full Code Here


        List<WebOrdering> orderings = new ArrayList<WebOrdering>();
        HashSet<String> jarsSet = new HashSet<String>();
        boolean fragmentFound = false;
       
        // Parse the ordering defined in web fragments
        JarRepository jarRepository = context.getJarRepository();
        JarFile[] jars = jarRepository.findJars();
        for (int i = 0; i < jars.length; i++) {
            // Find webapp descriptor fragments
            jarsSet.add(jars[i].getName());
            JarFile jarFile = jars[i];
            InputStream is = null;
View Full Code Here

    /**
     * Process additional descriptors: TLDs, web fragments, and map overlays.
     */
    protected void applicationExtraDescriptorsConfig() {
       
        JarRepository jarRepository = context.getJarRepository();

        HashSet<String> warTLDs = new HashSet<String>();

        // Find any TLD file in /WEB-INF
        DirContext resources = context.getResources();
        if (resources != null) {
            tldScanResourcePathsWebInf(resources, "/WEB-INF", warTLDs);
        }
        TLDs.put("", warTLDs);
       
        File[] explodedJars = jarRepository.findExplodedJars();
        for (int i = 0; i < explodedJars.length; i++) {
            scanClasses(explodedJars[i], "", !context.getIgnoreAnnotations());
        }
       
        // Parse web fragment according to order
        Iterator<String> orderIterator = order.iterator();
        while (orderIterator.hasNext()) {
            String jar = orderIterator.next();
            JarFile jarFile = jarRepository.findJar(jar);
            InputStream is = null;
            ZipEntry entry = jarFile.getEntry(Globals.WEB_FRAGMENT_PATH);
            if (entry != null) {
                try {
                    is = jarFile.getInputStream(entry);
                    InputSource input = new InputSource((new File(jar)).toURI().toURL().toExternalForm());
                    input.setByteStream(is);
                    synchronized (webFragmentDigester) {
                        try {
                            webFragmentDigester.push(context);
                            webFragmentDigester.setErrorHandler(new ContextErrorHandler());
                            webFragmentDigester.parse(input);
                            if (parseException != null) {
                                ok = false;
                            }
                        } finally {
                            webFragmentDigester.reset();
                            webFragmentRuleSet.recycle();
                            parseException = null;
                        }
                    }
                } catch (Exception e) {
                    log.error(sm.getString("contextConfig.applicationParse", jar), e);
                    ok = false;
                } finally {
                    try {
                        if (is != null) {
                            is.close();
                        }
                    } catch (IOException e) {
                        // Ignore
                    }
                }
            }
            // Scan the JAR for TLDs and annotations
            scanJar(jarFile, true);
        }
       
        // Process any Jar not in the order
        JarFile[] jarFiles = jarRepository.findJars();
        for (int i = 0; i < jarFiles.length; i++) {
            if (!order.contains(jarFiles[i].getName())) {
                // Scan the JAR for TLDs only
                scanJar(jarFiles[i], false);
            }
View Full Code Here

   
    /**
     * Find and parse ServletContainerInitializer service in specified JAR.
     */
    public void applicationServletContainerInitializerConfig() {
        JarRepository jarRepository = context.getJarRepository();
        if (jarRepository != null) {
            JarFile[] jars = jarRepository.findJars();
            for (int i = 0; i < jars.length; i++) {
                scanJarForServletContainerInitializer(jars[i]);
            }
        }
        // Do the same for the context parent
        jarRepository = context.getParent().getJarRepository();
        if (jarRepository != null) {
            JarFile[] jars = jarRepository.findJars();
            for (int i = 0; i < jars.length; i++) {
                scanJarForServletContainerInitializer(jars[i]);
            }
        }
    }
View Full Code Here

            authenticatorConfig();
        }

        // Find and configure overlays
        if (ok) {
            JarRepository jarRepository = context.getJarRepository();
            JarFile[] jars = jarRepository.findJars();
            for (int i = 0; i < jars.length; i++) {
                if (jars[i].getEntry(Globals.OVERLAY_PATH) != null) {
                    if (context.getResources() instanceof ProxyDirContext) {
                        ProxyDirContext resources = (ProxyDirContext) context.getResources();
                        JARDirContext overlay = new JARDirContext();
View Full Code Here

     * @param jarRepository The newly associated JarRepository
     */
    public synchronized void setJarRepository(JarRepository jarRepository) {

        // Change components if necessary
        JarRepository oldJarRepository = this.jarRepository;
        if (oldJarRepository == jarRepository)
            return;
        this.jarRepository = jarRepository;

        // Stop the old component if necessary
View Full Code Here

        while (jarPaths.hasNext()) {
            String jarPath = jarPaths.next();
            if (jarPath.equals("")) {
                continue;
            }
            JarRepository jarRepository = context.getJarRepository();
            JarFile jarFile = jarRepository.findJar(jarPath);
            Iterator<String> jarTLDsIterator =  TLDs.get(jarPath).iterator();
            while (jarTLDsIterator.hasNext()) {
                try {
                    String tldPath = jarTLDsIterator.next();
                    stream = jarFile.getInputStream(jarFile.getEntry(tldPath));
View Full Code Here

        List<WebOrdering> orderings = new ArrayList<WebOrdering>();
        HashSet<String> jarsSet = new HashSet<String>();
        boolean fragmentFound = false;
       
        // Parse the ordering defined in web fragments
        JarRepository jarRepository = context.getJarRepository();
        JarFile[] jars = jarRepository.findJars();
        for (int i = 0; i < jars.length; i++) {
            // Find webapp descriptor fragments
            jarsSet.add(jars[i].getName());
            JarFile jarFile = jars[i];
            InputStream is = null;
View Full Code Here

    /**
     * Process additional descriptors: TLDs, web fragments, and map overlays.
     */
    protected void applicationExtraDescriptorsConfig() {
       
        JarRepository jarRepository = context.getJarRepository();

        HashSet<String> warTLDs = new HashSet<String>();

        // Find any TLD file in /WEB-INF
        DirContext resources = context.getResources();
        if (resources != null) {
            tldScanResourcePathsWebInf(resources, "/WEB-INF", warTLDs);
        }
        TLDs.put("", warTLDs);
       
        File[] explodedJars = jarRepository.findExplodedJars();
        for (int i = 0; i < explodedJars.length; i++) {
            scanClasses(explodedJars[i], "", !context.getIgnoreAnnotations());
        }
       
        // Parse web fragment according to order
        Iterator<String> orderIterator = order.iterator();
        while (orderIterator.hasNext()) {
            String jar = orderIterator.next();
            JarFile jarFile = jarRepository.findJar(jar);
            InputStream is = null;
            ZipEntry entry = jarFile.getEntry(Globals.WEB_FRAGMENT_PATH);
            if (entry != null) {
                try {
                    is = jarFile.getInputStream(entry);
                    InputSource input = new InputSource((new File(jar)).toURI().toURL().toExternalForm());
                    input.setByteStream(is);
                    synchronized (webFragmentDigester) {
                        try {
                            webFragmentDigester.push(context);
                            webFragmentDigester.setErrorHandler(new ContextErrorHandler());
                            webFragmentDigester.parse(input);
                            if (parseException != null) {
                                ok = false;
                            }
                        } finally {
                            webFragmentDigester.reset();
                            webFragmentRuleSet.recycle();
                            parseException = null;
                        }
                    }
                } catch (Exception e) {
                    log.error(sm.getString("contextConfig.applicationParse", jar), e);
                    ok = false;
                } finally {
                    try {
                        if (is != null) {
                            is.close();
                        }
                    } catch (IOException e) {
                        // Ignore
                    }
                }
            }
            // Scan the JAR for TLDs and annotations
            scanJar(jarFile, true);
        }
       
        // Process any Jar not in the order
        JarFile[] jarFiles = jarRepository.findJars();
        for (int i = 0; i < jarFiles.length; i++) {
            if (!order.contains(jarFiles[i].getName())) {
                // Scan the JAR for TLDs only
                scanJar(jarFiles[i], false);
            }
View Full Code Here

   
    /**
     * Find and parse ServletContainerInitializer service in specified JAR.
     */
    public void applicationServletContainerInitializerConfig() {
        JarRepository jarRepository = context.getJarRepository();
        if (jarRepository != null) {
            JarFile[] jars = jarRepository.findJars();
            for (int i = 0; i < jars.length; i++) {
                scanJarForServletContainerInitializer(jars[i]);
            }
        }
        // Do the same for the context parent
        jarRepository = context.getParent().getJarRepository();
        if (jarRepository != null) {
            JarFile[] jars = jarRepository.findJars();
            for (int i = 0; i < jars.length; i++) {
                scanJarForServletContainerInitializer(jars[i]);
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.catalina.JarRepository

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.