public static MutableBoolean stop ( boolean forceJvmToStop ) { if ( stop != null ) { new Exception ( "LCCore already stopped" , stop ) . printStackTrace ( System . err ) ; return new MutableBoolean ( true ) ; } stop = new Exception ( "LCCore stop requested here" ) ; MutableBoolean stopped = new MutableBoolean ( false ) ; new Thread ( "Stopping LCCore" ) { @ Override public void run ( ) { synchronized ( toDoInMainThread ) { toDoInMainThread . notify ( ) ; } if ( instance != null ) instance . stop ( ) ; if ( forceJvmToStop ) { System . out . println ( "Stop JVM." ) ; System . exit ( 0 ) ; } synchronized ( stopped ) { stopped . set ( true ) ; stopped . notifyAll ( ) ; } } } . start ( ) ; return stopped ; }
Stop the environement .