com.hazelcast.nio.tcp

## Class MemberProtocolEncoder

- java.lang.Object
- - com.hazelcast.internal.networking.ChannelHandler<com.hazelcast.internal.networking.OutboundHandler,S,D>
  - - com.hazelcast.internal.networking.OutboundHandler<Void,ByteBuffer>
    - - com.hazelcast.nio.tcp.MemberProtocolEncoder

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

- - ### Field Summary

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

      `channel, dst, src`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MemberProtocolEncoder(com.hazelcast.internal.networking.OutboundHandler[] next)` Decodes first 3 incoming bytes, validates against `supportedProtocol` and, when matching, replaces itself in the inbound pipeline with the `next InboundHandler`.

  - ### 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.
    `void` | `signalProtocolLoaded()`

    - ### 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

    - #### MemberProtocolEncoder

          public MemberProtocolEncoder(com.hazelcast.internal.networking.OutboundHandler[] next)

      Decodes first 3 incoming bytes, validates against `supportedProtocol` and, when matching, replaces itself in the inbound pipeline with the `next InboundHandler`.
      Parameters:
        `next` - the `OutboundHandler` to replace this one in the outbound pipeline upon match of protocol bytes

  - ### 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,Void,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<Void,ByteBuffer>`
      Returns:
        `HandlerStatus` the status of the handler after processing the src.

    - #### signalProtocolLoaded

          public void signalProtocolLoaded()

Copyright © 2019. All rights reserved.