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);
}

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 ) ; }
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
