Hook up Jetty handlers.  Do this before start() is called.
518736
ServletContextHandler createServletContextHandler() {
    // Both security and session handlers are already created (Note: we don't want to create a new separate session
    // handler just for ServletContextHandler - we want to have just one SessionHandler & SessionManager)
    final ServletContextHandler context = new ServletContextHandler(ServletContextHandler.NO_SECURITY | ServletContextHandler.NO_SESSIONS);

    if(null != config.context_path && ! config.context_path.isEmpty()) {
      context.setContextPath(config.context_path);
    } else {
      context.setContextPath("/");
    }
    return context;
  }
266145
private void initServerHandle(Configuration pConfig, LogHandler pLogHandler, List<ServerDetector> pDetectors) {
        serverHandle = detectServers(pDetectors, pLogHandler);
        if (serverHandle != null) {
            serverHandle.postDetect(mBeanServerManager, pConfig, pLogHandler);
        }
    }
709102
def setup(self):
        
        self.pre_handlers = pre_handlers = {}
        self.post_handlers = post_handlers = {}
        for name in sorted(vars(type(self))):
            if name.startswith('init_'):
                getattr(self, name)()
            elif name.startswith('pre_'):
                pre_handlers[name[4:]] = getattr(self, name)
            elif name.startswith('post_'):
                post_handlers[name[5:]] = getattr(self, name)
1269975
def trigger(self, *args, **kwargs):
        """"""
        for h in self.handlers:
            h(*args, **kwargs)
1158942
public static void start(String webAppDir, int port, String context, int scanIntervalSeconds) {
		server = com.jfinal.server.jetty.ServerFactory.getServer(webAppDir, port, context, scanIntervalSeconds);
		server.start();
	}
25735
public void postDeploy() throws Throwable
   {
      if (server != null &&
          !server.isRunning() &&
          handlers != null && handlers.getHandlers() != null && handlers.getHandlers().length > 0)
      {
         try
         {
            ContextHandlerCollection chc = new ContextHandlerCollection();
            chc.setHandlers(handlers.getHandlers());

            server.setHandler(chc);
      
            server.start();
         }
         catch (Exception e)
         {
            log.error("Could not start Jetty webserver", e);
         }
      }
   }
542060
void start(Handler<ConnectionOutputBatch> startHandler) {
    connection.doBatchStart(id, args);
    this.startHandler = startHandler;
  }
1295755
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
		final HandlerLocation location = new HandlerLocation(request, handler, HandlerStep.CONTROLLER);
		threadLocation.set(location);

		// Start controller stopwatch
		startStopwatch(location);
		return true;
	}
1154311
def on(self, handler):
        """"""
        if not hasattr(handler, '__call__'):
            raise TypeError('handler is not a callable object.')
        self.handlers.add(handler)
684163
def listen_init(self):
        """"""
        self.dispatcher = ObjectDispatch(self)
        self.factory = MsgPackProtocolFactory(self.dispatcher)
        self.server = UnixServer(self.loop, self.factory, self.path)
        self.server.start()
1263196
function(app, serverType, handlerMap) {
  let p = pathUtil.getHandlerPath(app.getBase(), serverType);
  if(p) {
    handlerMap[serverType] = Loader.load(p, app);
  }
}
497187
function setBeforeRouteChangeHandler(handler) {
            if (null == handler) {
                return _beforeRouteChange;
            }
            else {
                var oldHandler = _beforeRouteChange;
                _beforeRouteChange = handler;
                return oldHandler;
            }
        }
451073
public void startServer() {

    server = new Server(httpPort);
    server.setHandler(wrapHandlers());

    if (isWebSocketInClassPath()) {
      setupForWebSocket();
    }
    try {
      server.start();
      log().info("server started");

      Runtime.getRuntime().addShutdownHook(new Thread(new ShutdownRunnable()));
      
      if (useStdInShutdown) {
        // generally for use in IDE via JettyRun, Use CTRL-D in IDE console to shutdown
        BufferedReader systemIn = new BufferedReader(new InputStreamReader(System.in, "UTF-8"));
        while((systemIn.readLine()) != null) {
          // ignore anything except CTRL-D by itself
        }
        System.out.println("Shutdown via CTRL-D");
        System.exit(0);
      }

    } catch (Exception e) {
      e.printStackTrace();
      System.exit(100);
    }
  }
1095062
void start(final Handler<OutputGroup> startHandler) {
    connection.doGroupStart(id, name, args, parent);
    this.startHandler = startHandler;
  }
1141862
public void activate() {
        // if no handlers are currently running, start one now
        if (this.numHandlersInFlight.getInt() == 0) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Activating result handler: " + this.completionPort);
            }
            startHandler();
        }
    }
815097
@Override
    public void start() {
        if (started) {
            return;
        }
        ApplicationHandler handler = getApplicationHandler();
        if (handler == null) {
            throw new IllegalStateException("ApplicationHandler cannot be null");
        }
        handler.onStartup(this);
        started = true;
    }
871999
@Override
  public void handle(
      final String target,
      final HttpServletRequest request,
      final HttpServletResponse response,
      final int i)
      throws IOException, ServletException {
    LOG.log(Level.INFO, "JettyHandler handle is entered with target: {0} ", target);

    final Request baseRequest = (request instanceof Request) ? (Request) request :
        HttpConnection.getCurrentConnection().getRequest();

    response.setContentType("text/html;charset=utf-8");

    final ParsedHttpRequest parsedHttpRequest = new ParsedHttpRequest(request);
    final HttpHandler handler = validate(request, response, parsedHttpRequest);
    if (handler != null) {
      LOG.log(Level.INFO, "calling HttpHandler.onHttpRequest from JettyHandler.handle() for {0}.",
          handler.getUriSpecification());
      handler.onHttpRequest(parsedHttpRequest, response);
      response.setStatus(HttpServletResponse.SC_OK);
    }

    baseRequest.setHandled(true);
    LOG.log(Level.INFO, "JettyHandler handle exists");
  }