Class ServerBootstrap

java.lang.Object
net.orbyfied.osf.bootstrap.ServerBootstrap

public class ServerBootstrap extends Object
Class for bootstrapping a server, it does things like parse arguments, configuring the server and starting the server.
  • Constructor Details

    • ServerBootstrap

      public ServerBootstrap()
  • Method Details

    • withArgumentParser

      public ServerBootstrap withArgumentParser(net.orbyfied.osf.bootstrap.ArgParser parser)
    • configureDefaultArguments

      public ServerBootstrap configureDefaultArguments()
    • configureArguments

      public ServerBootstrap configureArguments(BiConsumer<ServerBootstrap,net.orbyfied.osf.bootstrap.ArgParser> consumer)
    • useConsoleArguments

      public ServerBootstrap useConsoleArguments(String[] cmdArgs)
    • argumentValues

      public net.orbyfied.osf.util.Values argumentValues()
    • loadMainConfiguration

      public ServerBootstrap loadMainConfiguration(String file, Class<?> ref, String defaultResourceName)
    • getMainConfiguration

      public net.orbyfied.osf.util.Values getMainConfiguration()
    • withConfigurationValue

      public ServerBootstrap withConfigurationValue(Object key, Object value)
    • getServer

      public net.orbyfied.osf.server.Server getServer()
    • withServer

      public ServerBootstrap withServer(net.orbyfied.osf.server.Server server)
    • withServer

      public ServerBootstrap withServer(Supplier<net.orbyfied.osf.server.Server> constructor)
    • withDefaultAddress

      public ServerBootstrap withDefaultAddress(SocketAddress address)
    • withDefaultPort

      public ServerBootstrap withDefaultPort(int port)
    • bootstrap

      public ServerBootstrap bootstrap()
      Starts the server.
      Returns:
      This.
    • awaitClose

      public ServerBootstrap awaitClose()
      Waits for the server to shutdown. This blocks the main thread until that happens.
      Returns:
      This.