@MessengerProperties(optionClass=MasterServerOptions.class) public final class MasterServerMessenger extends NettyMessenger<MasterServerRequest,MasterServerResponse>
Constructor and Description |
---|
MasterServerMessenger(Options options)
Constructor for MasterServerMessenger.
|
Modifier and Type | Method and Description |
---|---|
protected void |
configure(Options options)
Populate configuration options.
|
protected NettyChannelFactory |
createChannelFactory()
createChannelFactory.
|
protected void |
receive(@NotNull NettyChannelContext context,
AbstractResponse response,
Throwable error)
The method that will be called by the last
ChannelHandler once a response has been received from the remote server. |
CompletableFuture<MasterServerResponse> |
send(MasterServerRequest request)
Sends a new request to the master server
|
acquireContext, applyDefault, attach, close, createFactoryProvider, getChannelFactory, getExecutor, getFactoryProvider, getOptions, getTransport, lockedOption, send, send, transformProperties
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
get, get, getOrDefault, getOrDefault, lock, set, unlock
public CompletableFuture<MasterServerResponse> send(MasterServerRequest request)
request
- The MasterServerRequest
containing the details of the request.CompletableFuture
which is notified once the request has been completed.protected void configure(Options options)
configure
in class NettyMessenger<MasterServerRequest,MasterServerResponse>
options
- The Options
instance holding the configuration dataprotected NettyChannelFactory createChannelFactory()
createChannelFactory.
createChannelFactory
in class NettyMessenger<MasterServerRequest,MasterServerResponse>
NettyChannelFactory
objectprotected void receive(@NotNull @NotNull NettyChannelContext context, AbstractResponse response, Throwable error)
ChannelHandler
once a response has been received from the remote server.receive
in class NettyMessenger<MasterServerRequest,MasterServerResponse>
context
- The NettyChannelContext
contianing all the important transaction details.response
- The decoded AbstractResponse
receivederror
- The error that occured during send/receive operation. null
if no error occured.Copyright © 2016–2024. All rights reserved.