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

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

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

WebAppContext.addLifeCycleListener介绍

暂无

代码示例

代码示例来源:origin: gocd/gocd

void startHandlers() {
  WebAppProvider webAppProvider = new WebAppProvider();
  deploymentManager.addApp(new App(deploymentManager, webAppProvider, "welcomeHandler", rootHandler()));
  if (systemEnvironment.useCompressedJs()) {
    AssetsContextHandler assetsContextHandler = new AssetsContextHandler(systemEnvironment);
    deploymentManager.addApp(new App(deploymentManager, webAppProvider, "assetsHandler", assetsContextHandler));
    webAppContext.addLifeCycleListener(new AssetsContextHandlerInitializer(assetsContextHandler, webAppContext));
  }
  deploymentManager.addApp(new App(deploymentManager, webAppProvider, "realApp", webAppContext));
}

代码示例来源:origin: org.aksw.jena-sparql-api/jena-sparql-api-server

webAppContext.addLifeCycleListener(new AbstractLifeCycleListener() {
  @Override
  public void lifeCycleStarting(LifeCycle arg0) {

代码示例来源:origin: SmartDataAnalytics/jena-sparql-api

"org.eclipse.jetty.annotations.AnnotationConfiguration" );
webAppContext.addLifeCycleListener(new AbstractLifeCycleListener() {
  @Override
  public void lifeCycleStarting(LifeCycle arg0) {

代码示例来源:origin: org.gatein.wci/wci-jetty8

private void registerWebAppContext(WebAppContext ctx)
{
 if (!monitoredContexts.contains(ctx.getServletContext().getServletContextName()))
 {
   LOG.debug("Register lifecycle listener on webapp " + ctx.getContextPath());
   ctx.addLifeCycleListener(this);
   if (ctx.isStarted())
   {
    startWebAppContext(ctx);
   }
   monitoredContexts.add(ctx.getServletContext().getServletContextName());
 }
}

代码示例来源:origin: org.zkoss.zats/zats-mimic

contextHandler.addLifeCycleListener((Listener) Proxy.newProxyInstance(Thread.currentThread()
    .getContextClassLoader(), new Class<?>[] { Listener.class }, new InvocationHandler() {
  public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {

代码示例来源:origin: io.restx/restx-server-jetty8

protected WebAppContext createContext() {
  final WebAppContext ctx = new WebAppContext();
  ctx.setContextPath("/");
  ctx.setWar(appBase);
  if(!Strings.isNullOrEmpty(webInfLocation)) {
    ctx.setDescriptor(webInfLocation);
  }
  // configure security to avoid err println "Null identity service, trying login service:"
  // but I've found no way to get rid of LoginService=xxx log on system err :(
  HashLoginService loginService = new HashLoginService();
  loginService.setIdentityService(new DefaultIdentityService());
  ctx.getSecurityHandler().setLoginService(loginService);
  ctx.getSecurityHandler().setIdentityService(loginService.getIdentityService());
  ctx.addLifeCycleListener(new AbstractLifeCycle.AbstractLifeCycleListener() {
    @Override
    public void lifeCycleStarting(LifeCycle event) {
      ctx.getServletContext().setInitParameter("restx.baseServerUri", baseUrl());
      ctx.getServletContext().setInitParameter("restx.serverId", getServerId());
    }
  });
  return ctx;
}

代码示例来源:origin: restx/restx

protected WebAppContext createContext() {
  final WebAppContext ctx = new WebAppContext();
  ctx.setContextPath("/");
  ctx.setWar(appBase);
  if(!Strings.isNullOrEmpty(webInfLocation)) {
    ctx.setDescriptor(webInfLocation);
  }
  // configure security to avoid err println "Null identity service, trying login service:"
  // but I've found no way to get rid of LoginService=xxx log on system err :(
  HashLoginService loginService = new HashLoginService();
  loginService.setIdentityService(new DefaultIdentityService());
  ctx.getSecurityHandler().setLoginService(loginService);
  ctx.getSecurityHandler().setIdentityService(loginService.getIdentityService());
  ctx.addLifeCycleListener(new AbstractLifeCycle.AbstractLifeCycleListener() {
    @Override
    public void lifeCycleStarting(LifeCycle event) {
      ctx.getServletContext().setInitParameter("restx.baseServerUri", baseUrl());
      ctx.getServletContext().setInitParameter("restx.serverId", getServerId());
    }
  });
  return ctx;
}

代码示例来源:origin: io.restx/restx-server-jetty7

protected WebAppContext createContext() {
  final WebAppContext ctx = new WebAppContext();
  ctx.setContextPath("/");
  ctx.setWar(appBase);
  if(!Strings.isNullOrEmpty(webInfLocation)) {
    ctx.setDescriptor(webInfLocation);
  }
  // configure security to avoid err println "Null identity service, trying login service:"
  // but I've found no way to get rid of LoginService=xxx log on system err :(
  HashLoginService loginService = new HashLoginService();
  loginService.setIdentityService(new DefaultIdentityService());
  ctx.getSecurityHandler().setLoginService(loginService);
  ctx.getSecurityHandler().setIdentityService(loginService.getIdentityService());
  ctx.addLifeCycleListener(new AbstractLifeCycle.AbstractLifeCycleListener() {
    @Override
    public void lifeCycleStarting(LifeCycle event) {
      ctx.getServletContext().setInitParameter("restx.baseServerUri", baseUrl());
      ctx.getServletContext().setInitParameter("restx.serverId", getServerId());
    }
  });
  return ctx;
}

代码示例来源:origin: restx/restx

protected WebAppContext createContext() {
  final WebAppContext ctx = new WebAppContext();
  ctx.setContextPath("/");
  ctx.setWar(appBase);
  if(!Strings.isNullOrEmpty(webInfLocation)) {
    ctx.setDescriptor(webInfLocation);
  }
  // configure security to avoid err println "Null identity service, trying login service:"
  // but I've found no way to get rid of LoginService=xxx log on system err :(
  HashLoginService loginService = new HashLoginService();
  loginService.setIdentityService(new DefaultIdentityService());
  ctx.getSecurityHandler().setLoginService(loginService);
  ctx.getSecurityHandler().setIdentityService(loginService.getIdentityService());
  ctx.addLifeCycleListener(new AbstractLifeCycle.AbstractLifeCycleListener() {
    @Override
    public void lifeCycleStarting(LifeCycle event) {
      ctx.getServletContext().setInitParameter("restx.baseServerUri", baseUrl());
      ctx.getServletContext().setInitParameter("restx.serverId", getServerId());
    }
  });
  return ctx;
}

相关文章

WebAppContext类方法