Пример #1
0
 /**
  * Hook method called by the super-class if the server enters unexpected state. This method
  * destroys the server process and changes state to disabled.
  */
 protected void handleUnexpectedState(Boolean stateChanged) {
   if (mProcess != null) {
     try {
       mProcess.exitValue();
       // the process has already exitted, try to restart it
       changeState(STATE_START_DEPENDENCIES);
     } catch (IllegalThreadStateException itse) {
       // the process is still running, so kill it
       mProcess.destroy();
     }
   } else {
     setDisabled(true);
     changeState(STATE_DISABLED);
   }
 }