org.apache.catalina.LifecycleException.getMessage()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(4.7k)|赞(0)|评价(0)|浏览(92)

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

LifecycleException.getMessage介绍

[英]Returns the message associated with this exception, if any.
[中]返回与此异常关联的消息(如果有)。

代码示例

代码示例来源:origin: apache/geode

/**
 * Stops the embedded Tomcat server.
 */
public void stopContainer() {
 try {
  if (container != null) {
   container.stop();
   logger.info("Stopped container");
  }
 } catch (LifecycleException exception) {
  logger.warn("Cannot Stop Tomcat" + exception.getMessage());
 }
}

代码示例来源:origin: stackoverflow.com

logger.warn("Cannot Stop Tomcat" + exception.getMessage());

代码示例来源:origin: org.testatoo.container/testatoo-container-tomcat

protected void stop(final Embedded server) {
  try {
    server.stop();
  } catch (LifecycleException e) {
    throw new RuntimeException(e.getMessage(), e);
  } finally {
    if (stop != null) stop.countDown();
    stop = null;
    serverThread = null;
  }
}

代码示例来源:origin: org.testatoo.container/testatoo-container-tomcat

@Override
  public void run() {
    try {
      server.start();
      startupComplete.countDown();
      stop.await();
    } catch (LifecycleException e) {
      throw new RuntimeException(e.getMessage(), e);
    } catch (InterruptedException ignored) {
    } finally {
      serverThread = null;
      stop = null;
    }
  }
};

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

@Override
  public void run() {
    try {
      server.start();
      startupComplete.countDown();
      stop.await();
    } catch (LifecycleException e) {
      throw new RuntimeException(e.getMessage(), e);
    } catch (InterruptedException ignored) {
    } finally {
      serverThread = null;
      stop = null;
    }
  }
};

代码示例来源:origin: jsimone/webapp-runner

public void run() {
  try {
   if (tomcat != null) {
    tomcat.getServer().stop();
   }
  } catch (LifecycleException exception) {
   throw new RuntimeException("WARNING: Cannot Stop Tomcat " + exception.getMessage(), exception);
  }
 }
});

代码示例来源:origin: com.github.jsimone/webapp-runner-main

public void run() {
  try {
   if (tomcat != null) {
    tomcat.getServer().stop();
   }
  } catch (LifecycleException exception) {
   throw new RuntimeException("WARNING: Cannot Stop Tomcat " + exception.getMessage(), exception);
  }
 }
});

代码示例来源:origin: org.glassfish.web/web-glue

private void stopCacheManager(WebModule webModule) {
  ServletContext ctxt = webModule.getServletContext();
  CacheManager cm = (CacheManager)ctxt.getAttribute(
                  CacheManager.CACHE_MANAGER_ATTR_NAME);
  if (cm != null) {
    try {
      cm.stop();
      if (_logger.isLoggable(Level.FINE)) {
        _logger.fine("Cache Manager stopped");
      }
      ctxt.removeAttribute(CacheManager.CACHE_MANAGER_ATTR_NAME);
    } catch (LifecycleException ee) {
      _logger.log(Level.WARNING, ee.getMessage(), ee.getCause());
    }
  }
}

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

protected void stop(final Tomcat server) {
  try {
    server.stop();
    server.getConnector().destroy();
  } catch (LifecycleException e) {
    throw new RuntimeException(e.getMessage(), e);
  } finally {
    if (stop != null) stop.countDown();
    stop = null;
    serverThread = null;
  }
}

代码示例来源:origin: org.glassfish.web/web-glue

/**
 * Gracefully terminate the active use of the public methods of this
 * component.  This method should be the last one called on a given
 * instance of this component.
 *
 * @throws IllegalStateException if this component has not been started
 * @throws LifecycleException    if this component detects a fatal error
 *                               that needs to be reported
 */
public void stop() throws LifecycleException {
  // Validate and update our current component state
  if (!_started) {
    String msg = rb.getString("webcontainer.notStarted");
    throw new LifecycleException(msg);
  }
  _started = false;
  // stop the embedded container
  try {
    _embedded.stop();
  } catch (LifecycleException ex) {
    if (!ex.getMessage().contains("has not been started")) {
      throw ex;
    }
  }
}

代码示例来源:origin: com.github.bordertech.lde/lde-tomcat

@Override
public void stopServer() {
  if (tomcat == null) {
    return;
  }
  try {
    // Stop server
    tomcat.stop();
    LOG.info("Stopped TOMCAT.");
    // Wait till server stopped
    waitForTomcatToStop();
    tomcat.destroy();
    tomcat = null;
  } catch (LifecycleException e) {
    LOG.error("Could not STOP LDE TOMCAT server. " + e.getMessage(), e);
  }
}

代码示例来源:origin: org.glassfish.web/web-glue

private void startCacheManager(WebModule webModule) {
  SunWebApp bean  = webModule.getIasWebAppConfigBean();
  // Configure the cache, cache-mapping and other settings
  if (bean != null) {
    CacheManager cm = null;
    try {
      cm = CacheModule.configureResponseCache(webModule, bean);
    } catch (Exception ee) {
      _logger.log(Level.WARNING,
            "webmodule.listener.cachemgrException", ee);
    }
  
    if (cm != null) {
      try {
        // first start the CacheManager, if enabled
        cm.start();
        if (_logger.isLoggable(Level.FINE)) {
          _logger.fine("Cache Manager started");
        }
        // set this manager as a context attribute so that 
        // caching filters/tags can find it
        ServletContext ctxt = webModule.getServletContext();
        ctxt.setAttribute(CacheManager.CACHE_MANAGER_ATTR_NAME, cm);
      } catch (LifecycleException ee) {
        _logger.log(Level.WARNING, ee.getMessage(),
                      ee.getCause());
      }
    }
  }
}

相关文章

微信公众号

最新文章

更多