Well i'm just experimenting a bit. I am playing around with reflection and yes they need to be
EJB because they are already in use. The foo() in this case is a sort of check/monitoring function which I want to implement to the EJB. I want to invoke the method every X minutes. Now I can just add the EJB reference to my check code but it would be nice if my check could could fetch all the bean references itself and call the foo() methode if its implemented.
The idea is that if a add a EJB with foo() it will be invoked (or if I add the foo() to an existing EJB) without having to think about adding it to the check code.
I know it looks a bit overkill (or pointless ;-)) but its a test project and want to try some new ideas thats why I was wondering if it was possible at all to get the beans on-the-fly.
Edit: Oh and I am aware of the performance impact but thats not an issue