Package com.morpheusdata.core
Class PluginManager
- java.lang.Object
-
- com.morpheusdata.core.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 Summary
Constructors Constructor Description PluginManager(MorpheusContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PluginProvider
findByCode(java.lang.String code)
java.util.ArrayList<Plugin>
getPlugins()
Returns the instances of all loaded Plugins within the current JVMjava.util.Collection<PluginProvider>
getProvidersByType(java.lang.Class clazz)
Renderer<?>
getRenderer()
java.util.Map<java.lang.Class,java.util.List<Route>>
getRoutes()
java.lang.Object
handleRoute(java.lang.String route, ViewModel<?> model, java.util.Map<java.lang.String,java.lang.String> permissions)
Plugin
registerPlugin(java.lang.String pathToJar)
Given a path to a plugin pathToJar file - create a child classloader, extract the Plugin Manifest and registers.
-
-
-
Constructor Detail
-
PluginManager
public PluginManager(MorpheusContext context)
-
-
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()
-
-