Class PrivilegedSpringPlugin

java.lang.Object
org.pf4j.Plugin
cn.sliew.carp.framework.pf4j.spring.PrivilegedSpringPlugin
Direct Known Subclasses:
SpringLoaderPlugin

public abstract class PrivilegedSpringPlugin extends org.pf4j.Plugin
Allows a plugin to register BeanDefinitions to be loaded in the application Spring ApplicationContext.

This can be used in plugins that want to wire themselves into the application's Spring Context.

  • Field Summary

    Fields inherited from class org.pf4j.Plugin

    log, wrapper
  • Constructor Summary

    Constructors
    Constructor
    Description
    PrivilegedSpringPlugin(org.pf4j.PluginWrapper wrapper)
    Constructor to be used by plugin manager for plugin instantiation.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.springframework.beans.factory.config.BeanDefinition
    Create a bean definition for the given class.
    protected org.springframework.beans.factory.config.BeanDefinition
    Create a primary bean definition for the given class.
    protected void
    registerBean(org.springframework.beans.factory.config.BeanDefinition beanDefinition, org.springframework.beans.factory.support.BeanDefinitionRegistry registry)
    Register the bean definition into the registry.
    abstract void
    registerBeanDefinitions(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 org.pf4j.Plugin

    delete, getWrapper, start, stop

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PrivilegedSpringPlugin

      public PrivilegedSpringPlugin(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 abstract void registerBeanDefinitions(org.springframework.beans.factory.support.BeanDefinitionRegistry registry)
      Provides the opportunity to register bean definitions from the plugin into the application's registry.
      Parameters:
      registry - registry
    • beanDefinitionFor

      protected org.springframework.beans.factory.config.BeanDefinition beanDefinitionFor(Class beanClass)
      Create a bean definition for the given class.
      Parameters:
      beanClass - bean class
      Returns:
      bean definition
    • primaryBeanDefinitionFor

      protected org.springframework.beans.factory.config.BeanDefinition primaryBeanDefinitionFor(Class beanClass)
      Create a primary bean definition for the given class.
      Parameters:
      beanClass - bean class
      Returns:
      bean definition
    • registerBean

      protected void registerBean(org.springframework.beans.factory.config.BeanDefinition beanDefinition, org.springframework.beans.factory.support.BeanDefinitionRegistry registry) throws ClassNotFoundException
      Register the bean definition into the registry.
      Parameters:
      beanDefinition - bean definition
      registry - registry
      Throws:
      ClassNotFoundException - throw if the bean class cannot be loaded