Reputation: 37
I've been trying to write an EJB that scans the JBoss server that it is running on and comes up with a list of all available classes that implement a particular interface. This is easy in C# and I've seen a few examples in Java. However, the Java examples are designed for use in an Application container. I need something that works on JBoss.
I've tried playing with enumerating all available EJBs and haven't been able to make it work. Can anyone help me with this?
Thanks, Avi
Upvotes: 1
Views: 1107
Reputation: 1482
If you want to get all implementations of some interface, you can use @Any annotation and Instance class.
Take a look at this: https://goo.gl/Kbn0bP
Upvotes: 0
Reputation: 11602
You can use JMX to connect with JBoss server & can get all beans that are deployed on the server. Then as you can use reflection to verify further, implementation for particular interface etc.
Link : How do I find out what port my jboss server is listening on programmatically using JBoss 4.2.3? connection with JBoss using JMX. Then base on specific attributes, you can fetch information from the server.
Upvotes: 1
Reputation: 533472
You might find this library useful http://code.google.com/p/reflections/
Using Reflections you can query your metadata such as:
Upvotes: 1