question: public static void init ( final AsyncContext context ) { final SecurityContext security = ( SecurityContext ) context . getAttribute ( AsyncContext . SECURITY_CTX ) ; final boolean forceSetSecurity = forceSetSecurityContext ( context ) ; if ( forceSetSecurity ) { SecurityContextHolder . setContext ( security ) ; } ctx . set ( context ) ; }
target:  Initialise security context from async context. There are two types that we operate with: 1. SecurityContextHolder - that holds the current Spring security context 2. FlexContext - that holds flex credentials (including password) which is used to access WS We nee both of these contexts to allow BulkImport, ReindexService and CacheDirector operate properly