Class ServerMonitorManager.ServerStateSnapshot

java.lang.Object
com.ultikits.ultitools.manager.ServerMonitorManager.ServerStateSnapshot
Enclosing class:
ServerMonitorManager

static final class ServerMonitorManager.ServerStateSnapshot extends Object
The result of one main-thread sample. Every field is final and never changed after construction, published via a volatile field, so a reading thread sees either the previous complete snapshot or this complete snapshot, never a half-built one.

The three JsonArray fields must never be mutated again after being published -- they are pushed directly into the outgoing message and serialization is read-only, so sharing the instance is safe; the moment anyone calls add on one after publication, that precondition no longer holds.

  • Field Details

    • EMPTY

    • playerCount

      final int playerCount
    • maxPlayers

      final int maxPlayers
    • onlineMode

      final boolean onlineMode
    • serverVersion

      final String serverVersion
    • worldCount

      final int worldCount
    • pluginCount

      final int pluginCount
    • worlds

      final com.google.gson.JsonArray worlds
    • onlinePlayers

      final com.google.gson.JsonArray onlinePlayers
    • plugins

      final com.google.gson.JsonArray plugins
  • Constructor Details

    • ServerStateSnapshot

      ServerStateSnapshot(int playerCount, int maxPlayers, boolean onlineMode, String serverVersion, int worldCount, int pluginCount, com.google.gson.JsonArray worlds, com.google.gson.JsonArray onlinePlayers, com.google.gson.JsonArray plugins)