Class TimedListenerManager

java.lang.Object
com.comphenix.protocol.timing.TimedListenerManager

public class TimedListenerManager extends Object
Represents a system for recording the time spent by each packet listener.
Author:
Kristian
  • Constructor Details

    • TimedListenerManager

      public TimedListenerManager()
  • Method Details

    • getInstance

      public static TimedListenerManager getInstance()
      Retrieve the shared listener manager.

      This should never change.

      Returns:
      The shared listener manager.
    • startTiming

      public boolean startTiming()
      Start timing listeners.
      Returns:
      TRUE if we started timing, FALSE if we are already timing listeners.
    • stopTiming

      public boolean stopTiming()
      s Stop timing listeners.
      Returns:
      TRUE if we stopped timing, FALSE otherwise.
    • getStarted

      public Date getStarted()
      Retrieve the time the listener was started.
      Returns:
      The time it was started, or NULL if they have never been started.
    • getStopped

      public Date getStopped()
      Retrieve the time the time listeners was stopped.
      Returns:
      The time they were stopped, or NULL if not found.
    • isTiming

      public boolean isTiming()
      Determine if we are currently timing listeners.
      Returns:
      TRUE if we are, FALSE otherwise.
    • clear

      public void clear()
      Reset all packet gathering data.
    • getTrackedPlugins

      public Set<String> getTrackedPlugins()
      Retrieve every tracked plugin.
      Returns:
      Every tracked plugin.
    • getTracker

      public TimedTracker getTracker(org.bukkit.plugin.Plugin plugin, TimedListenerManager.ListenerType type)
      Retrieve the timed tracker associated with the given plugin and listener type.
      Parameters:
      plugin - - the plugin.
      type - - the listener type.
      Returns:
      The timed tracker.
    • getTracker

      public TimedTracker getTracker(PacketListener listener, TimedListenerManager.ListenerType type)
      Retrieve the timed tracker associated with the given listener and listener type.
      Parameters:
      listener - - the listener.
      type - - the listener type.
      Returns:
      The timed tracker.
    • getTracker

      public TimedTracker getTracker(String pluginName, TimedListenerManager.ListenerType type)
      Retrieve the timed tracker associated with the given plugin and listener type.
      Parameters:
      pluginName - - the plugin name.
      type - - the listener type.
      Returns:
      The timed tracker.