本文整理匯總了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);
}