public static final class EConfigure.ServerBuilder extends EConfigure.AbstractBuilder<EConfigure.ServerBuilder>
EConfigure.Service instance based on
the parameters set via this builder's API. The minimally
allowed configuration is the service name, connection type
and port. The remaining parameters are set to the
following defaults:
EConfigure.ConnectionType.TCP - plain
text TCP connection.
null - no address filter
applied.
AsyncChannel.defaultSelector.
AsyncChannel.defaultSelector.
If either the service name or port are not set, then
build() will throw an exception.
EServerfinal AddressFilter filter = ...;
final SSLContext secureContext = ...;
final EConfigure.ServerBuilder builder = EConfigure.serverBuilder();
EServer.openServer(builder.name("AppServer")
.port(6789)
.connectionType(EConfigure.ConnectionType.SECURE_TCP)
.sslContext(secureContext)
.addressFilter(filter)
.inputBufferSize(1_024)
.outputBufferSize(1_024)
.byteOrder(ByteOrder.BIG_ENDIAN)
.messageQueueSize(10_000)
.serviceSelector("svcSelector")
.connectionSelector("connSelector")
.heartbeatDelay(60_000L)
.heartbeatReplyDelay(30_000L)
.build());EConfigure.ConnectionBuildermByteOrder, mCanPause, mHbDelay, mHbReplyDelay, mInputBufferSize, mLoaderFlag, mMsgQueueSize, mName, mOutputBufferSize, mPauseConfig, mSSLContext| Modifier and Type | Method and Description |
|---|---|
EConfigure.ServerBuilder |
addressFilter(AddressFilter filter)
Sets the optional service address filter.
|
EConfigure.Service |
build()
Returns the eBus service configuration built from the
previously set parameters.
|
EConfigure.ServerBuilder |
configuration(EConfigure.Service config)
Copies in the settings from
config to this
builder. |
EConfigure.ServerBuilder |
connectionSelector(String selector)
Sets the selector used for accepted TCP connections.
|
EConfigure.ServerBuilder |
port(int port)
Sets the service TCP port.
|
EConfigure.ServerBuilder |
serviceSelector(String selector)
Sets the selector used for the service connection.
|
protected void |
validate()
Validates the builder parameters.
|
byteOrder, canPause, configuration, connectionType, heartbeatDelay, heartbeatReplyDelay, inputBufferSize, loaderFlag, messageQueueSize, name, outputBufferSize, pauseConfig, sslContextpublic EConfigure.ServerBuilder configuration(EConfigure.Service config)
config to this
builder. This method is provided for making changes to
an existing configuration since
EConfigure.Service is immutable.
if config is null, then nothing is
done and the builder remains unchanged.
config - copy settings from this configuration.this service builder.public EConfigure.ServerBuilder port(int port)
port - service TCP port.this service builder.com.typesafe.config.ConfigException - if port is not a valid TCP port.public EConfigure.ServerBuilder addressFilter(AddressFilter filter)
filter - the optional address filter. May be
null.this service builder.public EConfigure.ServerBuilder serviceSelector(String selector)
selector - eBus selector name.this service builder.com.typesafe.config.ConfigException - if name is null or empty or is not a
known selector.public EConfigure.ServerBuilder connectionSelector(String selector)
selector - eBus selector name.this service builder.com.typesafe.config.ConfigException - if name is null or empty or not a
known selector.public EConfigure.Service build()
com.typesafe.config.ConfigException - if any service name or service port is not set.protected void validate()
validate in class EConfigure.AbstractBuilder<EConfigure.ServerBuilder>com.typesafe.config.ConfigException - if a required parameter is not set or is not set to a
valid value with respect to another parameter.Copyright © 2020. All rights reserved.