Mike Stoddart [
https://community.jboss.org/people/stodge] created the discussion
"Any way to reload or rebuild a class with different methods/member data?"
To view the discussion, visit:
https://community.jboss.org/message/798833#798833
--------------------------------------------------------------
I can successfully create class definitions at runtime using Javassist, but I also need
the ability to rebuild the definitions to add/remove/change member data and their
getters/setters. Is this at all possible? I'm using a custom class loader for the
classes that I generate. I was hoping I could do something like this:
- create class definition in custom class pool (
http://www.csg.ci.i.u-tokyo.ac.jp/~chiba/javassist/html/javassist/ClassPo...
ClassPool(
http://www.csg.ci.i.u-tokyo.ac.jp/~chiba/javassist/html/javassist/ClassPo... ClassPool
parent))
- add to custom class loader
Then later:
- retrieve CtClass instance and detach it from the pool
- remove from custom class loader
- create new class definition with the same class path
- add to same custom class loader
Or alternatively:
- retrieve CtClass instance and detach it from the pool
- remove all fields and methods
- create new fields and methods
Is this at all possible? Thanks
--------------------------------------------------------------
Reply to this message by going to Community
[
https://community.jboss.org/message/798833#798833]
Start a new discussion in Javassist at Community
[
https://community.jboss.org/choose-container!input.jspa?contentType=1&...]