Class SpringLoaderPlugin
java.lang.Object
org.pf4j.Plugin
cn.sliew.carp.framework.pf4j.spring.PrivilegedSpringPlugin
cn.sliew.carp.framework.pf4j.spring.SpringLoaderPlugin
Allows a plugin to scan packages for beans and load Spring Configurations.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.springframework.context.annotation.AnnotationConfigApplicationContextThe plugin context.Fields inherited from class org.pf4j.Plugin
log, wrapper -
Constructor Summary
ConstructorsConstructorDescriptionSpringLoaderPlugin(org.pf4j.PluginWrapper wrapper) Constructor to be used by plugin manager for plugin instantiation. -
Method Summary
Modifier and TypeMethodDescriptionSpecify plugin classes to register with the plugin context.Specify plugin packages to scan for beans.voidregisterBeanDefinitions(org.springframework.beans.factory.support.BeanDefinitionRegistry registry) Provides the opportunity to register bean definitions from the plugin into the application's registry.Methods inherited from class cn.sliew.carp.framework.pf4j.spring.PrivilegedSpringPlugin
beanDefinitionFor, primaryBeanDefinitionFor, registerBeanMethods inherited from class org.pf4j.Plugin
delete, getWrapper, start, stop
-
Field Details
-
pluginContext
protected org.springframework.context.annotation.AnnotationConfigApplicationContext pluginContextThe plugin context.
-
-
Constructor Details
-
SpringLoaderPlugin
public SpringLoaderPlugin(org.pf4j.PluginWrapper wrapper) Constructor to be used by plugin manager for plugin instantiation. Your plugins have to provide constructor with this exact signature to be successfully loaded by manager.- Parameters:
wrapper- plugin wrapper
-
-
Method Details
-
registerBeanDefinitions
public void registerBeanDefinitions(org.springframework.beans.factory.support.BeanDefinitionRegistry registry) Description copied from class:PrivilegedSpringPluginProvides the opportunity to register bean definitions from the plugin into the application's registry.- Specified by:
registerBeanDefinitionsin classPrivilegedSpringPlugin- Parameters:
registry- registry
-
getPackagesToScan
Specify plugin packages to scan for beans.- Returns:
- plugin packages to scan for beans
-
getClassesToRegister
Specify plugin classes to register with the plugin context.- Returns:
- plugin classes to register with the plugin context
-