Advertisement
Guest User

toomasr

a guest
Jan 12th, 2010
2,596
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.73 KB | None | 0 0
  1. /**
  2.  This is copied from the Tomcat 6.0 source tree. The following code is
  3.  licensed to the Apache Software Foundation. See http://tomcat.apache.org/
  4.  for more information.
  5. */
  6.  
  7.     /**
  8.      * Reload this web application, if reloading is supported.
  9.      * <p>
  10.      * <b>IMPLEMENTATION NOTE</b>:  This method is designed to deal with
  11.      * reloads required by changes to classes in the underlying repositories
  12.      * of our class loader.  It does not handle changes to the web application
  13.      * deployment descriptor.  If that has occurred, you should stop this
  14.      * Context and create (and start) a new Context instance instead.
  15.      *
  16.      * @exception IllegalStateException if the <code>reloadable</code>
  17.      *  property is set to <code>false</code>.
  18.      */
  19.     public synchronized void reload() {
  20.  
  21.         // Validate our current component state
  22.         if (!started)
  23.             throw new IllegalStateException
  24.                 (sm.getString("containerBase.notStarted", logName()));
  25.  
  26.         // Make sure reloading is enabled
  27.         //      if (!reloadable)
  28.         //          throw new IllegalStateException
  29.         //              (sm.getString("standardContext.notReloadable"));
  30.         if(log.isInfoEnabled())
  31.             log.info(sm.getString("standardContext.reloadingStarted"));
  32.  
  33.         // Stop accepting requests temporarily
  34.         setPaused(true);
  35.  
  36.         try {
  37.             stop();
  38.         } catch (LifecycleException e) {
  39.             log.error(sm.getString("standardContext.stoppingContext"), e);
  40.         }
  41.  
  42.         try {
  43.             start();
  44.         } catch (LifecycleException e) {
  45.             log.error(sm.getString("standardContext.startingContext"), e);
  46.         }
  47.  
  48.         setPaused(false);
  49.  
  50.     }
  51.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement