com.ibm.di.loader
Class IDILoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by com.ibm.di.loader.IDILoader

public class IDILoader
extends ClassLoader

This class is responsible for loading classes from the jar files that are placed in the jars directory


Constructor Summary
IDILoader()
          Constructor for the IDILoader object
 
Method Summary
 void addFiles(String path)
          Add all files in the given path to our internal list of jar files
 void addInstalledComponent(String path)
          Locate idi.inf in a jar file, and add it to the sysconfig String
 void addPackages(File path)
          Add all files in the given path to our internal list of packages
 void cacheJarContents(String path)
          Locate all classes in a jar file, and add the names to a local cache.
protected  Class findClass(String name)
          Finds the specified class
protected  String findLibrary(String name)
          Returns the absolute path name of a native library.
protected  URL findResource(String name)
          Finds the resource with the given name.
static List getInstalledPackages()
          Returns the list of installed packages
static String getModificationDate(String className)
          Returns the time a class was modified
 String getPathForClass(String clsname)
          Returns the path from which a class is/will be loaded.
static String getSysConfig()
          Returns the accumulated sysConfig ( concatenation of all the idi.inf files ).
 Class loadClassFromFile(String fileName)
           
static void main(String[] args)
          The main program for the IDILoader class
 void run(String name, String[] args)
          Main processing method for the IDILoader object.
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLoadedClass, findResources, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IDILoader

public IDILoader()
Constructor for the IDILoader object

Method Detail

getSysConfig

public static String getSysConfig()
Returns the accumulated sysConfig ( concatenation of all the idi.inf files ).

Returns:
The sysConfig value

getModificationDate

public static String getModificationDate(String className)
Returns the time a class was modified

Parameters:
className - the name of the class
Returns:
The modification time as a String or null if not found

getInstalledPackages

public static List getInstalledPackages()
Returns the list of installed packages


getPathForClass

public String getPathForClass(String clsname)
Returns the path from which a class is/will be loaded.


main

public static void main(String[] args)
The main program for the IDILoader class

Parameters:
args - The command line arguments

addFiles

public void addFiles(String path)
Add all files in the given path to our internal list of jar files

Parameters:
path - The path of the file(s) to be added

addPackages

public void addPackages(File path)
Add all files in the given path to our internal list of packages

Parameters:
path - The path of the file(s) to be added

addInstalledComponent

public void addInstalledComponent(String path)
Locate idi.inf in a jar file, and add it to the sysconfig String

Parameters:
path - The absolute path of the jar file

cacheJarContents

public void cacheJarContents(String path)
Locate all classes in a jar file, and add the names to a local cache. This cache contains a mapping from class name to path name.

Parameters:
path - The absolute path of the jar file

run

public void run(String name,
                String[] args)
Main processing method for the IDILoader object. Build internal structures, load the named class, and call the main method of that class, passing the arguments

Parameters:
name - The class to load and call the main method in. If name == null, only build internal structures
args - Parameters to pass to the main method in the named class

findClass

protected Class findClass(String name)
                   throws ClassNotFoundException
Finds the specified class

Overrides:
findClass in class ClassLoader
Parameters:
name - The name of the class
Returns:
The resulting Class object
Throws:
ClassNotFoundException - If the class could not be found

findResource

protected URL findResource(String name)
Finds the resource with the given name.

Overrides:
findResource in class ClassLoader
Parameters:
name - The resource name
Returns:
A URL object for reading the resource, or null if the resource could not be found

findLibrary

protected String findLibrary(String name)
Returns the absolute path name of a native library.

Overrides:
findLibrary in class ClassLoader
Parameters:
name - The library name
Returns:
The absolute path of the native library

loadClassFromFile

public Class loadClassFromFile(String fileName)
                        throws Exception
Throws:
Exception