public String getStateAsString ( ) { Integer state = getState ( ) ; if ( STOPPED . equals ( state ) ) { return "Stopped" ; } if ( STARTING . equals ( state ) ) { return "Starting" ; } if ( RUNNING . equals ( state ) ) { return "Running" ; } if ( STOPPING . equals ( state ) ) { return "Stopping" ; } throw new IllegalStateException ( "Unknown state: " + state ) ; }
Get the name of current state