com.ibm.commerce.struts

Class ComponentPlugIn

  • java.lang.Object
    • com.ibm.commerce.struts.ComponentPlugIn
  • All Implemented Interfaces:
    org.apache.struts.action.PlugIn


    public class ComponentPlugIn
    extends java.lang.Object
    implements org.apache.struts.action.PlugIn
    The component plug-in is used to declare the class name of a component client facade and associate it with an ID that can be used to in the declaration of action mappings.

    The following example demonstrates a possible component client facade configuration:

     <plug-in className="com.ibm.commerce.struts.ComponentPlugIn">
       <set-property property="componentId" value="order"/>
       <set-property property="clientFacadeClassName" value="com.ibm.commerce.order.facade.client.OrderFacadeClient"/>
     </plug-in>
     
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      IBM copyright notice field.
    • Constructor Summary

      Constructors 
      Constructor and Description
      ComponentPlugIn()
      Construct new instance of component plug-in.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void destroy()
      Destroy plug-in instance.
      java.lang.String getClientFacadeClassName()
      Get the component client facade class name.
      java.lang.String getComponentId()
      Get the component ID.
      void init(org.apache.struts.action.ActionServlet actionServlet, org.apache.struts.config.ModuleConfig moduleConfig)
      Initialize component plug-in.
      static java.util.Map invokeComponentService(com.ibm.commerce.webcontroller.RequestHandle handle, java.util.Map inMap, java.lang.String componentService)
      Inovoke the specified component service.
      java.util.Map invokeService(com.ibm.commerce.webcontroller.RequestHandle handle, java.util.Map inMap, java.lang.String methodName)
      Invoke the component client facade method with the specified method name.
      void setClientFacadeClassName(java.lang.String clientFacadeClassName)
      Set the client facade class name.
      void setComponentId(java.lang.String componentId)
      Set the component ID.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM copyright notice field.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ComponentPlugIn

        public ComponentPlugIn()
        Construct new instance of component plug-in.
    • Method Detail

      • destroy

        public void destroy()
        Destroy plug-in instance.
        Specified by:
        destroy in interface org.apache.struts.action.PlugIn
        See Also:
        PlugIn.destroy()
      • init

        public void init(org.apache.struts.action.ActionServlet actionServlet,
                         org.apache.struts.config.ModuleConfig moduleConfig)
                  throws javax.servlet.ServletException
        Initialize component plug-in.
        Specified by:
        init in interface org.apache.struts.action.PlugIn
        Throws:
        javax.servlet.ServletException
        See Also:
        PlugIn.init(org.apache.struts.action.ActionServlet, org.apache.struts.config.ModuleConfig)
      • setComponentId

        public void setComponentId(java.lang.String componentId)
        Set the component ID. This ID can be used to configure component service actions.
        Parameters:
        componentId - component ID
      • getComponentId

        public java.lang.String getComponentId()
        Get the component ID.
        Returns:
        the component ID
      • setClientFacadeClassName

        public void setClientFacadeClassName(java.lang.String clientFacadeClassName)
        Set the client facade class name. This must be the fully qualified class name of the component client facade being configured.
        Parameters:
        clientFacadeClassName - client facade class name
      • getClientFacadeClassName

        public java.lang.String getClientFacadeClassName()
        Get the component client facade class name.
        Returns:
        the client facade class name
      • invokeService

        public java.util.Map invokeService(com.ibm.commerce.webcontroller.RequestHandle handle,
                                           java.util.Map inMap,
                                           java.lang.String methodName)
                                    throws com.ibm.commerce.webcontroller.exception.RequestException
        Invoke the component client facade method with the specified method name.
        Parameters:
        handle - request handle
        inMap - input parameters
        methodName - client facade method name
        Returns:
        response Map
        Throws:
        com.ibm.commerce.webcontroller.exception.RequestException
      • invokeComponentService

        public static java.util.Map invokeComponentService(com.ibm.commerce.webcontroller.RequestHandle handle,
                                                           java.util.Map inMap,
                                                           java.lang.String componentService)
                                                    throws com.ibm.commerce.webcontroller.exception.RequestException
        Inovoke the specified component service. The component service is of the form "id.methodName" where "id" is the component ID and "methodName" is the component service method.
        Parameters:
        handle - request handle
        inMap - input parameters
        componentService - component service
        Returns:
        response map
        Throws:
        com.ibm.commerce.webcontroller.exception.RequestException