|
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
Method
s.
Classes that will make use of ClassLoaderMethodCaller
are;
IrregularMapping
objects for their methods. Also, IrregularMapping
s
will be used in granularityLattice, which is still in design stage. Calendar
because of regular methods. regular functions
refer to two functions, which all Calendar
s should have: "granuleToFields
and fieldsToGranule". FVFunction
because of Field Value functions.
IrregularMapping
,
Calendar
,
FVFunction
Field Summary | |
private java.util.Hashtable |
methodsToClass
A Hashtable, which maps methods of this CLMC to loaded classes. |
Fields inherited from class java.net.URLClassLoader |
|
Fields inherited from class java.security.SecureClassLoader |
|
Fields inherited from class java.lang.ClassLoader |
|
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 |
addURL, definePackage, findClass, findResource, findResources, getPermissions, getURLs, newInstance, newInstance |
Methods inherited from class java.security.SecureClassLoader |
defineClass |
Methods inherited from class java.lang.ClassLoader |
clearAssertionStatus, defineClass, defineClass, defineClass, definePackage, findLibrary, 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, wait, wait, wait |
Field Detail |
private java.util.Hashtable methodsToClass
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 URLsMethod 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
DynamicLoadException
public java.lang.String toString()
ClassLoaderMethodCaller
.
toString
in class java.lang.Object
ClassLoaderMethodCaller
|
tauZaman v0.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |