Example #1
0
  public void exit() {
    session.close();

    if (dnsCache != null) {
      System.out.printf(" cache= %s%n", dnsCache.toString());
      System.out.printf(" cache.size= %d%n", dnsCache.getSize());
      System.out.printf(" cache.memorySize= %d%n", dnsCache.getMemoryStoreSize());
      Statistics stats = dnsCache.getStatistics();
      System.out.printf(" stats= %s%n", stats.toString());
    }

    cacheManager.shutdown();
    fileChooser.save();
    managePanel.save();
    accessLogPanel.save();
    servletLogPanel.save();
    urlDump.save();

    Rectangle bounds = frame.getBounds();
    prefs.putBeanObject(FRAME_SIZE, bounds);
    try {
      store.save();
    } catch (IOException ioe) {
      ioe.printStackTrace();
    }

    done = true; // on some systems, still get a window close event
    System.exit(0);
  }
Example #2
0
 private static synchronized void kill() {
   if (sessionList != null) {
     for (HTTPSession session : sessionList) {
       session.close();
     }
     sessionList.clear();
     // Rebuild the connection manager
     connmgr.shutdown();
     connmgr = new MultiThreadedHttpConnectionManager();
     setGlobalThreadCount(DFALTTHREADCOUNT);
   }
 }
Example #3
0
 public void closeSession() {
   try {
     if (allowSessions && hasSession) {
       openConnection(
           urlStringEncoded + ".close",
           new Command() {
             public void process(InputStream is) throws IOException {
               byte[] buffer = new byte[4096]; // read the body fully
               while (is.read(buffer) > 0) {
                 // empty
               }
             }
           });
     }
     if (_session != null) _session.close();
     _session = null;
   } catch (Throwable t) {
     // ignore
   }
 }