Package org.galliumpowered.plugin
Class PluginContainer
java.lang.Object
org.galliumpowered.plugin.PluginContainer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.google.inject.InjectorGets the Guice injector used on the containerGets the instance of the pluginGet thePluginLifecycleStateorg.apache.logging.log4j.LoggerReturn a plugin loggerGets the plugin's metadataClass<?>Gets the class of the pluginvoidsetInjector(com.google.inject.Injector injector) Sets the plugin container'sInjectorvoidsetInstance(Object instance) Sets the plugin's instancevoidSets the lifecycle state of the container and triggers the lifecycle event in the plugin's main classvoidsetMetadata(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:
Loggerfor the plugin container
-
getLifecycleState
Get thePluginLifecycleState- Returns:
- Plugin lifecycle state
-