Class LocalConnector.LocalEndPoint

All Implemented Interfaces:
Closeable, AutoCloseable, EndPoint
Enclosing class:
LocalConnector

public class LocalConnector.LocalEndPoint extends ByteArrayEndPoint
Local EndPoint
  • Constructor Details

    • LocalEndPoint

      public LocalEndPoint()
  • Method Details

    • execute

      protected void execute(Runnable task)
      Overrides:
      execute in class ByteArrayEndPoint
    • onClose

      public void onClose(Throwable cause)
      Description copied from interface: EndPoint

      Callback method invoked when this EndPoint is closed.

      Specified by:
      onClose in interface EndPoint
      Overrides:
      onClose in class AbstractEndPoint
      Parameters:
      cause - The reason for the close, or null if a normal close.
      See Also:
    • doShutdownOutput

      public void doShutdownOutput()
      Overrides:
      doShutdownOutput in class ByteArrayEndPoint
    • waitUntilClosed

      public void waitUntilClosed()
    • waitUntilClosedOrIdleFor

      public void waitUntilClosedOrIdleFor(long idleFor, TimeUnit units)
    • getResponseData

      public ByteBuffer getResponseData()
      Remaining output ByteBuffer after calls to getResponse() or waitForResponse(boolean, long, TimeUnit)
      Returns:
      the remaining response data buffer
    • getResponse

      public String getResponse() throws Exception
      Wait for a response using a parser to detect the end of message
      Returns:
      Buffer containing full response or null for EOF;
      Throws:
      Exception - if the response cannot be parsed
    • getResponse

      public String getResponse(boolean head, long time, TimeUnit unit) throws Exception
      Wait for a response using a parser to detect the end of message
      Parameters:
      head - whether the request is a HEAD request
      time - the maximum time to wait
      unit - the time unit of the timeout argument
      Returns:
      Buffer containing full response or null for EOF;
      Throws:
      Exception - if the response cannot be parsed
    • waitForResponse

      public ByteBuffer waitForResponse(boolean head, long time, TimeUnit unit) throws Exception
      Wait for a response using a parser to detect the end of message
      Parameters:
      head - whether the request is a HEAD request
      time - the maximum time to wait
      unit - the time unit of the timeout argument
      Returns:
      Buffer containing full response or null for EOF;
      Throws:
      Exception - if the response cannot be parsed
    • waitForResponse

      public ByteBuffer waitForResponse(boolean head, long time, TimeUnit unit, Consumer<Integer> statusConsumer) throws Exception
      Wait for a response using a parser to detect the end of message
      Parameters:
      head - whether the request is a HEAD request
      time - the maximum time to wait
      unit - the time unit of the timeout argument
      statusConsumer - a consumer to be called with the response's status code
      Returns:
      Buffer containing full response or null for EOF;
      Throws:
      Exception - if the response cannot be parsed