|
tauZaman v0.1 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.lang.ClassLoader
|
+--java.security.SecureClassLoader
|
+--java.net.URLClassLoader
|
+--tauzaman.ClassLoaderMethodCaller
ClassLoaderMethodCaller class dynamically loads
a Class and provide service for calling any of loaded
Methods.
Classes that will make use of ClassLoaderMethodCaller are;
IrregularMapping objects for their methods. Also, IrregularMappings
will be used in granularityLattice, which is still in design stage. Calendar because of regular methods. regular functions
refer to two functions, which all Calendars should have: "granuleToFields
and fieldsToGranule". FVFunction because of Field Value functions.
IrregularMapping,
Calendar,
FVFunction| Constructor Summary | |
ClassLoaderMethodCaller(java.net.URL[] urls)
Constructs a ClassLoaderMethodCaller object with specified URLs.
|
|
| Method Summary | |
java.lang.Object |
callMethod(java.lang.String methodName,
java.lang.Class[] parameterTypes,
java.lang.Object[] args)
Calls method with specified method name with specified actual parameters. |
void |
loadClass(java.lang.String className,
java.lang.String methodName)
Finds and loads the class with the specified name from the URL search path. |
java.lang.String |
toString()
Returns string representation of method name - class name mapping of this ClassLoaderMethodCaller. |
| Methods inherited from class java.net.URLClassLoader |
findResource, findResources, getURLs, newInstance, newInstance |
| Methods inherited from class java.lang.ClassLoader |
clearAssertionStatus, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public ClassLoaderMethodCaller(java.net.URL[] urls)
Constructs a ClassLoaderMethodCaller object with specified URLs.
Any URL that ends with a '/' is assumed to refer to a directory. Otherwise,
the URL is assumed to refer to a JAR file which will be downloaded and opened
as needed.
Although constructor takes an array of URLs, we only use first URL in this array since urls in the system are always either contain a single class or point to a directory or a .jar file, which contain multiple classes.
urls - array of URLs| Method Detail |
public void loadClass(java.lang.String className,
java.lang.String methodName)
throws DynamicLoadException
className - name of the class to be searched and loadedmethodName - name of the method related to loaded class
java.lang.Exception - if any abnormal condition occurs when loading a class,
Exception may further be specialized
DynamicLoadException
public java.lang.Object callMethod(java.lang.String methodName,
java.lang.Class[] parameterTypes,
java.lang.Object[] args)
throws DynamicLoadException
methodName - name of the Method to be calledparameterTypes - the list of parameters. This is passed as a parameter
instead of having fix names (which can also be done) to allow generality for
a possible changes in future time.args - the arguments used for the method call
java.lang.Exception - if any abnormal condition occurs when loading a class,
Exception may further be specialized
DynamicLoadExceptionpublic java.lang.String toString()
ClassLoaderMethodCaller.
toString in class java.lang.ObjectClassLoaderMethodCaller
|
tauZaman v0.1 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||