java - How to set the principal of a MessageDriven bean using annotations? -


I'm running on glassfish v4 and I use the messierian bean. Currently I am defining the principal under which the bean resembles glassfish-ejb-jar.xml :

  & lt; Enterprise-Beans & gt; & Lt; EJB & gt; & Lt; EJB-Name & gt; MessageConsumerBean & lt; / EJB-name & gt; & Lt; Principal & gt; & Lt; Name & gt; MDBPrincipal & lt; / Name & gt; & Lt; / Principal & gt;  

Is it possible to use annotations eg? @MessageDriven ? According to section 5.4.14 page 133, a principal may be in

Promoted security reference but details are not controlled by EJB specs. In other words it is a platform based feature. One can use @RunAs, if MDB should be given a specific role to run some protected @ RollAlver method.

If you need a principal for some application logic, then I am afraid that your platform dependent solution like RunAsPrincipal (JBoss) or glassfish-ejb-jar.xml is only in your case.


Comments

Popular posts from this blog

winforms - C# Form - Property Change -

javascript - amcharts makechart not working -

java - Algorithm negotiation fail SSH in Jenkins -