Enum AbstractConsoleServer.ServerState

java.lang.Object
java.lang.Enum<AbstractConsoleServer.ServerState>
de.calamanari.pk.util.AbstractConsoleServer.ServerState
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<AbstractConsoleServer.ServerState>, java.lang.constant.Constable
Enclosing class:
AbstractConsoleServer

public static enum AbstractConsoleServer.ServerState
extends java.lang.Enum<AbstractConsoleServer.ServerState>
States for a server's state machine
Why so many states?
Reason: whenever multiple threads come into play using monitors (wait/notify) there is a risk of race conditions (notify before wait). By leveraging a monitor synchronization as a guard for state changes, we can design the code so that the normal case AND the rare race-condition case will be handled properly.
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    java.lang.Enum.EnumDesc<E extends java.lang.Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant Description
    OFFLINE
    server offline
    ONLINE
    server ready
    SHUT_DOWN
    during shutdown
    SHUT_DOWN_WAITING
    waiting for shutdown
    START_UP
    during startup
    START_UP_WAITING
    waiting for startup
  • Method Summary

    Modifier and Type Method Description
    static AbstractConsoleServer.ServerState valueOf​(java.lang.String name)
    Returns the enum constant of this type with the specified name.
    static AbstractConsoleServer.ServerState[] values()
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Enum

    compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait