public DeployerServlet(Server server){
  this.configHome=System.getProperty("config.home");
  if (this.configHome == null) {
    this.configHome=System.getProperty("jetty.base");
  }
  if (this.configHome == null) {
    this.configHome=System.getProperty("jetty.home");
  }
  if (this.configHome == null) {
    throw new IllegalStateException("Cannot find the Jetty configuration home");
  }
  this.webAppDirectory=new File(this.configHome,"webapps");
  Handler[] handles=server.getChildHandlers();
  for (  Handler handle : handles) {
    if (handle instanceof ContextHandlerCollection) {
      chc=(ContextHandlerCollection)handle;
      break;
    }
  }
}

public DeployerServlet ( Server server ) { this . configHome = System . getProperty ( "config.home" ) ; if ( this . configHome == null ) { this . configHome = System . getProperty ( "jetty.base" ) ; } if ( this . configHome == null ) { this . configHome = System . getProperty ( "jetty.home" ) ; } if ( this . configHome == null ) { throw new IllegalStateException ( "Cannot find the Jetty configuration home" ) ; } this . webAppDirectory = new File ( this . configHome , "webapps" ) ; Handler [ ] handles = server . getChildHandlers ( ) ; for ( Handler handle : handles ) { if ( handle instanceof ContextHandlerCollection ) { chc = ( ContextHandlerCollection ) handle ; break ; } } }
creates the deployerservlet and gives the servlet reference to the server in which it is deployed . this gives the servlet access to the server internals which allows for deployment control .
