Class DefaultPluginManager
- java.lang.Object
-
- org.pentaho.platform.plugin.services.pluginmgr.DefaultPluginManager
-
- All Implemented Interfaces:
org.pentaho.platform.api.engine.IPluginManager
public class DefaultPluginManager extends Object implements org.pentaho.platform.api.engine.IPluginManager
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,org.springframework.context.support.GenericApplicationContext>
beanFactoryMap
protected Map<String,ClassLoader>
classLoaderMap
protected Map<String,org.pentaho.platform.api.engine.IContentInfo>
contentTypeByExtension
protected List<org.pentaho.ui.xul.XulOverlay>
overlaysCache
protected Map<String,org.pentaho.platform.api.engine.IPlatformPlugin>
registeredPlugins
-
Constructor Summary
Constructors Constructor Description DefaultPluginManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addPluginManagerListener(org.pentaho.platform.api.engine.IPluginManagerListener listener)
protected void
assertUnique(String pluginId, String beanId)
A utility method that throws an exception if a bean with the id is already defined for this pluginorg.pentaho.platform.api.action.IAction
getAction(String type, String perspectiveName)
Object
getBean(String beanId)
Object
getBean(String beanId, Class<?> requiredType)
org.springframework.beans.factory.ListableBeanFactory
getBeanFactory(String pluginId)
ClassLoader
getClassLoader(String pluginId)
ClassLoader
getClassLoader(org.pentaho.platform.api.engine.IPlatformPlugin plugin)
org.pentaho.platform.api.engine.IContentGenerator
getContentGenerator(String type, String perspectiveName)
org.pentaho.platform.api.engine.IContentGenerator
getContentGeneratorForType(String type, org.pentaho.platform.api.engine.IPentahoSession session)
Deprecated.org.pentaho.platform.api.engine.IContentInfo
getContentTypeInfo(String type)
Set<String>
getContentTypes()
List<String>
getExternalResourcesForContext(String context)
protected org.springframework.beans.factory.BeanFactory
getNativeBeanFactory(org.pentaho.platform.api.engine.IPlatformPlugin plugin, ClassLoader loader)
The native bean factory is the bean factory that has had all of its bean definitions loaded natively.List<org.pentaho.ui.xul.XulOverlay>
getOverlays()
String
getPluginIdForClassLoader(ClassLoader classLoader)
String
getPluginIdForType(String contentType)
List<String>
getPluginRESTPerspectivesForId(String id)
List<String>
getPluginRESTPerspectivesForType(String contentType)
Object
getPluginSetting(String pluginId, String key, String defaultValue)
Object
getPluginSetting(org.pentaho.platform.api.engine.IPlatformPlugin plugin, String key, String defaultValue)
List<String>
getRegisteredPlugins()
String
getServicePlugin(String path)
Deprecated.InputStream
getStaticResource(String path)
Deprecated.protected void
initializeBeanFactory(org.pentaho.platform.api.engine.IPlatformPlugin plugin, ClassLoader loader)
Initializes a bean factory for serving up instance of plugin classes.boolean
isBeanRegistered(String beanId)
boolean
isPublic(String pluginId, String path)
protected boolean
isRequested(String servicePath, String requestPath)
Returntrue
if the servicePath is being addressed by the requestPath.boolean
isStaticResource(String path)
Deprecated.Class<?>
loadClass(String beanId)
protected void
registerContentTypes(org.pentaho.platform.api.engine.IPlatformPlugin plugin, ClassLoader loader)
boolean
reload()
boolean
reload(org.pentaho.platform.api.engine.IPentahoSession session)
Deprecated.void
unloadAllPlugins()
-
-
-
Field Detail
-
classLoaderMap
protected Map<String,ClassLoader> classLoaderMap
-
beanFactoryMap
protected Map<String,org.springframework.context.support.GenericApplicationContext> beanFactoryMap
-
registeredPlugins
protected Map<String,org.pentaho.platform.api.engine.IPlatformPlugin> registeredPlugins
-
contentTypeByExtension
protected Map<String,org.pentaho.platform.api.engine.IContentInfo> contentTypeByExtension
-
overlaysCache
protected List<org.pentaho.ui.xul.XulOverlay> overlaysCache
-
-
Method Detail
-
getContentTypes
public Set<String> getContentTypes()
- Specified by:
getContentTypes
in interfaceorg.pentaho.platform.api.engine.IPluginManager
-
getOverlays
public List<org.pentaho.ui.xul.XulOverlay> getOverlays()
- Specified by:
getOverlays
in interfaceorg.pentaho.platform.api.engine.IPluginManager
-
getContentTypeInfo
public org.pentaho.platform.api.engine.IContentInfo getContentTypeInfo(String type)
- Specified by:
getContentTypeInfo
in interfaceorg.pentaho.platform.api.engine.IPluginManager
-
getRegisteredPlugins
public List<String> getRegisteredPlugins()
- Specified by:
getRegisteredPlugins
in interfaceorg.pentaho.platform.api.engine.IPluginManager
-
reload
@Deprecated public final boolean reload(org.pentaho.platform.api.engine.IPentahoSession session)
Deprecated.- Specified by:
reload
in interfaceorg.pentaho.platform.api.engine.IPluginManager
-
reload
public final boolean reload()
- Specified by:
reload
in interfaceorg.pentaho.platform.api.engine.IPluginManager
-
registerContentTypes
protected void registerContentTypes(org.pentaho.platform.api.engine.IPlatformPlugin plugin, ClassLoader loader) throws org.pentaho.platform.api.engine.PlatformPluginRegistrationException
- Throws:
org.pentaho.platform.api.engine.PlatformPluginRegistrationException
-
getNativeBeanFactory
protected org.springframework.beans.factory.BeanFactory getNativeBeanFactory(org.pentaho.platform.api.engine.IPlatformPlugin plugin, ClassLoader loader)
The native bean factory is the bean factory that has had all of its bean definitions loaded natively. In other words, the plugin manager will not add any further bean definitions (i.e. from a plugin.xml file) into this factory. This factory represents the one responsible for holding bean definitions for plugin.spring.xml or, if in a unit test environment, the unit test pre-loaded bean factory.- Returns:
- a bean factory will preconfigured bean definitions or
null
if no bean definition source is available
-
initializeBeanFactory
protected void initializeBeanFactory(org.pentaho.platform.api.engine.IPlatformPlugin plugin, ClassLoader loader) throws org.pentaho.platform.api.engine.PlatformPluginRegistrationException
Initializes a bean factory for serving up instance of plugin classes.- Throws:
org.pentaho.platform.api.engine.PlatformPluginRegistrationException
-
assertUnique
protected void assertUnique(String pluginId, String beanId) throws org.pentaho.platform.api.engine.PlatformPluginRegistrationException
A utility method that throws an exception if a bean with the id is already defined for this plugin- Throws:
org.pentaho.platform.api.engine.PlatformPluginRegistrationException
-
getClassLoader
public ClassLoader getClassLoader(org.pentaho.platform.api.engine.IPlatformPlugin plugin)
-
getClassLoader
public ClassLoader getClassLoader(String pluginId)
- Specified by:
getClassLoader
in interfaceorg.pentaho.platform.api.engine.IPluginManager
-
getBeanFactory
public org.springframework.beans.factory.ListableBeanFactory getBeanFactory(String pluginId)
- Specified by:
getBeanFactory
in interfaceorg.pentaho.platform.api.engine.IPluginManager
-
getBean
public Object getBean(String beanId) throws org.pentaho.platform.api.engine.PluginBeanException
- Specified by:
getBean
in interfaceorg.pentaho.platform.api.engine.IPluginManager
- Throws:
org.pentaho.platform.api.engine.PluginBeanException
-
getContentGenerator
public org.pentaho.platform.api.engine.IContentGenerator getContentGenerator(String type, String perspectiveName)
- Specified by:
getContentGenerator
in interfaceorg.pentaho.platform.api.engine.IPluginManager
-
getAction
public org.pentaho.platform.api.action.IAction getAction(String type, String perspectiveName)
-
loadClass
public Class<?> loadClass(String beanId) throws org.pentaho.platform.api.engine.PluginBeanException
- Specified by:
loadClass
in interfaceorg.pentaho.platform.api.engine.IPluginManager
- Throws:
org.pentaho.platform.api.engine.PluginBeanException
-
isBeanRegistered
public boolean isBeanRegistered(String beanId)
- Specified by:
isBeanRegistered
in interfaceorg.pentaho.platform.api.engine.IPluginManager
-
unloadAllPlugins
public void unloadAllPlugins()
- Specified by:
unloadAllPlugins
in interfaceorg.pentaho.platform.api.engine.IPluginManager
-
getPluginSetting
public Object getPluginSetting(org.pentaho.platform.api.engine.IPlatformPlugin plugin, String key, String defaultValue)
-
getPluginSetting
public Object getPluginSetting(String pluginId, String key, String defaultValue)
- Specified by:
getPluginSetting
in interfaceorg.pentaho.platform.api.engine.IPluginManager
-
getPluginIdForType
public String getPluginIdForType(String contentType)
- Specified by:
getPluginIdForType
in interfaceorg.pentaho.platform.api.engine.IPluginManager
-
getContentGeneratorForType
@Deprecated public org.pentaho.platform.api.engine.IContentGenerator getContentGeneratorForType(String type, org.pentaho.platform.api.engine.IPentahoSession session) throws org.pentaho.platform.api.engine.ObjectFactoryException
Deprecated.- Specified by:
getContentGeneratorForType
in interfaceorg.pentaho.platform.api.engine.IPluginManager
- Throws:
org.pentaho.platform.api.engine.ObjectFactoryException
-
getPluginIdForClassLoader
public String getPluginIdForClassLoader(ClassLoader classLoader)
- Specified by:
getPluginIdForClassLoader
in interfaceorg.pentaho.platform.api.engine.IPluginManager
-
isRequested
protected boolean isRequested(String servicePath, String requestPath)
Returntrue
if the servicePath is being addressed by the requestPath. The request path is said to request the service if it contains at least ALL of the elements of the servicePath, in order. It may include more than these elements but it must contain at least the servicePath.- Parameters:
servicePath
-requestPath
-- Returns:
true
if the servicePath is being addressed by the requestPath
-
getServicePlugin
@Deprecated public String getServicePlugin(String path)
Deprecated.- Specified by:
getServicePlugin
in interfaceorg.pentaho.platform.api.engine.IPluginManager
-
isStaticResource
@Deprecated public boolean isStaticResource(String path)
Deprecated.- Specified by:
isStaticResource
in interfaceorg.pentaho.platform.api.engine.IPluginManager
-
isPublic
public boolean isPublic(String pluginId, String path)
- Specified by:
isPublic
in interfaceorg.pentaho.platform.api.engine.IPluginManager
-
getStaticResource
@Deprecated public InputStream getStaticResource(String path)
Deprecated.- Specified by:
getStaticResource
in interfaceorg.pentaho.platform.api.engine.IPluginManager
-
getExternalResourcesForContext
public List<String> getExternalResourcesForContext(String context)
- Specified by:
getExternalResourcesForContext
in interfaceorg.pentaho.platform.api.engine.IPluginManager
-
getPluginRESTPerspectivesForType
public List<String> getPluginRESTPerspectivesForType(String contentType)
- Specified by:
getPluginRESTPerspectivesForType
in interfaceorg.pentaho.platform.api.engine.IPluginManager
-
getPluginRESTPerspectivesForId
public List<String> getPluginRESTPerspectivesForId(String id)
- Specified by:
getPluginRESTPerspectivesForId
in interfaceorg.pentaho.platform.api.engine.IPluginManager
-
addPluginManagerListener
public void addPluginManagerListener(org.pentaho.platform.api.engine.IPluginManagerListener listener)
- Specified by:
addPluginManagerListener
in interfaceorg.pentaho.platform.api.engine.IPluginManager
-
-