1 Reply Latest reply on Feb 3, 2005 2:54 PM by rkadayam

    Inteception and SessionContext

    john howard Newbie

      On an intercept of a method call to a stateless session bean, is there anyway to get the SessionContext. Failing this is there anyway I can obtain the caller details (e.g. principal and isinrole). I have no control over the SLSB, which may or may not have kept the session context passed in setSessionContext().

      Thanks for any help,


        • 1. Re: Inteception and SessionContext
          rkadayam Newbie

          You can intercept the setSessionContext(SessionContext) method to temporarily store the sessioncontext in some singleton (like JBoss Cache).
          Retrieve this context in subsequent interceptions to other method calls and at that point you can attempt to retrieve the principal details. Note if you do'nt create a login context before invoking the session bean you will not have a valid principal and it may even throw some illegal argument exception.

          Hope this helps.