Package org.glassfish.deployment.common

Examples of org.glassfish.deployment.common.ClassDependencyBuilder


             * Create an instance of ClassDependencyBuilder that looks at the byte code and keeps
             * the information for every class in this app
             *
             */
            if (types==null || Boolean.getBoolean("org.glassfish.web.parsing")) {
                ClassDependencyBuilder classInfo = new ClassDependencyBuilder();
                if (cl instanceof URLClassLoader) {
                    URLClassLoader ucl = (URLClassLoader) cl;
                    for(URL u : ucl.getURLs()) {
                        String path = u.getPath();
                        try {
                            if(path.endsWith(".jar")) {
                                JarFile jf = new JarFile(path);
                                try {
                                    Enumeration<JarEntry> entries = jf.entries();
                                    while(entries.hasMoreElements()) {
                                        JarEntry anEntry = entries.nextElement();
                                        if(anEntry.isDirectory())
                                            continue;
                                        if(!anEntry.getName().endsWith(".class"))
                                            continue;
                                        InputStream jarInputStream = null;
                                        try {
                                            jarInputStream = jf.getInputStream(anEntry);
                                            int size = (int) anEntry.getSize();
                                            byte[] classData = new byte[size];
                                            for(int bytesRead = 0; bytesRead < size;) {
                                                int r2 = jarInputStream.read(classData, bytesRead, size - bytesRead);
                                                bytesRead += r2;
                                            }
                                            classInfo.loadClassData(classData);
                                        } catch (Throwable t) {
                                            if (log.isLoggable(Level.FINE)) {
                                                log.log(Level.FINE,
                                                    "servletContainerInitializerUtil.classLoadingError",
                                                    new Object[] {
View Full Code Here


             * Create an instance of ClassDependencyBuilder that looks at the byte code and keeps
             * the information for every class in this app
             *
             */
            if (types==null || Boolean.getBoolean("org.glassfish.web.parsing")) {
                ClassDependencyBuilder classInfo = new ClassDependencyBuilder();
                for(URL u : ((URLClassLoader)cl).getURLs()) {
                    String path = u.getPath();
                    try {
                        if(path.endsWith(".jar")) {
                            JarFile jf = new JarFile(path);
                            try {
                                Enumeration<JarEntry> entries = jf.entries();
                                while(entries.hasMoreElements()) {
                                    JarEntry anEntry = entries.nextElement();
                                    if(anEntry.isDirectory())
                                        continue;
                                    if(!anEntry.getName().endsWith(".class"))
                                        continue;
                                    InputStream jarInputStream = null;
                                    try {
                                        jarInputStream = jf.getInputStream(anEntry);
                                        int size = (int) anEntry.getSize();
                                        byte[] classData = new byte[size];
                                        for(int bytesRead = 0; bytesRead < size;) {
                                            int r2 = jarInputStream.read(classData, bytesRead, size - bytesRead);
                                            bytesRead += r2;
                                        }
                                        classInfo.loadClassData(classData);
                                    } catch (Throwable t) {
                                        if (log.isLoggable(Level.FINE)) {
                                            log.log(Level.FINE,
                                                "servletContainerInitializerUtil.classLoadingError",
                                                new Object[] {
View Full Code Here

             * Create an instance of ClassDependencyBuilder that looks at the byte code and keeps
             * the information for every class in this app
             *
             */
            if (types==null || Boolean.getBoolean("org.glassfish.web.parsing")) {
                ClassDependencyBuilder classInfo = new ClassDependencyBuilder();
                if (cl instanceof URLClassLoader) {
                    URLClassLoader ucl = (URLClassLoader) cl;
                    for(URL u : ucl.getURLs()) {
                        String path = u.getPath();
                        try {
                            if(path.endsWith(".jar")) {
                                JarFile jf = new JarFile(path);
                                try {
                                    Enumeration<JarEntry> entries = jf.entries();
                                    while(entries.hasMoreElements()) {
                                        JarEntry anEntry = entries.nextElement();
                                        if(anEntry.isDirectory())
                                            continue;
                                        if(!anEntry.getName().endsWith(".class"))
                                            continue;
                                        InputStream jarInputStream = null;
                                        try {
                                            jarInputStream = jf.getInputStream(anEntry);
                                            int size = (int) anEntry.getSize();
                                            byte[] classData = new byte[size];
                                            for(int bytesRead = 0; bytesRead < size;) {
                                                int r2 = jarInputStream.read(classData, bytesRead, size - bytesRead);
                                                bytesRead += r2;
                                            }
                                            classInfo.loadClassData(classData);
                                        } catch (Throwable t) {
                                            if (log.isLoggable(Level.FINE)) {
                                                log.log(Level.FINE,
                                                    CLASS_LOADING_ERROR,
                                                    new Object[] {
View Full Code Here

TOP

Related Classes of org.glassfish.deployment.common.ClassDependencyBuilder

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.