Does JDO fit my requirements?
1. load Foo.className YES
2. Use the className to look up the "jar file" Why need this?
3. Create a classloader from the "jar file". Why need this?
4. Create a ObjectInputStreamWithLoader Why need this?
5. Use the ObjectInputStreamWithLoader to deseriliaze the .objectInstance. Why need this?
Samples:
pakcage com.foo;
public class Student implments Serializable{
......
}
public class StudentObj{
private Sting classname;
private Object student;
public StudentObj( final String name,
final Object student ){
this.classname = name;
this.student = student;
}
public Object getStudent(){
return this.student;
}
}
In Liberator JDO, define StudentObj as a perisstencecapable class,persist the StudentObj like this;
persistenceManager.currentTrasaction().begin();
persistenceManager.makePersistent( studentObj );
persistenceManager.currentTrasaction().commit();
The above code will persist studentObj and all its fields, including student as a binary blob.
Whe you use JDO to load sutdentObj, just call getStudent() you will get a student instance( not a class ). You don't need to use classloader to load and create a student instance.