railo.commons.lang
Class PhysicalClassLoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by railo.commons.lang.ExtendableClassLoader
          extended by railo.commons.lang.PhysicalClassLoader
All Implemented Interfaces:
Sizeable

public final class PhysicalClassLoader
extends ExtendableClassLoader
implements Sizeable

Directory ClassLoader


Constructor Summary
PhysicalClassLoader(Resource directory)
          Constructor of the class
PhysicalClassLoader(Resource directory, ClassLoader parent)
          Constructor of the class
 
Method Summary
 Resource _getResource(String name)
          returns matching File Object or null if file not exust
 int count()
           
 PhysicalClassLoader getCustomClassLoader(Resource[] resources, boolean reload)
           
 Resource getDirectory()
           
 URL getResource(String name)
           
 InputStream getResourceAsStream(String name)
           
 boolean hasClass(String className)
           
 boolean hasResource(String name)
           
 boolean isClassLoaded(String className)
           
static long lastModified(Resource res, long defaultValue)
           
 Class<?> loadClass(String name)
          Loads the class with the specified name.
 Class<?> loadClass(String name, byte[] barr)
          allow to define a new Class with help of the bytecode passed to the method
 long sizeOf()
          return the size of the object
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, getParent, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PhysicalClassLoader

public PhysicalClassLoader(Resource directory)
                    throws IOException
Constructor of the class

Parameters:
directory -
Throws:
IOException

PhysicalClassLoader

public PhysicalClassLoader(Resource directory,
                           ClassLoader parent)
                    throws IOException
Constructor of the class

Parameters:
directory -
parent -
Throws:
IOException
Method Detail

loadClass

public Class<?> loadClass(String name)
                   throws ClassNotFoundException
Loads the class with the specified name. This method searches for classes in the same manner as the loadClass(String, boolean) method. It is called by the Java virtual machine to resolve class references. Calling this method is equivalent to calling loadClass(name, false).

Overrides:
loadClass in class ClassLoader
Parameters:
name - the name of the class
Returns:
the resulting Class object
Throws:
ClassNotFoundException - if the class was not found

lastModified

public static long lastModified(Resource res,
                                long defaultValue)

loadClass

public Class<?> loadClass(String name,
                          byte[] barr)
Description copied from class: ExtendableClassLoader
allow to define a new Class with help of the bytecode passed to the method

Specified by:
loadClass in class ExtendableClassLoader
Returns:

getResource

public URL getResource(String name)
Overrides:
getResource in class ClassLoader

getResourceAsStream

public InputStream getResourceAsStream(String name)
Overrides:
getResourceAsStream in class ClassLoader

_getResource

public Resource _getResource(String name)
returns matching File Object or null if file not exust

Parameters:
name -
Returns:
matching file

hasClass

public boolean hasClass(String className)

isClassLoaded

public boolean isClassLoaded(String className)

hasResource

public boolean hasResource(String name)

getDirectory

public Resource getDirectory()
Returns:
the directory

sizeOf

public long sizeOf()
Description copied from interface: Sizeable
return the size of the object

Specified by:
sizeOf in interface Sizeable
Returns:
size of the object

count

public int count()

getCustomClassLoader

public PhysicalClassLoader getCustomClassLoader(Resource[] resources,
                                                boolean reload)
                                         throws IOException
Throws:
IOException


Copyright © 2012 Railo