com.caucho.loader
Class ClassEntry

java.lang.Object
  extended by com.caucho.loader.ClassEntry
All Implemented Interfaces:
Dependency

@Module
public class ClassEntry
extends java.lang.Object
implements Dependency

Describes a cached loaded class entry.


Constructor Summary
ClassEntry(DynamicClassLoader loader, java.lang.String name, Path sourcePath, Path classPath, java.security.CodeSource codeSource)
          Create a loaded class entry
ClassEntry(Loader loader, java.lang.String name, Path sourcePath, Path classPath)
          Create a loaded class entry
 
Method Summary
protected  boolean addDependencies(DependencyContainer container)
          Adds the dependencies, returning true if it's adding itself.
static boolean canReloadNative()
           
 boolean compileIsModified()
          Returns true if the compile doesn't avoid the dependency.
 DynamicClassLoader getClassLoader()
          returns the class loader.
 ClassPackage getClassPackage()
           
 Path getClassPath()
          Returns the path to the class file.
 java.security.CodeSource getCodeSource()
           
 java.lang.Class<?> getEntryClass()
           
 java.lang.String getName()
           
 Path getSourcePath()
           
 boolean isModified()
          Returns true if the source file has been modified.
static boolean isReloadEnabled()
           
 void load(ByteBuffer buffer)
          Loads the contents of the class file into the buffer.
 boolean logModified(java.util.logging.Logger log)
          Returns true if the source file has been modified.
 boolean postLoad()
          post-load actions.
 void preLoad()
          preload actions.
 boolean reloadIsModified()
          Returns true if the reload doesn't avoid the dependency.
static int reloadNative(java.lang.Class<?> cl, byte[] bytes, int offset, int length)
           
 void setClassPackage(ClassPackage pkg)
           
protected  void setDependPath(Path dependPath)
          Sets the depend path.
 void setEntryClass(java.lang.Class<?> cl)
           
 void setSourceLastModified(long lastModified)
           
 void setSourceLength(long length)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClassEntry

public ClassEntry(DynamicClassLoader loader,
                  java.lang.String name,
                  Path sourcePath,
                  Path classPath,
                  java.security.CodeSource codeSource)
Create a loaded class entry

Parameters:
name - the classname
sourcePath - path to the source Java file
classPath - path to the compiled class file

ClassEntry

public ClassEntry(Loader loader,
                  java.lang.String name,
                  Path sourcePath,
                  Path classPath)
Create a loaded class entry

Parameters:
name - the classname
sourcePath - path to the source Java file
classPath - path to the compiled class file
Method Detail

getName

public java.lang.String getName()

getClassLoader

public DynamicClassLoader getClassLoader()
returns the class loader.


getCodeSource

public java.security.CodeSource getCodeSource()

getSourcePath

public Path getSourcePath()

setDependPath

protected void setDependPath(Path dependPath)
Sets the depend path.


addDependencies

protected boolean addDependencies(DependencyContainer container)
Adds the dependencies, returning true if it's adding itself.


setSourceLength

public void setSourceLength(long length)

setSourceLastModified

public void setSourceLastModified(long lastModified)

getClassPackage

public ClassPackage getClassPackage()

setClassPackage

public void setClassPackage(ClassPackage pkg)

isModified

public boolean isModified()
Returns true if the source file has been modified.

Specified by:
isModified in interface Dependency

logModified

public boolean logModified(java.util.logging.Logger log)
Returns true if the source file has been modified.

Specified by:
logModified in interface Dependency

compileIsModified

public boolean compileIsModified()
Returns true if the compile doesn't avoid the dependency.


reloadIsModified

public boolean reloadIsModified()
Returns true if the reload doesn't avoid the dependency.


getClassPath

public Path getClassPath()
Returns the path to the class file.


getEntryClass

public java.lang.Class<?> getEntryClass()

setEntryClass

public void setEntryClass(java.lang.Class<?> cl)

preLoad

public void preLoad()
             throws java.lang.ClassNotFoundException
preload actions.

Throws:
java.lang.ClassNotFoundException

load

public void load(ByteBuffer buffer)
          throws java.io.IOException
Loads the contents of the class file into the buffer.

Throws:
java.io.IOException

postLoad

public boolean postLoad()
post-load actions.


isReloadEnabled

public static boolean isReloadEnabled()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

canReloadNative

public static boolean canReloadNative()

reloadNative

public static int reloadNative(java.lang.Class<?> cl,
                               byte[] bytes,
                               int offset,
                               int length)