private static void restoreInvocationSubject ( SubjectCookie cookie ) { try { if ( cookie . token != null ) { // We sync'ed the subject's identity to the thread under setInvocationSubject. // Now restore the previous identity using the token returned when we sync'ed. ThreadIdentityManager . resetChecked ( cookie . token ) ; } } catch ( ThreadIdentityException e ) { throw new SecurityException ( e ) ; } finally { SubjectManagerService sms = smServiceRef . getService ( ) ; if ( sms != null ) { sms . setInvocationSubject ( cookie . subject ) ; } } }
Restore the invocation subject .