How to inject a system name across EJBs in JBoss EAP?
Issue
- We have two web applications share a common backend ejb layer. We audit all the transactions that come to backend layer. We currently use context.getCallerPrincipal().getName() to obtain the logged in user. Since the user can login from both the applications, now we would like to capture the system name as well during the audit.
- Is there a way to inject the system name and use across all the business methods, instead of changing method signatures of all the methods and pass system name along with it.
- Can you please let me know if there is any we can inject system name in to Context or something in webtier and retrieve the same information in the EJB layer, instead of passing as an argument to business method.
Environment
- JBoss Enterprise Application Platform 4.3
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
