Often it's useful for Auditing or security purposes to get the IP Address of the client making a remote EJB3 Call. This information is not readily available in the Context of an EJB3 Bean. Here's a hack to be able to achieve this in JBoss 4.x.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
There is an answer on this page https://community.jboss.org/wiki/HowToGetTheClientIpAddressInAnEJB3Interceptor?_sscc=t
Basically it uses the thread name to obtain the ip address as each call is launched in its own thread...