Class TimeServer

java.lang.Object
org.episteme.social.history.clock.TimeServer
Direct Known Subclasses:
LocalTimeServer, NetworkTimeServer

public abstract class TimeServer extends Object
An abstract base class for chronological services capable of broadcasting time updates to listeners. Concrete implementations may represent real-time clocks, simulation engines, or network-synchronized services.
Since:
1.0
Version:
1.1
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Constructor Details

    • TimeServer

      public TimeServer()
  • Method Details

    • start

      public abstract void start()
      Activates the time server, initiating update broadcasts.
    • stop

      public abstract void stop()
      Deactivates the time server, halting all broadcasts.
    • dispatchTimeEvent

      public void dispatchTimeEvent(TimeEvent evt)
      Propagates a time event to all registered listeners.
      Parameters:
      evt - the time event to dispatch
      Throws:
      NullPointerException - if event is null
    • addTimeListener

      public void addTimeListener(TimeListener listener)
      Adds a listener to be notified of time updates.
      Parameters:
      listener - the observer to add
      Throws:
      NullPointerException - if listener is null
    • removeTimeListener

      public void removeTimeListener(TimeListener listener)
      Removes a listener from the notification list.
      Parameters:
      listener - the observer to remove
    • getTimeListeners

      public TimeListener[] getTimeListeners()
      Returns an array of all currently registered time listeners.
      Returns:
      array of listeners (may be empty)