I think explanations given with the answer are incorrects regarding the EJB 3 core specification :
You say :"but getCallerPrincipal() or isCallerInRole() cannot be called by an MDB. "
But the spec. says that we can call getCallerPrincipal() on MessageDrivenContext.
See table 3 p 117 of the spec. and the assertion on p 108 about MessageDrivenContext :"The getCallerPrincipal method returns the java.security.Principal that is associated with the invocation."
I agree that the caller is the container and not a client.
Furthermore, I think there is a mix-up in the explanation about MessageContext (for Jax-PRC Web services) and the MessageDrivenContext interface.
- Site Admin
- Posts: 8852
- Joined: Fri Sep 10, 2010 9:26 pm
thanks for your feedback!
Users browsing this forum: No registered users and 2 guests