com.arjuna.ats.internal.arjuna.recovery.Listener.closeListenerSockets()方法的使用及代码示例

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

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

Listener.closeListenerSockets介绍

[英]Ensuring the socket does not accept more requests by closing it and setting flag to inform the listener is stopped.

Method does not close opened connections, run the #stopListener() method for that.
[中]通过关闭套接字并设置标志通知侦听器停止,确保套接字不接受更多请求。
方法不关闭打开的连接,请为此运行#stopListener()方法。

代码示例

代码示例来源:origin: org.jboss.narayana.arjunacore/arjuna

/**
* Halts running of the listener thread.
*/
public synchronized void stopListener()
{
  closeListenerSockets();
 // there is no need for this as the close will interrupt any i/o that is in progress
 // this.interrupt();
  // ok, closing a connection socket will cause the connection thread to remove it from the list as it
  // exits so we keep on closing them and waiting until the list is empty
  while(connections.size() > 0) {
    Socket conn = connections.get(0);
    try {
      conn.close();
    } catch (Exception e) {
      // ignore
    }
    try {
      wait();
    } catch (InterruptedException e) {
      // ignore
    }
  }
 
  // make sure this listener thread has exited before we return
  try {
    this.join();
  } catch (InterruptedException ie) {
  }
}

代码示例来源:origin: jbosstm/narayana

/**
* Halts running of the listener thread.
*/
public synchronized void stopListener()
{
  closeListenerSockets();
 // there is no need for this as the close will interrupt any i/o that is in progress
 // this.interrupt();
  // ok, closing a connection socket will cause the connection thread to remove it from the list as it
  // exits so we keep on closing them and waiting until the list is empty
  while(connections.size() > 0) {
    Socket conn = connections.get(0);
    try {
      conn.close();
    } catch (Exception e) {
      // ignore
    }
    try {
      wait();
    } catch (InterruptedException e) {
      // ignore
    }
  }
 
  // make sure this listener thread has exited before we return
  try {
    this.join();
  } catch (InterruptedException ie) {
  }
}

代码示例来源:origin: jbosstm/narayana

/**
* Halts running of the listener thread.
*/
public synchronized void stopListener()
{
  closeListenerSockets();
 // there is no need for this as the close will interrupt any i/o that is in progress
 // this.interrupt();
  // ok, closing a connection socket will cause the connection thread to remove it from the list as it
  // exits so we keep on closing them and waiting until the list is empty
  while(connections.size() > 0) {
    Socket conn = connections.get(0);
    try {
      conn.close();
    } catch (Exception e) {
      // ignore
    }
    try {
      wait();
    } catch (InterruptedException e) {
      // ignore
    }
  }
 
  // make sure this listener thread has exited before we return
  try {
    this.join();
  } catch (InterruptedException ie) {
  }
}

代码示例来源:origin: org.jboss.narayana.jts/narayana-jts-idlj

/**
* Halts running of the listener thread.
*/
public synchronized void stopListener()
{
  closeListenerSockets();
 // there is no need for this as the close will interrupt any i/o that is in progress
 // this.interrupt();
  // ok, closing a connection socket will cause the connection thread to remove it from the list as it
  // exits so we keep on closing them and waiting until the list is empty
  while(connections.size() > 0) {
    Socket conn = connections.get(0);
    try {
      conn.close();
    } catch (Exception e) {
      // ignore
    }
    try {
      wait();
    } catch (InterruptedException e) {
      // ignore
    }
  }
 
  // make sure this listener thread has exited before we return
  try {
    this.join();
  } catch (InterruptedException ie) {
  }
}

代码示例来源:origin: org.jboss.narayana.arjunacore/arjunacore

/**
* Halts running of the listener thread.
*/
public synchronized void stopListener()
{
  closeListenerSockets();
 // there is no need for this as the close will interrupt any i/o that is in progress
 // this.interrupt();
  // ok, closing a connection socket will cause the connection thread to remove it from the list as it
  // exits so we keep on closing them and waiting until the list is empty
  while(connections.size() > 0) {
    Socket conn = connections.get(0);
    try {
      conn.close();
    } catch (Exception e) {
      // ignore
    }
    try {
      wait();
    } catch (InterruptedException e) {
      // ignore
    }
  }
 
  // make sure this listener thread has exited before we return
  try {
    this.join();
  } catch (InterruptedException ie) {
  }
}

代码示例来源:origin: jbosstm/narayana

/**
* Halts running of the listener thread.
*/
public synchronized void stopListener()
{
  closeListenerSockets();
 // there is no need for this as the close will interrupt any i/o that is in progress
 // this.interrupt();
  // ok, closing a connection socket will cause the connection thread to remove it from the list as it
  // exits so we keep on closing them and waiting until the list is empty
  while(connections.size() > 0) {
    Socket conn = connections.get(0);
    try {
      conn.close();
    } catch (Exception e) {
      // ignore
    }
    try {
      wait();
    } catch (InterruptedException e) {
      // ignore
    }
  }
 
  // make sure this listener thread has exited before we return
  try {
    this.join();
  } catch (InterruptedException ie) {
  }
}

代码示例来源:origin: org.jboss.narayana.arjunacore/arjunacore

_listener.closeListenerSockets();

代码示例来源:origin: org.jboss.narayana.arjunacore/arjuna

_listener.closeListenerSockets();

代码示例来源:origin: org.jboss.narayana.jts/narayana-jts-idlj

_listener.closeListenerSockets();

代码示例来源:origin: jbosstm/narayana

_listener.closeListenerSockets();

代码示例来源:origin: jbosstm/narayana

_listener.closeListenerSockets();

代码示例来源:origin: jbosstm/narayana

_listener.closeListenerSockets();

相关文章