org.pentaho.platform.plugin.services.pluginmgr
Class PlatformPlugin

java.lang.Object
  extended by org.pentaho.platform.plugin.services.pluginmgr.PlatformPlugin
All Implemented Interfaces:
IPentahoInitializer, IPlatformPlugin, IPluginLifecycleListener

public class PlatformPlugin
extends Object
implements IPlatformPlugin, IPentahoInitializer

Default bean implementation of IPlatformPlugin


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.pentaho.platform.api.engine.IPlatformPlugin
IPlatformPlugin.ClassLoaderType
 
Constructor Summary
PlatformPlugin()
           
 
Method Summary
 void addBean(PluginBeanDefinition beanDefinition)
           
 void addContentGenerator(IContentGeneratorInfo contentGenerator)
          Adds a content generator to this plug-in
 void addContentInfo(IContentInfo contentInfo)
          Adds a content info type to this plug-in
 void addExternalResource(String context, String resource)
           
 void addInitializer(IPentahoInitializer initializer)
          Adds an initializer to this plug-in
 void addLifecycleListener(IPluginLifecycleListener listener)
          Registers a lifecycle listener with this plugin.
 void addMenuCustomization(org.pentaho.ui.xul.IMenuCustomization customization)
           
 void addOverlay(org.pentaho.ui.xul.XulOverlay overlay)
          Adds an overlay to this plug-in
 void addStaticResourcePath(String url, String localFolder)
           
 void addWebservice(PluginServiceDefinition serviceDefinition)
           
 Collection<PluginBeanDefinition> getBeans()
          Returns a list of bean configurations for this plugin-in
 List<IContentGeneratorInfo> getContentGenerators()
          Returns the list of content generators for this plug-in
 List<IContentInfo> getContentInfos()
          Returns a list of content info objects for this plug-in
 List<String> getExternalResourcesForContext(String context)
          Return a List of scripts registered for a given context.
 String getId()
          Returns the unique ID of this plugin
 String getLifecycleListenerClassname()
          Returns the fully qualified name of the lifecycle listener class defined by this plugin.
 IPlatformPlugin.ClassLoaderType getLoaderType()
          Indicates what kind of classloader should be used to load classes and resources from this plugin.
 List<?> getMenuCustomizations()
          Returns a list of menu overlays for this plug-in
 Map<String,String> getMetaProviderMap()
          The storage mechanism for a plugin to know what ISolutionFileMetaProvider class should be used for a particular content type.
 List<org.pentaho.ui.xul.XulOverlay> getOverlays()
          Returns a list of overlays for this plug-in
 Collection<PluginServiceDefinition> getServices()
          Returns the list of the webservices defined by this plugin.
 String getSourceDescription()
          A short description of where this plugin came from, e.g.
 Map<String,String> getStaticResourceMap()
          Returns a list of static resource paths for this plugin-in
 void init()
          Called just prior to the plugin being registered with the platform.
 void init(IPentahoSession session)
          Simplifier for initialization of objects from the PentahoSystem object
 void loaded()
          Called after the plugin has been registered with the platform, i.e.
 void setId(String id)
          Sets the unique id for this plug-in
 void setLifecycleListenerClassname(String lifecycleListenerClassname)
           
 void setLoadertype(IPlatformPlugin.ClassLoaderType loaderType)
           
 void setSourceDescription(String sourceDescription)
           
 void unLoaded()
          Called when the plugin needs to be unloaded.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlatformPlugin

public PlatformPlugin()
Method Detail

init

public void init(IPentahoSession session)
Description copied from interface: IPentahoInitializer
Simplifier for initialization of objects from the PentahoSystem object

Specified by:
init in interface IPentahoInitializer

getLifecycleListenerClassname

public String getLifecycleListenerClassname()
Description copied from interface: IPlatformPlugin
Returns the fully qualified name of the lifecycle listener class defined by this plugin. The class must be a IPluginLifecycleListener.

Specified by:
getLifecycleListenerClassname in interface IPlatformPlugin
Returns:
lifecycle listener class name

setLifecycleListenerClassname

public void setLifecycleListenerClassname(String lifecycleListenerClassname)

getContentGenerators

public List<IContentGeneratorInfo> getContentGenerators()
Description copied from interface: IPlatformPlugin
Returns the list of content generators for this plug-in

Specified by:
getContentGenerators in interface IPlatformPlugin
Returns:

getContentInfos

public List<IContentInfo> getContentInfos()
Description copied from interface: IPlatformPlugin
Returns a list of content info objects for this plug-in

Specified by:
getContentInfos in interface IPlatformPlugin
Returns:

getId

public String getId()
Description copied from interface: IPlatformPlugin
Returns the unique ID of this plugin

Specified by:
getId in interface IPlatformPlugin
Returns:
the plugin id

getOverlays

public List<org.pentaho.ui.xul.XulOverlay> getOverlays()
Description copied from interface: IPlatformPlugin
Returns a list of overlays for this plug-in

Specified by:
getOverlays in interface IPlatformPlugin
Returns:

setId

public void setId(String id)
Sets the unique id for this plug-in

Parameters:
id -

addInitializer

public void addInitializer(IPentahoInitializer initializer)
Adds an initializer to this plug-in

Parameters:
initializer -

addContentGenerator

public void addContentGenerator(IContentGeneratorInfo contentGenerator)
Adds a content generator to this plug-in

Parameters:
contentGenerator -

addContentInfo

public void addContentInfo(IContentInfo contentInfo)
Adds a content info type to this plug-in

Parameters:
contentInfo -

addOverlay

public void addOverlay(org.pentaho.ui.xul.XulOverlay overlay)
Adds an overlay to this plug-in

Parameters:
overlay -

getMenuCustomizations

public List<?> getMenuCustomizations()
Description copied from interface: IPlatformPlugin
Returns a list of menu overlays for this plug-in

Specified by:
getMenuCustomizations in interface IPlatformPlugin
Returns:

addMenuCustomization

public void addMenuCustomization(org.pentaho.ui.xul.IMenuCustomization customization)

getSourceDescription

public String getSourceDescription()
Description copied from interface: IPlatformPlugin
A short description of where this plugin came from, e.g. "biserver/solutions/pluginA"

Specified by:
getSourceDescription in interface IPlatformPlugin
Returns:

setSourceDescription

public void setSourceDescription(String sourceDescription)

addStaticResourcePath

public void addStaticResourcePath(String url,
                                  String localFolder)

getStaticResourceMap

public Map<String,String> getStaticResourceMap()
Description copied from interface: IPlatformPlugin
Returns a list of static resource paths for this plugin-in

Specified by:
getStaticResourceMap in interface IPlatformPlugin

getBeans

public Collection<PluginBeanDefinition> getBeans()
Description copied from interface: IPlatformPlugin
Returns a list of bean configurations for this plugin-in

Specified by:
getBeans in interface IPlatformPlugin

getServices

public Collection<PluginServiceDefinition> getServices()
Description copied from interface: IPlatformPlugin
Returns the list of the webservices defined by this plugin.

Specified by:
getServices in interface IPlatformPlugin
Returns:
the definitions of the webservices for this plugin

addBean

public void addBean(PluginBeanDefinition beanDefinition)

addWebservice

public void addWebservice(PluginServiceDefinition serviceDefinition)

init

public void init()
          throws PluginLifecycleException
Description copied from interface: IPluginLifecycleListener
Called just prior to the plugin being registered with the platform. Note: This event does *not* precede the detection of the plugin by any IPluginProviders

Specified by:
init in interface IPlatformPlugin
Specified by:
init in interface IPluginLifecycleListener
Throws:
PluginLifecycleException - if an error occurred

loaded

public void loaded()
            throws PluginLifecycleException
Description copied from interface: IPluginLifecycleListener
Called after the plugin has been registered with the platform, i.e. all content generators, components, etc. have been loaded.

Specified by:
loaded in interface IPlatformPlugin
Specified by:
loaded in interface IPluginLifecycleListener
Throws:
PluginLifecycleException - if an error occurred

unLoaded

public void unLoaded()
              throws PluginLifecycleException
Description copied from interface: IPluginLifecycleListener
Called when the plugin needs to be unloaded. This method should release all resources and return things to a pre-loaded state.

Specified by:
unLoaded in interface IPlatformPlugin
Specified by:
unLoaded in interface IPluginLifecycleListener
Throws:
PluginLifecycleException - if an error occurred

addLifecycleListener

public void addLifecycleListener(IPluginLifecycleListener listener)
Description copied from interface: IPlatformPlugin
Registers a lifecycle listener with this plugin. This listener will be notified when lifecycle events occur on this plugin.

Specified by:
addLifecycleListener in interface IPlatformPlugin
Parameters:
listener - a lifecycle listener

getMetaProviderMap

public Map<String,String> getMetaProviderMap()
Description copied from interface: IPlatformPlugin
The storage mechanism for a plugin to know what ISolutionFileMetaProvider class should be used for a particular content type.

Specified by:
getMetaProviderMap in interface IPlatformPlugin
Returns:
a map of content types (extensions) keys and ISolutionFileMetaProvider (or deprecated IFileInfoGenerator) classnames for values

getLoaderType

public IPlatformPlugin.ClassLoaderType getLoaderType()
Description copied from interface: IPlatformPlugin
Indicates what kind of classloader should be used to load classes and resources from this plugin. The default classloader type is no more than an extension of URLClassLoader.

Specified by:
getLoaderType in interface IPlatformPlugin
Returns:
the type of classloader to use for this plugin
See Also:
IPlatformPlugin.ClassLoaderType

setLoadertype

public void setLoadertype(IPlatformPlugin.ClassLoaderType loaderType)

addExternalResource

public void addExternalResource(String context,
                                String resource)

getExternalResourcesForContext

public List<String> getExternalResourcesForContext(String context)
Description copied from interface: IPlatformPlugin
Return a List of scripts registered for a given context.

Specified by:
getExternalResourcesForContext in interface IPlatformPlugin
Parameters:
context - named area in the platform
Returns:
list of registered scripts