本文整理汇总了Java中org.apache.catalina.LifecycleException.printStackTrace方法的典型用法代码示例。如果您正苦于以下问题:Java LifecycleException.printStackTrace方法的具体用法?Java LifecycleException.printStackTrace怎么用?Java LifecycleException.printStackTrace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.catalina.LifecycleException
的用法示例。
在下文中一共展示了LifecycleException.printStackTrace方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: run
import org.apache.catalina.LifecycleException; //导入方法依赖的package包/类
public void run() {
if (server != null) {
try {
((Lifecycle) server).stop();
} catch (LifecycleException e) {
System.out.println("Catalina.stop: " + e);
e.printStackTrace(System.out);
if (e.getThrowable() != null) {
System.out.println("----- Root Cause -----");
e.getThrowable().printStackTrace(System.out);
}
}
}
}
示例2: start
import org.apache.catalina.LifecycleException; //导入方法依赖的package包/类
/**
* Start a new server instance.
*/
public void start() {
// Start the new server
if (server instanceof Lifecycle) {
try {
((Lifecycle) server).start();
} catch (LifecycleException e) {
System.out.println("Catalina.start: " + e);
e.printStackTrace(System.out);
if (e.getThrowable() != null) {
System.out.println("----- Root Cause -----");
e.getThrowable().printStackTrace(System.out);
}
}
}
}
示例3: stop
import org.apache.catalina.LifecycleException; //导入方法依赖的package包/类
/**
* Stop an existing server instance.
*/
public void stop() {
// Shut down the server
if (server instanceof Lifecycle) {
try {
((Lifecycle) server).stop();
} catch (LifecycleException e) {
System.out.println("Catalina.stop: " + e);
e.printStackTrace(System.out);
if (e.getThrowable() != null) {
System.out.println("----- Root Cause -----");
e.getThrowable().printStackTrace(System.out);
}
}
}
}
示例4: stopConext
import org.apache.catalina.LifecycleException; //导入方法依赖的package包/类
public void stopConext() {
int port = this.getTomcat().getPort();
Bootstrap b = BootstrapManager.getBoostrap(port);
if (null == b) {
return;
}
List<Context> cs = b.listContexts();
Context matchedContext = null;
for (Context c : cs) {
if (this.nameMatch(c)) {
try {
c.stop();
matchedContext = c;
} catch (LifecycleException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
break;
}
}
if (matchedContext != null)
cs.remove(matchedContext);
}