Enhydra 5.1 API

org.enhydra.xml.xmlc.reloading
Class ClassEntry

java.lang.Object
  |
  +--org.enhydra.xml.xmlc.reloading.ClassEntry

public class ClassEntry
extends java.lang.Object

Object used to hold information about a XMLC-generate class and perform operations assocaited with this class. This manages only the actually generated class, not a derived class. This object also serves as a lock for operations on the class.


Constructor Summary
ClassEntry(java.lang.Class xmlcDocClass, ResourceLoader resourceLoader, RecompilationHandler recompilationHandler, XMLCLogger logger)
          Constructor.
 
Method Summary
 java.lang.Class getCurrentClass()
          Get the current version of the class.
 java.lang.Class getCurrentClass(XMLCReloadingFactory factory)
          Get the current version of the class if the originally loaded class is out-of-date.
 java.io.File getCurrentClassFile()
          Get File associated with currenty loaded class.
 java.lang.Class getOriginalClass()
          Get the class object for originally loaded class.
 java.io.File getOriginalClassFile()
          Get the File associated with originally loaded class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassEntry

public ClassEntry(java.lang.Class xmlcDocClass,
                  ResourceLoader resourceLoader,
                  RecompilationHandler recompilationHandler,
                  XMLCLogger logger)
Constructor.

Parameters:
xmlcDocClass - XMLC generated document class.
resourceLoader - ClassLoader wrapper used to load this class.
recompilationHandler - Object to handle checking for out-of-date class files and recompiling classes. Maybe null if only reloading is implemented.
logger - XMLC logger.
Method Detail

getOriginalClass

public java.lang.Class getOriginalClass()
Get the class object for originally loaded class.


getOriginalClassFile

public java.io.File getOriginalClassFile()
Get the File associated with originally loaded class.


getCurrentClass

public java.lang.Class getCurrentClass()
Get the current version of the class.


getCurrentClassFile

public java.io.File getCurrentClassFile()
Get File associated with currenty loaded class.


getCurrentClass

public java.lang.Class getCurrentClass(XMLCReloadingFactory factory)
Get the current version of the class if the originally loaded class is out-of-date. The current class, either the original class or a previously reloaded class will be check to determine if its current. If a recompilation handler is set, then the class file is compared to its source file modification time. If its out of date, the class will be recompiled. If the loaded class is out-of-date relative to the class file, it is loaded in its own class loaded and returned. If an updated class is has previously been loaded, it will be returned. This class only synchronizes if necessary to update the class.

Parameters:
factory - The factory the entry is associated with.
Returns:
The current class, either the original class or the new one loaded in its own class loader.
Throws:
XMLCReloadingException - Thrown on failure to recompiler or reload.

Enhydra 5.1 API