This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes Factory + ClassLoader Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Factory + ClassLoader Question" Watch "Factory + ClassLoader Question" New topic

Factory + ClassLoader Question

Guy Allard
Ranch Hand

Joined: Nov 24, 2000
Posts: 776
Hi guys -
Given: A set of class objects returned by fctory methods, e.g. Factory.getInstance().
Requirement: Dynamic loading of these classes.
Statement: In all cases, this requires a custom ClassLoader.
Is the 'Statement' correct?
Regards, Guy
Jim Yingst

Joined: Jan 30, 2000
Posts: 18671
I'm not sure what you're saying. Given a "set of class objects"? What are these, and how do they relate to the classes you want to load? Are these instances of the class Class? Instances of some other class, like maybe the one you want to load? In either of the above cases, it would seem you need to load the desired class before you can have any instances of that class, or of Class objects which represent your desired class. So I'm probably missing something here. Perhaps you could show a bit more of an example of what you're talking about?

"I'm not back." - Bill Harding, Twister
Dave Landers
Ranch Hand

Joined: Jul 24, 2002
Posts: 401
If you are trying to implement dynamic re-loading of classes, then you will need a custom ClassLoader.
Jim Yingst

Joined: Jan 30, 2000
Posts: 18671
Ah, yes. Agreed.
I agree. Here's the link:
subject: Factory + ClassLoader Question
Similar Threads
Null pointer
Loading of jar files for a Application
WebSphere Classloaders
exception handling
Deleting a class