当前位置: 首页>>代码示例>>Java>>正文


Java MultiException类代码示例

本文整理汇总了Java中org.eclipse.jetty.util.MultiException的典型用法代码示例。如果您正苦于以下问题:Java MultiException类的具体用法?Java MultiException怎么用?Java MultiException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MultiException类属于org.eclipse.jetty.util包,在下文中一共展示了MultiException类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: startServer

import org.eclipse.jetty.util.MultiException; //导入依赖的package包/类
private void startServer(final Server server, final URL stopURL) throws Exception {
	try {
		server.start();
	} catch (final MultiException e) {
		final long bindExceptions = e.getThrowables().stream().filter(t -> t instanceof BindException).count();

		if (bindExceptions > 0) {
			LOGGER.log(Level.WARNING, "Port already used, trying to shutdown other instance");
			// We assume it is already running?
			// Kill the old one
			this.stopOtherInstance(stopURL);

			// One more try
			LOGGER.log(Level.WARNING, "Re-trying to start server.");
			server.start();
		} else {
			LOGGER.log(Level.SEVERE, "Could not start server.", e);
			return;
		}
	}
	LOGGER.info(String.format("%s is ready to serve. URL is \"%s\".", CommonStarter.META_DATA.getAppName(), server.getURI()));
}
 
开发者ID:NemProject,项目名称:nem.deploy,代码行数:23,代码来源:CommonStarter.java

示例2: start

import org.eclipse.jetty.util.MultiException; //导入依赖的package包/类
/**
 * @see org.mulgara.server.HttpServices#start()
 */
@SuppressWarnings("unchecked")
public void start() throws ExceptionList, Exception {
  try {
    if (httpServer != null) httpServer.start();
    if (httpPublicServer != null) httpPublicServer.start();
  } catch (MultiException e) {
    throw new ExceptionList(e.getThrowables());
  }
}
 
开发者ID:quoll,项目名称:mulgara,代码行数:13,代码来源:HttpServicesImpl.java


注:本文中的org.eclipse.jetty.util.MultiException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。