Class PluginManager


  • public class PluginManager
    extends java.lang.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.
    • Constructor Detail

    • Method Detail

      • handleRoute

        public java.lang.Object handleRoute​(java.lang.String route,
                                            ViewModel<?> model,
                                            java.util.Map<java.lang.String,​java.lang.String> permissions)
      • registerPlugin

        public Plugin registerPlugin​(java.lang.String pathToJar)
                              throws java.lang.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:
        java.lang.Exception - if file does not exist
      • getPlugins

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

        public java.util.Map<java.lang.Class,​java.util.List<Route>> getRoutes()
      • findByCode

        public PluginProvider findByCode​(java.lang.String code)
      • getProvidersByType

        public java.util.Collection<PluginProvider> getProvidersByType​(java.lang.Class clazz)
      • getRenderer

        public Renderer<?> getRenderer()