Re: Reflection: discovering the implementations of an interface



z-man wrote:

What's the smoother way to discover via reflection all the classes
implementing a specific interface inside a package?

Not necessarily smoother but possibly most accurate way to achieve that is to instrument your program with you own agent (see java.lang.instrument package specifications on how to do that), and than having Instrumentation instance (passed to the agent's premain() by the JVM) filter the results of getAllLoadedClasses() call on that instance.


piotr
.