Class PluginManager

java.lang.Object
com.morpheusdata.core.PluginManager

public class PluginManager extends Object
This is the base implementation of a Plugin Manager responsible for loading all plugins on the Morpheus classpath into memory. This should be expanded in the future to load custom files or even download from the marketplace.
  • Field Details

  • Constructor Details

  • Method Details

    • handleRoute

      public Object handleRoute(String route, ViewModel<?> model, Map<String,String> permissions)
    • registerPlugin

      public Plugin registerPlugin(String pathToJar) throws Exception
      Given a path to a plugin pathToJar file - create a child classloader, extract the Plugin Manifest and registers.
      Parameters:
      pathToJar - Path to jar file
      Returns:
      Plugin the instanced Plugin class loaded from the jar
      Throws:
      Exception - if file does not exist
    • getPlugins

      public ArrayList<Plugin> getPlugins()
      Returns the instances of all loaded Plugins within the current JVM
      Returns:
      A Collection of already initialized plugins
    • getRoutes

      public Map<Class,List<Route>> getRoutes()
    • findByCode

      public PluginProvider findByCode(String code)
    • getProvidersByType

      public Collection<PluginProvider> getProvidersByType(Class clazz)
    • getRenderer

      public Renderer<?> getRenderer()
    • getMergedPluginProperties

      public Properties getMergedPluginProperties(Locale locale)
      Returns all i18n Properties by locale for all loaded plugins
      Parameters:
      locale - This is the Locale with which we want to scope i18n localization lookup
      Returns:
      the merged Properties of all loaded plugins
    • getProperties

      public Properties getProperties(Plugin plugin, Locale locale) throws IOException
      Returns a list of all i18n Properties for the plugin to be dynamically loaded for lookup in Morpheus
      Parameters:
      locale - the Locale of properties to be loaded. If not found the default will also be loaded
      Returns:
      Properties list
      Throws:
      IOException
    • getPackages

      public Collection<String> getPackages(Plugin plugin) throws IOException
      Returns a list of all morpheus packages for the plugin to be dynamically loaded in Morpheus
      Parameters:
      plugin - the plugin we are loading from
      Returns:
      a collection of strings of paths to package files in the plugin
      Throws:
      IOException
    • getScribeResources

      public Collection<String> getScribeResources(Plugin plugin) throws IOException
      Returns a list of all scribe resource files to be dynamically loaded in Morpheus
      Parameters:
      plugin - the plugin we are loading fromwe
      Returns:
      a collection of strings of paths to scribe resources in the plugin
      Throws:
      IOException
    • getSeedResources

      public Collection<String> getSeedResources(Plugin plugin) throws IOException
      Returns a list of all seed resource files to be dynamically loaded in Morpheus
      Parameters:
      plugin - the plugin we are loading from
      Returns:
      a collection of strings of paths to seed resources in the plugin
      Throws:
      IOException