Class BridgeLoader<T extends KarmaSource>

java.lang.Object
ml.karmaconfigs.api.common.utils.BridgeLoader<T>

public abstract class BridgeLoader<T extends KarmaSource> extends Object
KarmaAPI bridge connector. This is used by KarmaAPI to load KarmaSource modules at runtime making a bridge with a main loader provided by Bukkit or Bungee loader
  • Constructor Summary

    Constructors
    Constructor
    Description
    BridgeLoader​(String connection, T instance)
    Initialize the bridge loader
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    connect​(File target)
    Connect a new source to the bridge
    protected void
    connect​(URL target)
    Connect a new source to the bridge
    protected void
    connect​(Path target)
    Connect a new source to the bridge
    static boolean
    Get if the bridge is running
    protected void
    setRunning​(boolean status)
    Set the bridge running status
    abstract void
    Start the bridge loader
    abstract void
    Stop the bridge

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BridgeLoader

      public BridgeLoader(String connection, T instance) throws IllegalStateException
      Initialize the bridge loader
      Parameters:
      connection - the connection source name
      instance - the source class
      Throws:
      IllegalStateException - if another bridge is already running
  • Method Details

    • start

      public abstract void start() throws Throwable
      Start the bridge loader
      Throws:
      Throwable - This is just if the bridge start method throws any error
    • stop

      public abstract void stop() throws Throwable
      Stop the bridge
      Throws:
      Throwable - This is just if the bridge stop method throws any error
    • connect

      protected final void connect(File target)
      Connect a new source to the bridge
      Parameters:
      target - the source target
    • connect

      protected final void connect(Path target)
      Connect a new source to the bridge
      Parameters:
      target - the source target
    • connect

      protected final void connect(URL target)
      Connect a new source to the bridge
      Parameters:
      target - the source target
    • setRunning

      protected final void setRunning(boolean status)
      Set the bridge running status
      Parameters:
      status - the bridge running status
    • isRunning

      public static boolean isRunning()
      Get if the bridge is running
      Returns:
      the bridge status