com.hazelcast.client.connection.nio

## Class ClientProtocolEncoder

- java.lang.Object
- - com.hazelcast.internal.networking.ChannelHandler<com.hazelcast.internal.networking.OutboundHandler,S,D>
  - - com.hazelcast.internal.networking.OutboundHandler<ByteBuffer,ByteBuffer>
    - - com.hazelcast.client.connection.nio.ClientProtocolEncoder

-     public class ClientProtocolEncoder
      extends com.hazelcast.internal.networking.OutboundHandler<ByteBuffer,ByteBuffer>

  A `OutboundHandler` that writes the client protocol bytes and once they have been fully written, it removes itself from pipeline. On a plain connection, this should be the last encoder in the pipeline. Even though the ClientProtocolEncoder has a ByteBuffer as src, it will never consume bytes from this source.

- - ### Field Summary

    - ### Fields inherited from class com.hazelcast.internal.networking.ChannelHandler

      `channel, dst, src`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ClientProtocolEncoder()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `handlerAdded()` Gets called when this ChannelHandler is added to the pipeline.
    `com.hazelcast.internal.networking.HandlerStatus` | `onWrite()` A callback to indicate that this OutboundHandler should be processed.

    - ### Methods inherited from class com.hazelcast.internal.networking.OutboundHandler

      `initDstBuffer, initDstBuffer, initDstBuffer`

    - ### Methods inherited from class com.hazelcast.internal.networking.ChannelHandler

      `dst, dst, interceptError, setChannel, src, src`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ClientProtocolEncoder

          public ClientProtocolEncoder()

  - ### Method Detail

    - #### handlerAdded

          public void handlerAdded()

      Description copied from class: `com.hazelcast.internal.networking.ChannelHandler`
      Gets called when this ChannelHandler is added to the pipeline. This method should execute very quickly because it could be executed on an io thread. Will be called from a thread owning this handler.
      Overrides:
        `handlerAdded` in class `com.hazelcast.internal.networking.ChannelHandler<com.hazelcast.internal.networking.OutboundHandler,ByteBuffer,ByteBuffer>`

    - #### onWrite

          public com.hazelcast.internal.networking.HandlerStatus onWrite()

      Description copied from class: `com.hazelcast.internal.networking.OutboundHandler`
      A callback to indicate that this OutboundHandler should be processed. A OutboundHandler should be able to deal with a spurious wakeup. So it could be for example there is no frame for it to write to.
      Specified by:
        `onWrite` in class `com.hazelcast.internal.networking.OutboundHandler<ByteBuffer,ByteBuffer>`
      Returns:
        `HandlerStatus` the status of the handler after processing the src.

Copyright © 2020. All rights reserved.