Class Listener

java.lang.Object
java.lang.Thread
com.arjuna.ats.internal.arjuna.recovery.Listener
All Implemented Interfaces:
Runnable

public class Listener extends Thread
  • Constructor Details

    • Listener

      public Listener(int port, Service service) throws IOException
      Creates a listener thread on the specified port for the specified service to run.
      Throws:
      IOException
    • Listener

      public Listener(ServerSocket serverSocket, Service service) throws IOException
      Creates a listener thread on the specified server socket for the specified service to run.
      Throws:
      IOException
  • Method Details

    • run

      public void run()
      Loops waiting for connection requests from client, creates a new Connection object for each connection.
      Specified by:
      run in interface Runnable
      Overrides:
      run in class Thread
    • addConnection

      public boolean addConnection(Socket conn)
    • removeConnection

      public void removeConnection(Socket conn)
    • closeListenerSockets

      public void 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

      public void stopListener()
      Halts running of the listener thread.