LoaderApi Class
Introduction
The LoaderApi class is provided by the PolarLoader plugin and is the only Polar class that is safe to reference before Polar has finished booting. It is used to defer API access until Polar is fully loaded.
See API Overview for the class loading strategy and the race condition to be aware of.
Methods
registerEnableCallback
Description:
Registers a callback that is run once Polar has been enabled. If Polar is already enabled at the time of registration, the callback may not be called; see the race condition notes in the API Overview.
Parameters:
runnable- The code to run once Polar is loaded. Ideally a method reference to a class that is not the plugin's main class.
Throws:
LoaderAccessViolationException - If the stub from the API artifact is invoked instead of the loader's implementation.
runCallbacks
Description:
Runs all registered enable callbacks. This is invoked by Polar itself and should not be called by plugins.
Throws:
LoaderAccessViolationException - If the stub from the API artifact is invoked instead of the loader's implementation.