edu.rice.cs.drjava.model.repl.newjvm
Class ClassPathManager

java.lang.Object
  extended by edu.rice.cs.drjava.model.repl.newjvm.ClassPathManager
All Implemented Interfaces:
Lambda<ClassLoader,ClassLoader>

public class ClassPathManager
extends Object
implements Lambda<ClassLoader,ClassLoader>

Maintains a dynamic class path, allowing entries to be incrementally added in the appropriate place in the list. This class is used in the interpreter JVM, and may be accessed concurrently.


Constructor Summary
ClassPathManager(Iterable<File> builtInCP)
           
 
Method Summary
 void addBuildDirectoryCP(File f)
          Adds the entry to the front of the build classpath.
 void addExternalFilesCP(File f)
          Adds new entry containing f to the front of the external classpath.
 void addExtraCP(File f)
          Adds the entry to the front of the extra classpath.
 void addProjectCP(File f)
          Adds the entry to the front of the project classpath (this is the classpath specified in project properties)
 void addProjectFilesCP(File f)
          Adds the entry to the front of the project files classpath (this is the classpath for all open project files).
 Iterable<File> getBuildDirectoryCP()
           
 Iterable<File> getClassPath()
           
 Iterable<File> getExternalFilesCP()
           
 Iterable<File> getExtraCP()
           
 Iterable<File> getProjectCP()
           
 Iterable<File> getProjectFilesCP()
           
 ClassLoader makeClassLoader(ClassLoader parent)
          Create a new class loader based on the given path.
 ClassLoader value(ClassLoader parent)
          Lambda value method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassPathManager

public ClassPathManager(Iterable<File> builtInCP)
Method Detail

addProjectCP

public void addProjectCP(File f)
Adds the entry to the front of the project classpath (this is the classpath specified in project properties)


getProjectCP

public Iterable<File> getProjectCP()

addBuildDirectoryCP

public void addBuildDirectoryCP(File f)
Adds the entry to the front of the build classpath.


getBuildDirectoryCP

public Iterable<File> getBuildDirectoryCP()

addProjectFilesCP

public void addProjectFilesCP(File f)
Adds the entry to the front of the project files classpath (this is the classpath for all open project files).


getProjectFilesCP

public Iterable<File> getProjectFilesCP()

addExternalFilesCP

public void addExternalFilesCP(File f)
Adds new entry containing f to the front of the external classpath.


getExternalFilesCP

public Iterable<File> getExternalFilesCP()

addExtraCP

public void addExtraCP(File f)
Adds the entry to the front of the extra classpath.


getExtraCP

public Iterable<File> getExtraCP()

makeClassLoader

public ClassLoader makeClassLoader(ClassLoader parent)
Create a new class loader based on the given path. The loader's path is dynamically updated as changes are made in the ClassPathManager. Each loader returned by this method will have its own set of loaded classes, and will only share those classes that are loaded by a common parent.

Parameters:
parent - The parent class loader. May be null, signifying the bootstrap class loader.

value

public ClassLoader value(ClassLoader parent)
Lambda value method

Specified by:
value in interface Lambda<ClassLoader,ClassLoader>

getClassPath

public Iterable<File> getClassPath()