예제 #1
0
  public void doStart() {
    try {
      TaskLog.logWithTimestamp("Starting web application " + this.getDescriptor());
      if (jettyEnvXml != null && jettyEnvXml.exists())
        envConfiguration.setJettyEnvXml(Resource.toURL(jettyEnvXml));

      ClassLoader parentLoader = this.getClass().getClassLoader();
      if (parentLoader instanceof AntClassLoader)
        parentLoader = new AntURLClassLoader((AntClassLoader) parentLoader);

      setClassLoader(new WebAppClassLoader(parentLoader, this));
      if (attributes != null && attributes.getAttributes() != null) {
        for (Attribute a : attributes.getAttributes()) setAttribute(a.getName(), a.getValue());
      }

      // apply a context xml file if one was supplied
      if (contextXml != null) {
        XmlConfiguration xmlConfiguration = new XmlConfiguration(Resource.toURL(contextXml));
        TaskLog.log("Applying context xml file " + contextXml);
        xmlConfiguration.configure(this);
      }

      super.doStart();
    } catch (Exception e) {
      TaskLog.log(e.toString());
    }
  }
예제 #2
0
 /** @see WebApplicationProxy#stop() */
 public void doStop() {
   try {
     scanFiles = null;
     TaskLog.logWithTimestamp("Stopping web application " + this);
     Thread.currentThread().sleep(500L);
     super.doStop();
   } catch (InterruptedException e) {
     TaskLog.log(e.toString());
   } catch (Exception e) {
     TaskLog.log(e.toString());
   }
 }
예제 #3
0
 public void setJettyEnvXml(File jettyEnvXml) {
   this.jettyEnvXml = jettyEnvXml;
   TaskLog.log(
       "jetty-env.xml file: = " + (jettyEnvXml == null ? null : jettyEnvXml.getAbsolutePath()));
 }