I have a compiled JavaBean named "AClass" which may or may not implement some interfaces at compile-time. Regardless, I want to force this class at runtime to implement a marker interface of my choice. Is this possible? Can anybody steer me in the right direction? Can a new JVM langauge like Scala or Closure do this? Am I insane?
Yeah, I'm confused as well. If the class doesn't implement some interface at compile time, how do you propose forcing it to implement it at runtime?
There are libraries out there that allow you to take a class at runtime, add some methods to it (that implement an interface), and then have it declare that it implements the interface - is that what you're asking about? If so, a library like Javassist is called for.