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

x33g5p2x  于2022-01-24 转载在 其他  
字(8.0k)|赞(0)|评价(0)|浏览(82)

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

Lifecycle.stop介绍

[英]Gracefully terminate the active use of the public methods other than property getters/setters and life cycle methods of this component. Once the STOP_EVENT is fired, the public methods other than property getters/setters and life cycle methods should not be used. The following LifecycleEvents will be fired in the following order:

  1. BEFORE_STOP_EVENT: At the beginning of the method. It is at this point that the state transitions to LifecycleState#STOPPING_PREP.
  2. STOP_EVENT: During the method once it is safe to call stop() for any child components. It is at this point that the state transitions to LifecycleState#STOPPINGand that the public methods other than property getters/setters and life cycle methods may no longer be used.
  3. AFTER_STOP_EVENT: At the end of the method, immediately before it returns. It is at this point that the state transitions to LifecycleState#STOPPED.
    Note that if transitioning from LifecycleState#FAILED then the three events above will be fired but the component will transition directly from LifecycleState#FAILED to LifecycleState#STOPPING, bypassing LifecycleState#STOPPING_PREP
    [中]优雅地终止此组件的属性getter/setter和生命周期方法之外的公共方法的活动使用。触发STOP_事件后,不应使用除属性getter/setter和生命周期方法之外的公共方法。以下生命周期事件将按以下顺序触发:
    1.在\u停止\u事件之前:在方法的开头。正是在这一点上,状态转换为LifecycleState#STOPPING#u PREP。
    1.STOP_事件:在方法期间,一旦安全,就可以为任何子组件调用STOP()。正是在这一点上,状态转换为LifecycleState#stopping,并且除了属性getter/setter和Lifecycle方法之外的公共方法可能不再使用。
    1.在\u停止\u事件之后:在方法结束时,在它返回之前。正是在这一点上,状态转换为LifecycleState#STOPPED。
    请注意,如果从LifecycleState转换失败,则将触发上述三个事件,但组件将直接从LifecycleState转换为LifecycleState#失败#停止,绕过LifecycleState#停止#

代码示例

代码示例来源:origin: org.apache.tomcat/tomcat-catalina

@Override
protected void stopInternal() throws LifecycleException {
  if (sessionIdGenerator instanceof Lifecycle) {
    ((Lifecycle) sessionIdGenerator).stop();
  }
}

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

/**
 * Stops the session manager of this Context.
 */
protected void managerStop() throws LifecycleException {
  if ((manager != null) && (manager instanceof Lifecycle)) {
    ((Lifecycle) manager).stop();
  }
}

代码示例来源:origin: org.apache.geronimo.modules/geronimo-tomcat6

public void doStop() throws Exception {
  if (embedded instanceof Lifecycle) {
    ((Lifecycle)embedded).stop();
  }
}

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

@Override
protected void stopInternal() throws LifecycleException {
  if (sessionIdGenerator instanceof Lifecycle) {
    ((Lifecycle) sessionIdGenerator).stop();
  }
}

代码示例来源:origin: org.apache.geronimo.modules/geronimo-tomcat6

public void doStop() throws Exception {
  ((Lifecycle)server).stop();
}

代码示例来源:origin: jboss.web/jbossweb

/**
 * Stop an existing server instance.
 */
public void stop() {
  // Shut down the server
  if (server instanceof Lifecycle) {
    try {
      ((Lifecycle) server).stop();
    } catch (LifecycleException e) {
      log.error("Catalina.stop", e);
    }
  }
}

代码示例来源:origin: org.jboss.web/jbossweb

public void stop() throws LifecycleException {
  Iterator<RewriteMap> values = maps.values().iterator();
  while (values.hasNext()) {
    RewriteMap map = values.next();
    if (map instanceof Lifecycle) {
      ((Lifecycle) map).stop();
    }
  }
  maps.clear();
  rules = null;
}

代码示例来源:origin: jboss.web/jbossweb

public void stop() throws LifecycleException {
  Iterator<RewriteMap> values = maps.values().iterator();
  while (values.hasNext()) {
    RewriteMap map = values.next();
    if (map instanceof Lifecycle) {
      ((Lifecycle) map).stop();
    }
  }
  maps.clear();
  rules = null;
}

代码示例来源:origin: org.apache.tomcat/tomcat-catalina

@Override
protected synchronized void stopInternal() throws LifecycleException {
  super.stopInternal();
  for (RewriteMap map : maps.values()) {
    if (map instanceof Lifecycle) {
      ((Lifecycle) map).stop();
    }
  }
  maps.clear();
  rules = null;
}

代码示例来源:origin: org.apache.tomee/tomee-catalina

@Override
public void stop() throws LifecycleException {
  classLoader = delegate.getClassLoader();
  if (delegate instanceof Lifecycle) {
    ((Lifecycle) delegate).stop();
  }
}

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

@Override
protected synchronized void stopInternal() throws LifecycleException {
  super.stopInternal();
  for (RewriteMap map : maps.values()) {
    if (map instanceof Lifecycle) {
      ((Lifecycle) map).stop();
    }
  }
  maps.clear();
  rules = null;
}

代码示例来源:origin: org.apache.tomee/tomee-catalina

@Override
public void stop() throws LifecycleException {
  if (instance() != null && Lifecycle.class.isInstance(delegate)) {
    Lifecycle.class.cast(delegate).stop();
  }
  state = LifecycleState.STOPPED;
}

代码示例来源:origin: codefollower/Tomcat-Research

@Override
protected synchronized void stopInternal() throws LifecycleException {
  super.stopInternal();
  Iterator<RewriteMap> values = maps.values().iterator();
  while (values.hasNext()) {
    RewriteMap map = values.next();
    if (map instanceof Lifecycle) {
      ((Lifecycle) map).stop();
    }
  }
  maps.clear();
  rules = null;
}

代码示例来源:origin: org.apache.tomcat/tomcat-catalina

/**
 * Gracefully terminate the active use of the public methods of this
 * component and implement the requirements of
 * {@link org.apache.catalina.util.LifecycleBase#stopInternal()}.
 *
 * @exception LifecycleException if this component detects a fatal error
 *  that needs to be reported
 */
 @Override
protected void stopInternal() throws LifecycleException {
  // Stop this realm, then the sub-realms (reverse order to start)
  super.stopInternal();
  for (Realm realm : realms) {
    if (realm instanceof Lifecycle) {
      ((Lifecycle) realm).stop();
    }
  }
}

代码示例来源:origin: org.apache.catalina/com.springsource.org.apache.catalina

/**
 * Gracefully terminate the active use of the public methods of this
 * component and implement the requirements of
 * {@link org.apache.catalina.util.LifecycleBase#stopInternal()}.
 *
 * @exception LifecycleException if this component detects a fatal error
 *  that needs to be reported
 */
 @Override
protected void stopInternal() throws LifecycleException {
  // Stop this realm, then the sub-realms (reverse order to start)
  super.stopInternal();
  for (Realm realm : realms) {
    if (realm instanceof Lifecycle) {
      ((Lifecycle) realm).stop();
    }
  }        
}

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

/**
 * Gracefully terminate the active use of the public methods of this
 * component and implement the requirements of
 * {@link org.apache.catalina.util.LifecycleBase#stopInternal()}.
 *
 * @exception LifecycleException if this component detects a fatal error
 *  that needs to be reported
 */
 @Override
protected void stopInternal() throws LifecycleException {
  // Stop this realm, then the sub-realms (reverse order to start)
  super.stopInternal();
  for (Realm realm : realms) {
    if (realm instanceof Lifecycle) {
      ((Lifecycle) realm).stop();
    }
  }        
}

代码示例来源:origin: codefollower/Tomcat-Research

/**
 * Gracefully terminate the active use of the public methods of this
 * component and implement the requirements of
 * {@link org.apache.catalina.util.LifecycleBase#stopInternal()}.
 *
 * @exception LifecycleException if this component detects a fatal error
 *  that needs to be reported
 */
 @Override
protected void stopInternal() throws LifecycleException {
  // Stop this realm, then the sub-realms (reverse order to start)
  super.stopInternal();
  for (Realm realm : realms) {
    if (realm instanceof Lifecycle) {
      ((Lifecycle) realm).stop();
    }
  }
}

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

/**
 * Gracefully terminate the active use of the public methods of this
 * component and implement the requirements of
 * {@link org.apache.catalina.util.LifecycleBase#stopInternal()}.
 *
 * @exception LifecycleException if this component detects a fatal error
 *  that needs to be reported
 */
 @Override
protected void stopInternal() throws LifecycleException {
  // Stop this realm, then the sub-realms (reverse order to start)
  super.stopInternal();
  for (Realm realm : realms) {
    if (realm instanceof Lifecycle) {
      ((Lifecycle) realm).stop();
    }
  }        
}

代码示例来源:origin: org.apache.geronimo.ext.tomcat/catalina

/**
 * Gracefully terminate the active use of the public methods of this
 * component and implement the requirements of
 * {@link org.apache.catalina.util.LifecycleBase#stopInternal()}.
 *
 * @exception LifecycleException if this component detects a fatal error
 *  that needs to be reported
 */
 @Override
protected void stopInternal() throws LifecycleException {
  // Stop this realm, then the sub-realms (reverse order to start)
  super.stopInternal();
  for (Realm realm : realms) {
    if (realm instanceof Lifecycle) {
      ((Lifecycle) realm).stop();
    }
  }        
}

代码示例来源:origin: org.apache.tomee/tomee-catalina

@Override
protected void stopInternal() throws LifecycleException {
  final Class<?> r = loadClass();
  if (r != null && Lifecycle.class.isAssignableFrom(r) && instance() != null) {
    Lifecycle.class.cast(instance()).stop();
  }
  setState(LifecycleState.STOPPING);
}

相关文章