I have various EJBs on a J2EE-server, with different security roles.
Now, from a Java Swing client application, when I log the user on to the server, I would like to discover which of these EJBs that are accessible to the user, without actually trying to create them or invoke them.
The reason I want to do this is to adjust the user interface depending on which EJBs are available.
For instance, if the "AdministerMetadata" EJB is usable by the current user, I want to display a menu option for administering metadata etc.
It is acceptable for me to query from a predefined list of known EJBs within the client, so I dont need it to be totally dynamic that way.
I dont want to create a special EJB to just return this access-information, and I want to avoid having to try to call methods and catch Exceptions to do the discovery.
I am planning on using the solution on JBoss, but would prefer a standard solution if possible.
Is this possible? If so how?