|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.ClassLoader
com.ibm.di.loader.IDILoader
public class IDILoader
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(java.lang.String path)
Add all files in the given path to our internal list of jar files |
void |
addInstalledComponent(java.lang.String path)
Locate idi.inf in a jar file, and add it to the sysconfig String |
void |
addInstalledXMLComponent(java.lang.String path)
Locate tdi.xml in a jar file, and add it to the sysconfigs Vector |
void |
addPackages(java.io.File path)
Add all files in the given path to our internal list of packages |
void |
cacheJarContents(java.lang.String path)
Locate all classes in a jar file, and add the names to a local cache. |
protected java.lang.Class<?> |
findClass(java.lang.String name)
Finds the specified class |
protected java.lang.String |
findLibrary(java.lang.String name)
Returns the absolute path name of a native library. |
protected java.net.URL |
findResource(java.lang.String name)
Finds the resource with the given name. |
protected java.util.Enumeration<java.net.URL> |
findResources(java.lang.String name)
Returns an Enumeration of URLs representing all the resources with the given name. |
static java.util.Vector<java.lang.String> |
getAllSysConfigs()
Returns a Vector with all the idi.inf files. |
static java.util.List<java.lang.String> |
getInstalledPackages()
|
static IDILoader |
getInstance()
|
static java.lang.String |
getModificationDate(java.lang.String className)
Returns the time a class was modified |
java.lang.String |
getPathForClass(java.lang.String clsname)
|
static java.lang.String |
getSysConfig()
Returns the accumulated sysConfig ( concatenation of all the idi.inf files ). |
java.lang.Class<?> |
loadClassFromFile(java.lang.String fileName)
Load a Class from a .class file Try to avoid duplicate defining of classes by keeping a local cache, which maps from fileName to class. |
java.lang.Class<?> |
loadClassFromFile(java.lang.String path,
java.lang.String className)
Locate all classes in a jar file, and define the classes found. |
static void |
main(java.lang.String[] args)
The main program for the IDILoader class |
void |
run(java.lang.String name,
java.lang.String[] args)
Main processing method for the IDILoader object. |
Methods inherited from class java.lang.ClassLoader |
---|
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLoadedClass, 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 |
---|
public IDILoader()
Method Detail |
---|
public static java.lang.String getSysConfig()
public static java.util.Vector<java.lang.String> getAllSysConfigs()
public static java.lang.String getModificationDate(java.lang.String className)
className
- the name of the class
public static java.util.List<java.lang.String> getInstalledPackages()
public java.lang.String getPathForClass(java.lang.String clsname)
clsname
- the name of the class which path to get
public static void main(java.lang.String[] args)
args
- The command line argumentspublic void addFiles(java.lang.String path)
path
- The path of the file(s) to be addedpublic void addPackages(java.io.File path)
path
- The path of the file(s) to be addedpublic void addInstalledComponent(java.lang.String path)
path
- The absolute path of the jar filepublic void addInstalledXMLComponent(java.lang.String path)
path
- The absolute path of the jar filepublic void cacheJarContents(java.lang.String path)
path
- The absolute path of the jar filepublic void run(java.lang.String name, java.lang.String[] args)
name
- The class to load and call the main method in. If name ==
null, only build internal structuresargs
- Parameters to pass to the main method in the named classprotected java.lang.Class<?> findClass(java.lang.String name) throws java.lang.ClassNotFoundException
findClass
in class java.lang.ClassLoader
name
- The name of the class
java.lang.ClassNotFoundException
- If the class could not be foundprotected java.net.URL findResource(java.lang.String name)
findResource
in class java.lang.ClassLoader
name
- The resource name
protected java.util.Enumeration<java.net.URL> findResources(java.lang.String name) throws java.io.IOException
findResources
in class java.lang.ClassLoader
name
- the resource name
java.io.IOException
- if I/O errors occurprotected java.lang.String findLibrary(java.lang.String name)
findLibrary
in class java.lang.ClassLoader
name
- The library name
public java.lang.Class<?> loadClassFromFile(java.lang.String fileName) throws java.lang.Exception
fileName
- -
The name of the .class file
java.lang.Exception
- if an internal error occurs.public static IDILoader getInstance()
public java.lang.Class<?> loadClassFromFile(java.lang.String path, java.lang.String className)
path
- The absolute path of the jar file
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |