/** * This method is used by MDB Container - Invocation Manager to setup * the run-as identity information. It has to be coupled with * the postSetRunAsIdentity method. * This method is called for EJB/MDB Containers */ public void preInvoke(ComponentInvocation inv) { //Optimization to avoid the expensive call if(runAs == null) { inv.setPreInvokeDone(true); return; } boolean isWebService = false; if (inv instanceof EjbInvocation) { isWebService = ((EjbInvocation) inv).isWebService; } // if it is not a webservice or successful authorization // and preInvoke is not call before if ((!isWebService || (inv.getAuth() != null && inv.getAuth().booleanValue())) && !inv.isPreInvokeDone()) { inv.setOldSecurityContext(SecurityContext.getCurrent()); loginForRunAs(); inv.setPreInvokeDone(true); } }
/** * This method is used by MDB Container - Invocation Manager to setup * the run-as identity information. It has to be coupled with * the postSetRunAsIdentity method. * This method is called for EJB/MDB Containers */ public void preInvoke(ComponentInvocation inv) { //Optimization to avoid the expensive call if(runAs == null) { inv.setPreInvokeDone(true); return; } boolean isWebService = false; if (inv instanceof EjbInvocation) { isWebService = ((EjbInvocation) inv).isWebService; } // if it is not a webservice or successful authorization // and preInvoke is not call before if ((!isWebService || (inv.getAuth() != null && inv.getAuth().booleanValue())) && !inv.isPreInvokeDone()) { if (runAs != null) { inv.setOldSecurityContext(SecurityContext.getCurrent()); loginForRunAs(); } inv.setPreInvokeDone(true); } }