This is for JBoss EJB 3 integration code, so we can use JBoss interfaces, not
just EJB standard interfaces.
Inside an interceptor instance, I need access to the ejbName of the EJB being
intercepted (so I can use this as a unique key to look up other info on the
EJB). Currently I am doing this ugly hack:
try {
| guidField =
StatefulSessionContextImpl.class.getDeclaredField("containerGuid");
| guidField.setAccessible(true);
| } catch (Exception e) {
| throw new RuntimeException(e);
| }
|
| ...
|
| try {
| String guid = (String) guidField.get(sessionContext);
| Container container = Ejb3Registry.getContainer(guid);
| return container.getEjbName();
| } catch (Exception e) {
| throw new RuntimeException(e);
| }
Any suggestions on how to improve?
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4252158#4252158
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4252158
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user