Class PluginRegistry


  • public class PluginRegistry
    extends java.lang.Object
    This represents the registry subsystem that manages mulitple types of plugin information. The plugin information includes id, name, classname, and description.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String ID  
      static org.slf4j.Logger logger  
    • Constructor Summary

      Constructors 
      Constructor Description
      PluginRegistry()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addPluginInfo​(java.lang.String type, java.lang.String id, IPluginInfo info)  
      void addPluginInfo​(java.lang.String type, java.lang.String id, IPluginInfo info, int saveConfig)  
      IPluginInfo createPluginInfo​(java.lang.String name, java.lang.String desc, java.lang.String classPath)  
      IConfigStore getConfigStore()
      Returns the root configuration storage of this system.
      IConfigStore getFileConfigStore()
      Returns handle to the registry configuration file.
      java.util.Enumeration<java.lang.String> getIds​(java.lang.String type)
      Returns a list of identifiers of the given type.
      IPluginInfo getPluginInfo​(java.lang.String type, java.lang.String id)
      Retrieves the plugin information.
      java.util.Enumeration<java.lang.String> getTypeNames()
      Returns all type names.
      void init​(IConfigStore config, java.lang.String defaultRegistryFile)
      Initializes this subsystem with the given configuration store.
      void loadPlugin​(IConfigStore config, java.lang.String type, java.lang.String id)
      Load plugins of the given type.
      void loadPlugins​(IConfigStore config, java.lang.String type)
      Load plugins of the given type.
      void rebuildConfigStore​(java.util.Locale locale)  
      void removePluginInfo​(java.lang.String type, java.lang.String id)  
      void shutdown()
      Stops this system.
      void startup()
      Notifies this subsystem if owner is in running mode.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • logger

        public static org.slf4j.Logger logger
    • Constructor Detail

      • PluginRegistry

        public PluginRegistry()
    • Method Detail

      • init

        public void init​(IConfigStore config,
                         java.lang.String defaultRegistryFile)
                  throws java.lang.Exception
        Initializes this subsystem with the given configuration store.

        Parameters:
        config - configuration store
        Throws:
        EBaseException - failed to initialize
        java.lang.Exception
      • createPluginInfo

        public IPluginInfo createPluginInfo​(java.lang.String name,
                                            java.lang.String desc,
                                            java.lang.String classPath)
      • shutdown

        public void shutdown()
        Stops this system. The owner may call shutdown anytime after initialization.

      • getConfigStore

        public IConfigStore getConfigStore()
        Returns the root configuration storage of this system.

        Returns:
        configuration store of this subsystem
      • getFileConfigStore

        public IConfigStore getFileConfigStore()
        Returns handle to the registry configuration file.
      • getTypeNames

        public java.util.Enumeration<java.lang.String> getTypeNames()
        Returns all type names.
      • getIds

        public java.util.Enumeration<java.lang.String> getIds​(java.lang.String type)
        Returns a list of identifiers of the given type.
      • getPluginInfo

        public IPluginInfo getPluginInfo​(java.lang.String type,
                                         java.lang.String id)
        Retrieves the plugin information.