com.ibm.ecm.extension

Class PluginAPI

  1. java.lang.Object
  2. extended bycom.ibm.ecm.extension.PluginAPI

  1. public abstract class PluginAPI
  2. extends java.lang.Object
Provides an abstract class that is extended to create a class implementing an API provided by the plug-in. A plug-in API can be invoked from other plug-ins, allowing one plug-in to provide services that another plug-in service can use. A plug-in API is similar to a plug-in service, receiving an instance of PluginServiceCallbacks and the original HttpServletRequest object, allowing access to any session state and underlying APIs.

Follow best practices for servlets when implementing a plug-in API. In particular, always assume multi-threaded use and do not keep unshared information in instance variables.
Since:
2.0.3

Constructor Summary

Constructor and Description
PluginAPI()

Method Summary

Modifier and Type Method and Description
  1. abstract
  2. java.lang.Object
execute(PluginServiceCallbacks callbacks,javax.servlet.http.HttpServletRequest request,java.lang.Object[] arguments)
Performs the action of this API.
  1. abstract
  2. java.lang.String
getId()
Returns the unique identifier for this API.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PluginAPI

  1. public PluginAPI()

Method Detail

getId

  1. public abstract java.lang.String getId( )
Returns the unique identifier for this API.
Returns:
A String that is used to identify the API.

execute

  1. public abstract java.lang.Object execute( PluginServiceCallbacks callbacks,
  2. javax.servlet.http.HttpServletRequest request,
  3. java.lang.Object[] arguments)
  4. throws java.lang.Exception
Performs the action of this API.
Parameters:
callbacks - An instance of the PluginServiceCallbacks class that contains several functions that can be used by the plug-in API. These functions provide access to the plug-in configuration and content server APIs.
request - The HttpServletRequest from the current request being processed. The service can access the invocation parameters from the request as well as session state.
arguments - An object array containing the input arguments to the API. The particular structure of these object is defined by the plug-in API writer. The classes of the objects used as arguments should be J2SE classes or instances of com.ibm.ecm.json as any plug-in specific classes will be loaded by different classloaders causing class cast exceptions when attempting to pass instances from one plug-in to another.
Throws:
java.lang.Exception - For exceptions that occur when the API is running. If the logging level is high enough to log errors, information about the exception is logged by IBM Content Navigator.