Interface ProtocolServer<C extends ProtocolServerConfiguration>

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
AbstractProtocolServer, HotRodServer, MemcachedServer, RestServer

public interface ProtocolServer<C extends ProtocolServerConfiguration> extends AutoCloseable
Represents a protocol compliant server.
Since:
9.0
Author:
Galder ZamarreƱo, wburns
  • Method Details

    • start

      void start(C configuration, EmbeddedCacheManager cacheManager)
      Starts the server backed by the given cache manager, with the corresponding configuration. The cache manager is expected to be completely initialized and started prior to this call.
    • stop

      void stop()
      Stops the server.
    • getEncoder

      io.netty.channel.ChannelOutboundHandler getEncoder()
      Gets the encoder for this protocol server. The encoder is responsible for writing back common header responses back to client. This method can return null if the server has no encoder. You can find an example of the server that has no encoder in the Memcached server.
    • getDecoder

      io.netty.channel.ChannelInboundHandler getDecoder()
      Gets the decoder for this protocol server. The decoder is responsible for reading client requests. This method cannot return null.
    • getConfiguration

      C getConfiguration()
      Returns the configuration used to start this server
    • getInitializer

      io.netty.channel.ChannelInitializer<io.netty.channel.Channel> getInitializer()
      Returns a pipeline factory
    • getName

      String getName()
      Returns the name of this server
    • getTransport

      Transport getTransport()
      Returns the transport for this server
    • setServerManagement

      void setServerManagement(ServerManagement server, boolean adminEndpoint)
      Sets the ServerManagement instance for this protocol server
    • setEnclosingProtocolServer

      void setEnclosingProtocolServer(ProtocolServer<?> enclosingProtocolServer)
      Sets the enclosing ProtocolServer. Used by the single port server
    • getEnclosingProtocolServer

      ProtocolServer<?> getEnclosingProtocolServer()
      Returns the enclosing ProtocolServer. May be null if this server has none.
    • getChannelMatcher

      io.netty.channel.group.ChannelMatcher getChannelMatcher()
      Returns a ChannelMatcher which matches channels which belong to this protocol server
    • installDetector

      void installDetector(io.netty.channel.Channel ch)
      Installs a protocol detector on the channel
      Parameters:
      ch -
    • close

      default void close() throws Exception
      Specified by:
      close in interface AutoCloseable
      Throws:
      Exception