final static void stop ( ) { if ( lifeCycle . getStatus ( ) . equals ( RunStatus . RUNNING ) || lifeCycle . getStatus ( ) . equals ( RunStatus . DISABLED ) ) { lifeCycle . setStatus ( RunStatus . STOPPED ) ; Log . info ( "Preparing to shutdown Audit4j..." ) ; Log . info ( "Closing Streams..." ) ; auditStream . close ( ) ; Log . info ( "Shutdown handlers..." ) ; for ( Handler handler : configContext . getHandlers ( ) ) { handler . stop ( ) ; Log . info ( handler . getClass ( ) . getName ( ) + " shutdown." ) ; } Log . info ( "Disposing configurations..." ) ; configContext = null ; conf = null ; Log . info ( "Audit4j shutdown completed." ) ; } else { Log . info ( "No active Audit4j instance. Cancelling shutdown request." ) ; } }
The Audit4j context shutdown method . This will release the all allocated resources by the Audit4j Context initialization .