예제 #1
0
  /** Stops the filter and the attached routes. */
  @Override
  public synchronized void stop() throws Exception {
    if (isStarted()) {
      if (getDefaultRoute() != null) {
        getDefaultRoute().stop();
      }

      for (Route route : getRoutes()) {
        route.stop();
      }

      super.stop();
    }
  }
예제 #2
0
 /** Attempts to {@link #stop()} the Restlet if it is still started. */
 @Override
 protected void finalize() throws Throwable {
   if (isStarted()) {
     stop();
   }
 }