I am designing a system to update member variables in objects automatically by marking them with some annotation. Some other background thread will then update the objects.
To do this, the runtime component doing the updating needs to know all Java objects that contain this annotation. I can see that there are methods to find classes with an annotation type, but going from classes to instances of the classes is a lot harder. I want to avoid explicitly "registering" the object in the constructor, although I could do that as a last resort.
Any suggestions as to how this might be achieved?