Interface SocketInitializer


public interface SocketInitializer
Common interface for objects that establish a connection with a remote socket.
Author:
Laurent Cohen
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
    Factory class for SocketInitializers.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Close this initializer.
    Get the last captured exception.
    boolean
    initialize(SocketWrapper socketWrapper)
    Initialize the underlying socket client, by starting a Timer and a corresponding TimerTask until a specified amount of time has passed.
    boolean
    Determine whether this socket initializer has been intentionally closed.
  • Method Details

    • initialize

      boolean initialize(SocketWrapper socketWrapper)
      Initialize the underlying socket client, by starting a Timer and a corresponding TimerTask until a specified amount of time has passed.
      Parameters:
      socketWrapper - the socket wrapper to initialize.
      Returns:
      whether the initialization was successful.
    • close

      void close()
      Close this initializer.
    • isClosed

      boolean isClosed()
      Determine whether this socket initializer has been intentionally closed.
      Returns:
      true if this socket initializer has been intentionally closed, false otherwise.
    • getLastException

      Exception getLastException()
      Get the last captured exception.
      Returns:
      the last captured exception, if any, otherwise null.