org.apache.catalina.connector.Connector.pause()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(4.0k)|赞(0)|评价(0)|浏览(250)

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

Connector.pause介绍

[英]Pause the connector.
[中]暂停连接器。

代码示例

代码示例来源:origin: theotherp/nzbhydra2

@Override
public void onApplicationEvent(ContextClosedEvent event) {
  if (connector != null) {
    this.connector.pause();
    Executor executor = this.connector.getProtocolHandler().getExecutor();
    if (executor instanceof ThreadPoolExecutor) {
      try {
        ThreadPoolExecutor threadPoolExecutor = (ThreadPoolExecutor) executor;
        threadPoolExecutor.shutdown();
        if (!threadPoolExecutor.awaitTermination(30, TimeUnit.SECONDS)) {
          log.warn("Tomcat thread pool did not shut down gracefully within "
              + "30 seconds. Proceeding with forceful shutdown");
        }
      } catch (InterruptedException ex) {
        Thread.currentThread().interrupt();
      }
    }
  }
}

代码示例来源:origin: corentin59/spring-boot-graceful-shutdown

/**
 * Perform a pause on the server.
 * @throw InterruptedException if we have an interruption
 */
public void pause() {
   // Used to properly handle the work queue.
  final Executor executor = connector.getProtocolHandler().getExecutor();
  // Start the pause.
  connector.pause();
}

代码示例来源:origin: testIT-LivingDoc/livingdoc-core

@Override
public void onApplicationEvent(ContextClosedEvent event) {
  this.connector.pause();
  log.info("Shutting Down LivingDoc Remote Agent");
  Executor executor = this.connector.getProtocolHandler().getExecutor();
  if (executor instanceof ThreadPoolExecutor) {
    try {
      ThreadPoolExecutor threadPoolExecutor = (ThreadPoolExecutor) executor;
      threadPoolExecutor.shutdown();
      if (!threadPoolExecutor.awaitTermination(30, TimeUnit.SECONDS)) {
        log.warn("Tomcat thread pool did not shut down gracefully within "
            + "30 seconds. Proceeding with forceful shutdown");
      }
    } catch (InterruptedException ex) {
      Thread.currentThread().interrupt();
    }
  }
}

代码示例来源:origin: org.jboss.jbossas/jboss-as-tomcat

public synchronized void stopConnectors() throws Exception
{
 if (tomcatDeployer == null)
   throw new IllegalStateException("Must set TomcatDeployer before stopping connectors");
 if (!connectorsRunning)
   return;
 // Notify listeners that connectors have started processing requests
 sendNotification(new Notification(TOMCAT_CONNECTORS_STOPPED, this, getNextNotificationSequenceNumber()));
 MBeanServer server = super.getServer();
 ObjectName service = new ObjectName(tomcatDeployer.getDomain() + ":type=Service,serviceName=jboss.web");
 Object[] args = {};
 String[] sig = {};
 Connector[] connectors = (Connector[]) server.invoke(service, "findConnectors", args, sig);
 for (int n = 0; n < connectors.length; n++)
 {
   connectors[n].pause();
   connectors[n].stop();
 }
 connectorsRunning = false;
}

代码示例来源:origin: tomcat/catalina

connectors[i].pause();

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

synchronized (connectors) {
  for (int i = 0; i < connectors.length; i++) {
    connectors[i].pause();

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

synchronized (connectors) {
  for (int i = 0; i < connectors.length; i++) {
    connectors[i].pause();

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

for (Connector connector: connectors) {
  try {
    connector.pause();
  } catch (Exception e) {
    log.error(sm.getString(

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

for (Connector connector: connectors) {
  try {
    connector.pause();
  } catch (Exception e) {
    log.error(sm.getString(

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

connector.pause();

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

connector.pause();

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

for (Connector connector: connectors) {
  try {
    connector.pause();
  } catch (Exception e) {
    log.error(sm.getString(

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

for (Connector connector: connectors) {
  try {
    connector.pause();
  } catch (Exception e) {
    log.error(sm.getString(

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

for (Connector connector: connectors) {
  try {
    connector.pause();
  } catch (Exception e) {
    log.error(sm.getString(

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

for (Connector connector: connectors) {
  try {
    connector.pause();
  } catch (Exception e) {
    log.error(sm.getString(

相关文章

Connector类方法