tyrex.resource.jca
Class RARClassLoader

java.lang.Object
  |
  +--java.lang.ClassLoader
        |
        +--tyrex.resource.jca.RARClassLoader

public final class RARClassLoader
extends java.lang.ClassLoader

Classloader to load classes from jar files embedded in a rar file. This class is thread-safe because the call to findClass(String) is within a synchronized block (java.lang.ClassLoader.loadClass).

Author:
Riad Mohammed

Inner classes inherited from class java.lang.ClassLoader
java.lang.ClassLoader.Finalizer, java.lang.ClassLoader.NativeLibrary
 
Fields inherited from class java.lang.ClassLoader
nocerts
 
Constructor Summary
RARClassLoader(java.io.File rarFile, boolean resolve)
          Create the RARClassLoader.
RARClassLoader(java.lang.String rarFile, boolean resolve)
          Create the RARClassLoader.
 
Method Summary
protected  java.lang.Class findClass(java.lang.String name)
          Finds the specified class.
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.ClassLoader
, addClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findNative, findResource, findResources, findSystemClass, getBootstrapClassPath, getCallerClassLoader, getGetClassLoaderPerm, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, initialize0, isAncestor, loadClass, loadClass, loadLibrary, resolveClass, setSigners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RARClassLoader

public RARClassLoader(java.io.File rarFile,
                      boolean resolve)
               throws java.io.FileNotFoundException,
                      java.io.IOException
Create the RARClassLoader.
Parameters:
file - the file (required)
resolve - True if the jar files are resolved at creation time. False if jar files are resolved lazily.
Throws:
java.io.FileNotFoundException - if the file does not exist
java.io.IOException - if there is a problem reading the rar file
java.lang.IllegalArgumentException - if the file argument is null.

RARClassLoader

public RARClassLoader(java.lang.String rarFile,
                      boolean resolve)
               throws java.io.FileNotFoundException,
                      java.io.IOException
Create the RARClassLoader.
Parameters:
file - the file (required)
resolve - True if the jar files are resolved at creation time. False if jar files are resolved lazily.
Throws:
java.io.FileNotFoundException - if the file does not exist
java.io.IOException - if there is a problem reading the rar file
java.lang.IllegalArgumentException - if the file argument is null.
Method Detail

findClass

protected java.lang.Class findClass(java.lang.String name)
                             throws java.lang.ClassNotFoundException
Finds the specified class. This method should be overridden by class loader implementations that follow the new delegation model for loading classes, and will be called by the loadClass method after checking the parent class loader for the requested class.This method is not synchronized because loadClass is synchronized.
Overrides:
findClass in class java.lang.ClassLoader
Parameters:
name - the name of the class
Returns:
the resulting Class object
Throws:
java.lang.ClassNotFoundException - if the class could not be found

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception


Intalio Inc. (C) 1999-2001. All rights reserved.