public static AuditorModuleContext getContext ( ) { SecurityContext securityContext = SecurityContextFactory . getSecurityContext ( ) ; if ( ! securityContext . isInitialized ( ) ) { securityContext . initialize ( ) ; } AbstractModuleContext moduleContext = securityContext . getModuleContext ( CONTEXT_ID ) ; if ( null == moduleContext || ! ( moduleContext instanceof AuditorModuleContext ) ) { moduleContext = ContextInitializer . defaultInitialize ( ) ; securityContext . registerModuleContext ( CONTEXT_ID , moduleContext ) ; } return ( AuditorModuleContext ) moduleContext ; }
Returns the current singleton instance of the Auditor Module Context from the ThreadLocal cache . If the ThreadLocal cache has not been initialized or does not contain this context then create and initialize module context register in the ThreadLocal and return the new instance .