Announcement Announcement Module
No announcement yet.
How to propogate context from web to ejb tier Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to propogate context from web to ejb tier

    Hi all,

    We are using AOP to inject Audit keys into our Web Tier requests for logging. I need to propogate this Audit Key to the EJB Tier. i.e. When my Web Tier calls an EJB in another JVM I need to pass to the SLSB the Audit key that was generated in the Web Tier for logging in the EJB tier.

    Can anybody tell me how I can pass the Audit key from my Tomcat Web Tier running on one JVM to an SLSB EJB called via RMI running on another JVM without modifying the public methods called on the SLSB via the Web Tier.

    I want to do something like marshal the Audit Key along with all other parameters when making the remote call and then have an aspect on the unmarshal (server side) call a method to set a ThreadLocal with Audit Key value while unmarshelling or just prior to executing the remote method.

    If I am on the wrong track and there is another (prefered/easier) way please let me know. Any help here would be a great help for my project and a great selling point with my management regarding bringing Spring and AOP into our main line development.


  • #2
    I am not sure if this would work your particular app server, but could you extend your RemoteInvocation to pass your web server-bound ThreadLocal to the server-side? We do something very similar - see code at