Package com.sun.enterprise.tools.verifier.apiscan.classfile

Examples of com.sun.enterprise.tools.verifier.apiscan.classfile.ClassFileLoader


            try {
                JarFile jar = new JarFile(args[i]);
                String cp = pcp + File.pathSeparator +
                        ClassPathBuilder.buildClassPathForJar(jar);
                System.out.println("Using CLASSPATH " + cp); // NOI18N
                ClassFileLoader cfl = ClassFileLoaderFactory.newInstance(
                        new Object[]{cp});
                EjbClosureCompiler ejbClosureCompiler = new EjbClosureCompiler(
                        specVer, cfl);
                boolean result = ejbClosureCompiler.buildClosure(jar);
                jar.close();
View Full Code Here


            try {
                JarFile jar = new JarFile(args[i]);
                String cp = pcp + File.pathSeparator +
                        ClassPathBuilder.buildClassPathForJar(jar);
                System.out.println("Using CLASSPATH " + cp); // NOI18N
                ClassFileLoader cfl = ClassFileLoaderFactory.newInstance(
                        new Object[]{cp});
                EjbClosureCompiler ejbClosureCompiler = new EjbClosureCompiler(
                        specVer, cfl);
                boolean result = ejbClosureCompiler.buildClosure(jar);
                jar.close();
View Full Code Here

    private Set<String> computeRequiredPackages(Bundle bundle) throws IOException {
        Set<String> requiredPkgs = new HashSet<String>();
        File moduleFile = new File(bundle.getMd().getLocations()[0]);
        String classpath = moduleFile.getAbsolutePath();
        JarFile moduleJar = new JarFile(moduleFile);
        ClassFileLoader cfl = ClassFileLoaderFactory.newInstance(new Object[]{classpath});
        final String classExt = ".class";
        for (Enumeration<JarEntry> entries = moduleJar.entries(); entries.hasMoreElements();) {
            JarEntry je = entries.nextElement();
            if (je.getName().endsWith(classExt)) {
                String className = Util.convertToExternalClassName(je.getName().substring(0, je.getName().length() - classExt.length()));
                ClassFile cf = null;
                try {
                    cf = cfl.load(className);
                    for (String c : cf.getAllReferencedClassNames()) {
                        requiredPkgs.add(Util.getPackageName(c));
                    }
                } catch (IOException e) {
                    logger.logp(Level.FINE, "PackageAnalyser", "computeRequiredPackages", "Skipping analysis of {0} as the following exception was thrown:\n {1}", new Object[]{className, e});
View Full Code Here

        this.moduleDef = moduleDef;
        this.moduleRepository = moduleRepository;
        moduleJar = new File(moduleDef.getLocations()[0]);
        // Make a classpath consisting of only module jar file.
        String classpath = moduleJar.getAbsolutePath();
        ClassFileLoader cfl = ClassFileLoaderFactory.newInstance(new Object[]{classpath});
        closure = new ClosureCompilerImpl(cfl);
        for (String pattern : excludedPatterns) {
            closure.addExcludedPattern(pattern);
        }
        excludeImportedPackages();
View Full Code Here

        this.moduleDef = moduleDef;
        this.moduleRepository = moduleRepository;
        moduleJar = new File(moduleDef.getLocations()[0]);
        // Make a classpath consisting of only module jar file.
        String classpath = moduleJar.getAbsolutePath();
        ClassFileLoader cfl = ClassFileLoaderFactory.newInstance(new Object[]{classpath});
        closure = new ClosureCompilerImpl(cfl);
        for (String pattern : excludedPatterns) {
            closure.addExcludedPattern(pattern);
        }
        excludeImportedPackages();
View Full Code Here

    private Set<String> computeRequiredPackages(Bundle bundle) throws IOException {
        Set<String> requiredPkgs = new HashSet<String>();
        File moduleFile = new File(bundle.getMd().getLocations()[0]);
        String classpath = moduleFile.getAbsolutePath();
        JarFile moduleJar = new JarFile(moduleFile);
        ClassFileLoader cfl = ClassFileLoaderFactory.newInstance(new Object[]{classpath});
        final String classExt = ".class";
        for (Enumeration<JarEntry> entries = moduleJar.entries(); entries.hasMoreElements();) {
            JarEntry je = entries.nextElement();
            if (je.getName().endsWith(classExt)) {
                String className = Util.convertToExternalClassName(je.getName().substring(0, je.getName().length() - classExt.length()));
                ClassFile cf = null;
                try {
                    cf = cfl.load(className);
                    for (String c : cf.getAllReferencedClassNames()) {
                        requiredPkgs.add(Util.getPackageName(c));
                    }
                } catch (IOException e) {
                    logger.logp(Level.FINE, "PackageAnalyser", "computeRequiredPackages", "Skipping analysis of {0} as the following exception was thrown:\n {1}", new Object[]{className, e});
View Full Code Here

TOP

Related Classes of com.sun.enterprise.tools.verifier.apiscan.classfile.ClassFileLoader

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.