Package org.jenkinsci.remoting.protocol
Class ProtocolStack.Ptr
java.lang.Object
org.jenkinsci.remoting.protocol.ProtocolStack.Ptr
- Enclosing class:
- ProtocolStack<T>
Tracks where a
ProtocolLayer
is in the ProtocolStack
.-
Method Summary
Modifier and TypeMethodDescriptionvoid
Requests the next layer down the stack to close output.void
doSend
(ByteBuffer data) EachProtocolLayer.Send
should call this method to hand data for sending down the stack to the nextProtocolLayer
(except for theNetworkLayer
which should eat the data).boolean
Checks if the next layer up the stack is open to receive data.boolean
Checks if the next layer down the stack is open to send data.void
onRecv
(ByteBuffer data) EachProtocolLayer.Recv
should call this method to hand received data up the stack to the nextProtocolLayer
(except for theApplicationLayer
which should eat the data).void
onRecvClosed
(IOException cause) Notify the next layer up the stack that input has been closed.void
remove()
Requests removal of thisProtocolLayer
from theProtocolStack
stack()
Helper method to access theProtocolStack
.
-
Method Details
-
onRecv
EachProtocolLayer.Recv
should call this method to hand received data up the stack to the nextProtocolLayer
(except for theApplicationLayer
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
EachProtocolLayer.Send
should call this method to hand data for sending down the stack to the nextProtocolLayer
(except for theNetworkLayer
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
Helper method to access theProtocolStack
.- Returns:
- the
ProtocolStack
.
-
remove
public void remove()Requests removal of thisProtocolLayer
from theProtocolStack
-
doCloseSend
Requests the next layer down the stack to close output.- Throws:
IOException
- if there was an error closing the output.
-
onRecvClosed
Notify the next layer up the stack that input has been closed.- Parameters:
cause
- the cause of the lower layer being closed ornull
.- Throws:
IOException
- if there was an error processing the close notification.
-