Package org.infinispan.server.core
Interface ProtocolServer<C extends ProtocolServerConfiguration>
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
AbstractProtocolServer
,HotRodServer
,MemcachedServer
,RestServer
Represents a protocol compliant server.
- Since:
- 9.0
- Author:
- Galder ZamarreƱo, wburns
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
close()
io.netty.channel.group.ChannelMatcher
Returns aChannelMatcher
which matches channels which belong to this protocol serverReturns the configuration used to start this serverio.netty.channel.ChannelInboundHandler
Gets the decoder for this protocol server.Returns the enclosingProtocolServer
.io.netty.channel.ChannelOutboundHandler
Gets the encoder for this protocol server.io.netty.channel.ChannelInitializer
<io.netty.channel.Channel> Returns a pipeline factorygetName()
Returns the name of this serverReturns the transport for this servervoid
installDetector
(io.netty.channel.Channel ch) Installs a protocol detector on the channelvoid
setEnclosingProtocolServer
(ProtocolServer<?> enclosingProtocolServer) Sets the enclosingProtocolServer
.void
setServerManagement
(ServerManagement server, boolean adminEndpoint) Sets theServerManagement
instance for this protocol servervoid
start
(C configuration, EmbeddedCacheManager cacheManager) Starts the server backed by the given cache manager, with the corresponding configuration.void
stop()
Stops the server.
-
Method Details
-
start
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
Sets theServerManagement
instance for this protocol server -
setEnclosingProtocolServer
Sets the enclosingProtocolServer
. Used by the single port server -
getEnclosingProtocolServer
ProtocolServer<?> getEnclosingProtocolServer()Returns the enclosingProtocolServer
. May be null if this server has none. -
getChannelMatcher
io.netty.channel.group.ChannelMatcher getChannelMatcher()Returns aChannelMatcher
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
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-