Package net.orbyfied.osf.bootstrap
Class ServerBootstrap
java.lang.Object
net.orbyfied.osf.bootstrap.ServerBootstrap
Class for bootstrapping a server, it
does things like parse arguments, configuring
the server and starting the server.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnet.orbyfied.osf.util.ValuesWaits for the server to shutdown.Starts the server.configureArguments(BiConsumer<ServerBootstrap, net.orbyfied.osf.bootstrap.ArgParser> consumer) net.orbyfied.osf.util.Valuesnet.orbyfied.osf.server.ServerloadMainConfiguration(String file, Class<?> ref, String defaultResourceName) useConsoleArguments(String[] cmdArgs) withArgumentParser(net.orbyfied.osf.bootstrap.ArgParser parser) withConfigurationValue(Object key, Object value) withDefaultAddress(SocketAddress address) withDefaultPort(int port) withServer(Supplier<net.orbyfied.osf.server.Server> constructor) withServer(net.orbyfied.osf.server.Server server)
-
Constructor Details
-
ServerBootstrap
public ServerBootstrap()
-
-
Method Details
-
withArgumentParser
-
configureDefaultArguments
-
configureArguments
public ServerBootstrap configureArguments(BiConsumer<ServerBootstrap, net.orbyfied.osf.bootstrap.ArgParser> consumer) -
useConsoleArguments
-
argumentValues
public net.orbyfied.osf.util.Values argumentValues() -
loadMainConfiguration
-
getMainConfiguration
public net.orbyfied.osf.util.Values getMainConfiguration() -
withConfigurationValue
-
getServer
public net.orbyfied.osf.server.Server getServer() -
withServer
-
withServer
-
withDefaultAddress
-
withDefaultPort
-
bootstrap
Starts the server.- Returns:
- This.
-
awaitClose
Waits for the server to shutdown. This blocks the main thread until that happens.- Returns:
- This.
-