I think you should not annotate the scan, as it slows down the launch and requires a lot of memory. JEE application servers run annotation scans at startup to make lazy programmers happy, and the result is very annoying (like scanning JPA or EJB annotations).
I assume that you are introducing a technology in which you can define the rules. I suggest you define rules that are similar to them:
- Annotate your class
- Enter the MANIFEST header in which the annotated class should be specified.
An even better solution would be to use a custom capability namespace with the specified attributes. For instance:.
Provide-Capability: myNamespace;classes=com.foo.myClass1,com.foo.myClass2
In your technology, you should write a BundleTracker that calls:
BundleWiring.getCapabilities("myNamespace");
, , .
, Bnd MANIFEST. , bnd , maven.
Btw: ASM - Java AST. , , MANIFEST, . MANIFEST, -, -.