Examples of GlobalPathRegistry


Examples of org.netbeans.api.java.classpath.GlobalPathRegistry

                if (_active == Boolean.TRUE) {
                    throw new RecursionException ();
                }
                active.set(true);
                try {
                    GlobalPathRegistry regs = GlobalPathRegistry.getDefault();
                    regs.addGlobalPathRegistryListener(this);
                    Set<URL> roots = new HashSet<URL> ();
                    //Add compile classpath
                    Set<ClassPath> paths = regs.getPaths (ClassPath.COMPILE);
                    for (Iterator<ClassPath> it = paths.iterator(); it.hasNext();) {
                        ClassPath cp =  it.next();
                        try {
                            for (ClassPath.Entry entry : cp.entries()) {
                                roots.add (entry.getURL());
                            }                   
                        } catch (RecursionException e) {/*Recover from recursion*/}
                    }
                    //Add entries from Exec CP which has sources on Sources CP and are not on the Compile CP
                    Set<ClassPath> sources = regs.getPaths(ClassPath.SOURCE);
                    Set<URL> sroots = new HashSet<URL> ();
                    for (Iterator<ClassPath> it = sources.iterator(); it.hasNext();) {
                        ClassPath cp = it.next();
                        try {
                            for (Iterator<ClassPath.Entry> eit = cp.entries().iterator(); eit.hasNext();) {
                                ClassPath.Entry entry = eit.next();
                                sroots.add (entry.getURL());
                            }                   
                        } catch (RecursionException e) {/*Recover from recursion*/}
                    }               
                    Set<ClassPath> exec = regs.getPaths(ClassPath.EXECUTE);
                    for (Iterator<ClassPath> it = exec.iterator(); it.hasNext();) {
                        ClassPath cp = it.next ();
                        try {
                            for (Iterator<ClassPath.Entry> eit = cp.entries().iterator(); eit.hasNext();) {
                                ClassPath.Entry entry = eit.next ();
View Full Code Here

Examples of org.netbeans.api.java.classpath.GlobalPathRegistry

            this.type = type;
            this.paths = new AtomicReference<>(null);
        }

        private void replaceRegistration(ClassPath[] newPaths) {
            GlobalPathRegistry registry = GlobalPathRegistry.getDefault();

            ClassPath[] oldPaths = paths.getAndSet(newPaths);
            if (oldPaths != null) {
                registry.unregister(type, oldPaths);
            }
            if (newPaths != null) {
                registry.register(type, newPaths);
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.