Class ProtocolStack.Ptr

java.lang.Object
org.jenkinsci.remoting.protocol.ProtocolStack.Ptr
Enclosing class:
ProtocolStack<T>

public class ProtocolStack.Ptr extends Object
Tracks where a ProtocolLayer is in the ProtocolStack.
  • Method Details

    • onRecv

      public void onRecv(ByteBuffer data) throws IOException
      Each ProtocolLayer.Recv should call this method to hand received data up the stack to the next ProtocolLayer (except for the ApplicationLayer which should eat the data).
      Parameters:
      data - the data to submit to the next layer up the stack.
      Throws:
      IOException - if the next layer could not process the data.
    • doSend

      public void doSend(ByteBuffer data) throws IOException
      Each ProtocolLayer.Send should call this method to hand data for sending down the stack to the next ProtocolLayer (except for the NetworkLayer which should eat the data).
      Parameters:
      data - the data to submit to the next layer down the stack.
      Throws:
      IOException - if the next layer could not process the data.
    • isRecvOpen

      public boolean isRecvOpen()
      Checks if the next layer up the stack is open to receive data.
      Returns:
      true if the next layer up the stack is open to receive data.
    • isSendOpen

      public boolean isSendOpen()
      Checks if the next layer down the stack is open to send data.
      Returns:
      true if the next layer down the stack is open to send data.
    • stack

      public ProtocolStack<?> stack()
      Helper method to access the ProtocolStack.
      Returns:
      the ProtocolStack.
    • remove

      public void remove()
      Requests removal of this ProtocolLayer from the ProtocolStack
    • doCloseSend

      public void doCloseSend() throws IOException
      Requests the next layer down the stack to close output.
      Throws:
      IOException - if there was an error closing the output.
    • onRecvClosed

      public void onRecvClosed(IOException cause) throws IOException
      Notify the next layer up the stack that input has been closed.
      Parameters:
      cause - the cause of the lower layer being closed or null.
      Throws:
      IOException - if there was an error processing the close notification.