Package dev.boze.api
Class BozeInstance
java.lang.Object
dev.boze.api.BozeInstance
Boze (API) Instance
This class keeps track of all the addons and modules registered by addons
It also provides addons a way to register packages and subscribe to events
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet all registered addonsGets a list of all addon dispatchersGets a list of all modules registered by addonsvoid
Post an eventvoid
registerAddon
(Addon addon) Register an addonvoid
registerPackage
(String pkg) Registers a (java) package into the event busvoid
Subscribes a class to listen to eventsvoid
Subscribes an object to listen to eventsvoid
unsubscribe
(Class<?> listener) Unsubscribes a class to listen to eventsvoid
unsubscribe
(Object listener) Unsubscribes an object to listen to events
-
Field Details
-
INSTANCE
The instance of Boze API
-
-
Method Details
-
registerAddon
Register an addon- Parameters:
addon
- The addon to register- Throws:
AddonInitializationException
- If the addon fails to initialize
-
getAddons
Get all registered addons- Returns:
- map of all registered addon metadata and addons
-
getModules
Gets a list of all modules registered by addons- Returns:
- A list of all modules registered by addons
-
getDispatchers
Gets a list of all addon dispatchers- Returns:
- A list of all addon dispatchers
-
registerPackage
Registers a (java) package into the event bus- Parameters:
pkg
- The package to register
-
subscribe
Subscribes an object to listen to events- Parameters:
listener
- The object to subscribe
-
subscribe
Subscribes a class to listen to events- Parameters:
listener
- The class to subscribe
-
unsubscribe
Unsubscribes an object to listen to events- Parameters:
listener
- The object to unsubscribe
-
unsubscribe
Unsubscribes a class to listen to events- Parameters:
listener
- The class to unsubscribe
-
post
Post an event- Parameters:
event
- The event to post
-