Class InterruptibleRMIServerSocket

java.lang.Object
java.net.ServerSocket
ecmwf.common.rmi.interruptible.InterruptibleRMIServerSocket
All Implemented Interfaces:
Closeable, AutoCloseable

public final class InterruptibleRMIServerSocket extends ServerSocket
The Class InterruptibleRMIServerSocket.
  • Constructor Details

    • InterruptibleRMIServerSocket

      public InterruptibleRMIServerSocket(ServerSocket serverSocket) throws IOException
      Instantiates a new interruptible RMI server socket.
      Parameters:
      serverSocket - the server socket
      Throws:
      IOException - Signals that an I/O exception has occurred.
  • Method Details

    • getCurrentRMIServerThreadSocket

      public static Socket getCurrentRMIServerThreadSocket()
      Return the socket associated with the RMI server thread (the current thread).
      Returns:
      the current RMI server thread socket
    • isCurrentRMIServerThreadSocketAlive

      public static boolean isCurrentRMIServerThreadSocketAlive()
      Return true if the socket associated with the RMI server thread (the current thread) has not been closed or marked for shutdown by the client of the RMI thread.
      Returns:
      true, if is current RMI server thread socket alive
    • isCurrentRMIServerThreadSocketAlive

      public static boolean isCurrentRMIServerThreadSocketAlive(Socket socket)
      Return true if the socket provided has not been closed or marked for shutdown by the client of the RMI thread. The socket is provided beforehand by a call to the getCurrentRMIServerThreadSocket method.
      Parameters:
      socket - the socket
      Returns:
      true, if is current RMI server thread socket alive
    • accept

      public Socket accept() throws IOException
      Accept.
      Overrides:
      accept in class ServerSocket
      Returns:
      the socket
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • bind

      public void bind(SocketAddress endpoint, int backlog) throws IOException
      Bind.
      Overrides:
      bind in class ServerSocket
      Parameters:
      endpoint - the endpoint
      backlog - the backlog
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • bind

      public void bind(SocketAddress endpoint) throws IOException
      Bind.
      Overrides:
      bind in class ServerSocket
      Parameters:
      endpoint - the endpoint
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • close

      public void close() throws IOException
      Close.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class ServerSocket
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • equals

      public boolean equals(Object obj)
      Equals.
      Overrides:
      equals in class Object
      Parameters:
      obj - the obj
      Returns:
      true, if successful
    • getChannel

      public ServerSocketChannel getChannel()
      Gets the channel.
      Overrides:
      getChannel in class ServerSocket
      Returns:
      the channel
    • getInetAddress

      public InetAddress getInetAddress()
      Gets the inet address.
      Overrides:
      getInetAddress in class ServerSocket
      Returns:
      the inet address
    • getLocalPort

      public int getLocalPort()
      Gets the local port.
      Overrides:
      getLocalPort in class ServerSocket
      Returns:
      the local port
    • getLocalSocketAddress

      public SocketAddress getLocalSocketAddress()
      Gets the local socket address.
      Overrides:
      getLocalSocketAddress in class ServerSocket
      Returns:
      the local socket address
    • getReceiveBufferSize

      public int getReceiveBufferSize() throws SocketException
      Gets the receive buffer size.
      Overrides:
      getReceiveBufferSize in class ServerSocket
      Returns:
      the receive buffer size
      Throws:
      SocketException - the socket exception
    • getReuseAddress

      public boolean getReuseAddress() throws SocketException
      Gets the reuse address.
      Overrides:
      getReuseAddress in class ServerSocket
      Returns:
      the reuse address
      Throws:
      SocketException - the socket exception
    • getSoTimeout

      public int getSoTimeout() throws IOException
      Gets the so timeout.
      Overrides:
      getSoTimeout in class ServerSocket
      Returns:
      the so timeout
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • hashCode

      public int hashCode()
      Hash code.
      Overrides:
      hashCode in class Object
      Returns:
      the int
    • isBound

      public boolean isBound()
      Checks if is bound.
      Overrides:
      isBound in class ServerSocket
      Returns:
      true, if is bound
    • isClosed

      public boolean isClosed()
      Checks if is closed.
      Overrides:
      isClosed in class ServerSocket
      Returns:
      true, if is closed
    • setPerformancePreferences

      public void setPerformancePreferences(int ct, int lat, int bw)
      Sets the performance preferences.
      Overrides:
      setPerformancePreferences in class ServerSocket
      Parameters:
      ct - the ct
      lat - the lat
      bw - the bw
    • setReceiveBufferSize

      public void setReceiveBufferSize(int size) throws SocketException
      Sets the receive buffer size.
      Overrides:
      setReceiveBufferSize in class ServerSocket
      Parameters:
      size - the new receive buffer size
      Throws:
      SocketException - the socket exception
    • setReuseAddress

      public void setReuseAddress(boolean on) throws SocketException
      Sets the reuse address.
      Overrides:
      setReuseAddress in class ServerSocket
      Parameters:
      on - the new reuse address
      Throws:
      SocketException - the socket exception
    • setSoTimeout

      public void setSoTimeout(int timeout) throws SocketException
      Sets the so timeout.
      Overrides:
      setSoTimeout in class ServerSocket
      Parameters:
      timeout - the new so timeout
      Throws:
      SocketException - the socket exception
    • toString

      public String toString()
      To string.
      Overrides:
      toString in class ServerSocket
      Returns:
      the string