org.eclipse.jetty.webapp.WebAppContext.setEventListeners()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(3.6k)|赞(0)|评价(0)|浏览(106)

本文整理了Java中org.eclipse.jetty.webapp.WebAppContext.setEventListeners()方法的一些代码示例,展示了WebAppContext.setEventListeners()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebAppContext.setEventListeners()方法的具体详情如下:
包路径:org.eclipse.jetty.webapp.WebAppContext
类名称:WebAppContext
方法名:setEventListeners

WebAppContext.setEventListeners介绍

暂无

代码示例

代码示例来源:origin: kaaproject/kaa

@Override
public void start() {
 LOG.info("Starting Kaa Admin Web Server...");
 server = new Server(adminPort);
 webAppContext = new WebAppContext();
 webAppContext.setEventListeners(new EventListener[]{adminContextLoaderListener});
 webAppContext.setContextPath("/");
 String webXmlLocation = AdminInitializationService.class.getResource("/admin-web/WEB-INF/"
   + webXmlFile).toString();
 webAppContext.setDescriptor(webXmlLocation);
 String resLocation = AdminInitializationService.class.getResource("/admin-web").toString();
 webAppContext.setResourceBase(resLocation);
 webAppContext.setParentLoaderPriority(true);
 server.setHandler(webAppContext);
 try {
  server.start();
  LOG.info("Kaa Admin Web Server started.");
 } catch (Exception ex) {
  LOG.error("Error starting Kaa Admin Web Server!", ex);
 }
}

代码示例来源:origin: jenkinsci/jenkinsfile-runner

@Override
  protected void doStart() {
    context.setEventListeners(null);
  }
}

代码示例来源:origin: io.jenkins.jenkinsfile-runner/setup

@Override
  protected void doStart() {
    context.setEventListeners(null);
  }
}

代码示例来源:origin: jenkinsci/jenkins-test-harness

@Override
  protected void doStart() throws Exception {
    context.setEventListeners(null);
  }
}

代码示例来源:origin: org.jmockring/jmockring-jetty

@Override
  public void setEventListeners(EventListener[] eventListeners) {
    // Our listener will have to be at the end of the list
    // so that the real Spring context listener gets to execute first.
    LinkedList<EventListener> reorderedEventListeners = new LinkedList<EventListener>();
    if (eventListeners != null) {
      Collections.addAll(reorderedEventListeners, eventListeners);
    }
    int pos = reorderedEventListeners.indexOf(myContextLoaderListener);
    if (pos < 0) {
      // not inserted yet
      reorderedEventListeners.addLast(myContextLoaderListener);
    } else if (pos < reorderedEventListeners.size() - 1) {
      // the listener is not at the bottom, need to shift it
      reorderedEventListeners.remove(pos);
      reorderedEventListeners.addLast(myContextLoaderListener);
    }
    super.setEventListeners(reorderedEventListeners.toArray(new EventListener[reorderedEventListeners.size()]));
  }
};

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

@Override
  public void deconfigure (WebAppContext context) throws Exception
  {
    // TODO preserve any configuration that pre-existed.

    ServletHandler _servletHandler = context.getServletHandler();
        _servletHandler.setFilters(null);
    _servletHandler.setFilterMappings(null);
    _servletHandler.setServlets(null);
    _servletHandler.setServletMappings(null);

    context.setEventListeners(null);
    context.setWelcomeFiles(null);

    if (context.getErrorHandler() instanceof ErrorPageErrorHandler)
      ((ErrorPageErrorHandler) 
          context.getErrorHandler()).setErrorPages(null);

    // TODO remove classpaths from classloader

  }
}

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

@Override
  public void deconfigure (WebAppContext context) throws Exception
  {
    // TODO preserve any configuration that pre-existed.

    ServletHandler _servletHandler = context.getServletHandler();
        _servletHandler.setFilters(null);
    _servletHandler.setFilterMappings(null);
    _servletHandler.setServlets(null);
    _servletHandler.setServletMappings(null);

    context.setEventListeners(null);
    context.setWelcomeFiles(null);

    if (context.getErrorHandler() instanceof ErrorPageErrorHandler)
      ((ErrorPageErrorHandler) 
          context.getErrorHandler()).setErrorPages(null);

    // TODO remove classpaths from classloader

  }
}

相关文章

WebAppContext类方法