railo.commons.lang
Class PhysicalClassLoader

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

public final class PhysicalClassLoader
extends ClassLoader
implements Sizeable

Directory ClassLoader


Constructor Summary
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()
           
 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)
           
 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,
                           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)
                   throws ClassNotFoundException
Throws:
ClassNotFoundException

getResource

public URL getResource(String name)
Overrides:
getResource in class ClassLoader
See Also:
ClassLoader.getResource(java.lang.String)

getResourceAsStream

public InputStream getResourceAsStream(String name)
Overrides:
getResourceAsStream in class ClassLoader
See Also:
ClassLoader.getResourceAsStream(java.lang.String)

_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)
See Also:
railo.commons.lang.ClassLoaderControl#hasClass(java.lang.String)

isClassLoaded

public boolean isClassLoaded(String className)

hasResource

public boolean hasResource(String name)
See Also:
railo.commons.lang.ClassLoaderControl#hasResource(java.lang.String)

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
See Also:
Sizeable.sizeOf()

count

public int count()


Copyright © 2012 Railo