Package org.galliumpowered.plugin
Class PluginContainer
java.lang.Object
org.galliumpowered.plugin.PluginContainer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.google.inject.Injector
Gets the Guice injector used on the containerGets the instance of the pluginGet thePluginLifecycleState
org.apache.logging.log4j.Logger
Return a plugin loggerGets the plugin's metadataClass<?>
Gets the class of the pluginvoid
setInjector
(com.google.inject.Injector injector) Sets the plugin container'sInjector
void
setInstance
(Object instance) Sets the plugin's instancevoid
Sets the lifecycle state of the container and triggers the lifecycle event in the plugin's main classvoid
setMetadata
(PluginMetadata metadata) Sets the plugin's metadata
-
Constructor Details
-
PluginContainer
public PluginContainer()
-
-
Method Details
-
getInstance
Gets the instance of the plugin- Returns:
- Plugin instance
-
getMetadata
Gets the plugin's metadata- Returns:
- The plugin's
PluginMetadata
-
getInjector
public com.google.inject.Injector getInjector()Gets the Guice injector used on the container- Returns:
- Guice injector
-
setInstance
Sets the plugin's instance- Parameters:
instance
- The instance
-
setMetadata
Sets the plugin's metadata- Parameters:
metadata
- ThePluginMetadata
-
getPluginClass
Gets the class of the plugin- Returns:
- Plugin's main class as a
Class
-
setInjector
public void setInjector(com.google.inject.Injector injector) Sets the plugin container'sInjector
- Parameters:
injector
- The injector
-
setLifecycleState
Sets the lifecycle state of the container and triggers the lifecycle event in the plugin's main class- Parameters:
state
- The state in which the container will enter
-
getLogger
public org.apache.logging.log4j.Logger getLogger()Return a plugin logger- Returns:
Logger
for the plugin container
-
getLifecycleState
Get thePluginLifecycleState
- Returns:
- Plugin lifecycle state
-