getting class object using custom class loader

getting class object using custom class loader

Post by nagarwa » Wed, 11 Aug 2004 18:49:04


Hi

I've written a Custom class loader, which reads the bytecode from a
database and returns the Class object.

For example, bytecode of a class "Test" is stored in the database.
Through custom class loader, I get the Class object for this class
"Test" as follows:

Class c = cl.loadClass("Test",true)) // cl is instance of my custom
class loader

Now I want to call the methods of "Test" class.
Is it possible to get an instance of the Test class?

One way to access the methods of the Test object is using reflection
APIs, but is there a way I can directly get the instance of Test
class, which I can use to call its methods.

thanks,
Naresh