Package ml.karmaconfigs.api.common.utils
Class BridgeLoader<T extends KarmaSource>
java.lang.Object
ml.karmaconfigs.api.common.utils.BridgeLoader<T>
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 -
Method Summary
Modifier and TypeMethodDescriptionprotected voidConnect a new source to the bridgeprotected voidConnect a new source to the bridgeprotected voidConnect a new source to the bridgestatic booleanGet if the bridge is runningprotected voidsetRunning(boolean status)Set the bridge running statusabstract voidstart()Start the bridge loaderabstract voidstop()Stop the bridge
-
Constructor Details
-
BridgeLoader
Initialize the bridge loader- Parameters:
connection- the connection source nameinstance- the source class- Throws:
IllegalStateException- if another bridge is already running
-
-
Method Details
-
start
Start the bridge loader- Throws:
Throwable- This is just if the bridge start method throws any error
-
stop
Stop the bridge- Throws:
Throwable- This is just if the bridge stop method throws any error
-
connect
Connect a new source to the bridge- Parameters:
target- the source target
-
connect
Connect a new source to the bridge- Parameters:
target- the source target
-
connect
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
-