本文整理汇总了Java中org.apache.catalina.Engine.stop方法的典型用法代码示例。如果您正苦于以下问题:Java Engine.stop方法的具体用法?Java Engine.stop怎么用?Java Engine.stop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.catalina.Engine
的用法示例。
在下文中一共展示了Engine.stop方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: removeEngine
import org.apache.catalina.Engine; //导入方法依赖的package包/类
/**
* Remove the specified Engine from the set of defined Engines, along with
* all of its related Hosts and Contexts. All associated Connectors are
* also removed.
*
* @param engine The Engine to be removed
*/
public synchronized void removeEngine(Engine engine) {
if( log.isDebugEnabled() )
log.debug("Removing engine (" + engine.getInfo() + ")");
// Is the specified Engine actually defined?
int j = -1;
for (int i = 0; i < engines.length; i++) {
if (engine == engines[i]) {
j = i;
break;
}
}
if (j < 0)
return;
// Remove any Connector that is using this Engine
if( log.isDebugEnabled() )
log.debug(" Removing related Containers");
while (true) {
int n = -1;
for (int i = 0; i < connectors.length; i++) {
if (connectors[i].getService().getContainer() == engine) {
n = i;
break;
}
}
if (n < 0)
break;
removeConnector(connectors[n]);
}
// Stop this Engine if necessary
if( log.isDebugEnabled() )
log.debug(" Stopping this Engine");
try {
engine.stop();
} catch (LifecycleException e) {
log.error("Engine.stop", e);
}
// Remove this Engine from our set of defined Engines
if( log.isDebugEnabled() )
log.debug(" Removing this Engine");
int k = 0;
Engine results[] = new Engine[engines.length - 1];
for (int i = 0; i < engines.length; i++) {
if (i != j)
results[k++] = engines[i];
}
engines = results;
}
示例2: removeEngine
import org.apache.catalina.Engine; //导入方法依赖的package包/类
/**
* Remove the specified Engine from the set of defined Engines, along with
* all of its related Hosts and Contexts. All associated Connectors are also
* removed.
*
* @param engine
* The Engine to be removed
*/
public synchronized void removeEngine(Engine engine) {
if (log.isDebugEnabled())
log.debug("Removing engine (" + engine.getInfo() + ")");
// Is the specified Engine actually defined?
int j = -1;
for (int i = 0; i < engines.length; i++) {
if (engine == engines[i]) {
j = i;
break;
}
}
if (j < 0)
return;
// Remove any Connector that is using this Engine
if (log.isDebugEnabled())
log.debug(" Removing related Containers");
while (true) {
int n = -1;
for (int i = 0; i < connectors.length; i++) {
if (connectors[i].getService().getContainer() == engine) {
n = i;
break;
}
}
if (n < 0)
break;
removeConnector(connectors[n]);
}
// Stop this Engine if necessary
if (log.isDebugEnabled())
log.debug(" Stopping this Engine");
try {
engine.stop();
} catch (LifecycleException e) {
log.error("Engine.stop", e);
}
// Remove this Engine from our set of defined Engines
if (log.isDebugEnabled())
log.debug(" Removing this Engine");
int k = 0;
Engine results[] = new Engine[engines.length - 1];
for (int i = 0; i < engines.length; i++) {
if (i != j)
results[k++] = engines[i];
}
engines = results;
}