railo.commons.lang
Class ArchiveClassLoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by railo.commons.lang.ArchiveClassLoader
All Implemented Interfaces:
Closeable, Sizeable

public final class ArchiveClassLoader
extends ClassLoader
implements Sizeable, Closeable


Constructor Summary
ArchiveClassLoader(Resource file, ClassLoader parent)
          constructor of the class
 
Method Summary
 void close()
           
 URL getResource(String name)
           
 InputStream getResourceAsStream(String name)
           
 Class loadClass(String name)
          Loads the class with the specified name.
 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

ArchiveClassLoader

public ArchiveClassLoader(Resource file,
                          ClassLoader parent)
                   throws IOException
constructor of the class

Parameters:
file -
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

getResourceAsStream

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

getResource

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

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

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Throws:
IOException


Copyright © 2012 Railo