View Javadoc

1   /*
2    * Copyright 2003,2004 The Apache Software Foundation.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.apache.pluto.invoker;
17  
18  import java.io.IOException;
19  
20  import javax.portlet.ActionRequest;
21  import javax.portlet.ActionResponse;
22  import javax.portlet.PortletException;
23  import javax.portlet.PortletRequest;
24  import javax.portlet.RenderRequest;
25  import javax.portlet.RenderResponse;
26  
27  /***
28   * This interface defines the operations required by the Pluto container in order to invoke portlets.
29   * Portlet invokers are defined by three operations: <code>action</code>, <code>render</code>, and optionally
30   * <code>load</code>. The container delegates the actual implementation of these operations to the 
31   * portal. The <code>action</code> method will invoke the <code>processAction</code> method on 
32   * the <code>javax.portlet.Portlet</code> interface of a portlet. The <code>render</code> method 
33   * will invoke the <code>render</code> method on the <code>javax.portlet.Portlet</code> interface of a portlet.
34   * 
35   * @version $Id: PortletInvoker.java 35916 2004-03-02 14:55:19Z cziegeler $
36   */
37  public interface PortletInvoker 
38  {
39  
40      /***
41       * This method invokes the processAction method of a Java portlet (<code>javax.portlet.Portlet</code>).
42       * 
43       * @param request Represents the request sent to a portlet to handle an action. 
44       * @param response Represents the response provide by a portlet in handling an action.
45       * @throws PortletException
46       * @throws IOException
47       */
48      public void action(ActionRequest request, ActionResponse response) throws PortletException,IOException;
49  
50      /***
51       * This method invokes the render method of a Java portlet (<code>javax.portlet.Portlet</code>).
52       * 
53       * @param request Represents the request sent to a portlet to handle rendering the portlet.
54       * @param response Represents the response provide by a portlet in rendering.
55       * @throws PortletException
56       * @throws IOException
57       */
58      public void render(RenderRequest request, RenderResponse response) throws PortletException, IOException;
59      
60      /***
61       * This method invokes the optional load method of a portlet if supported.
62       * This method is not yet standardized.
63       * 
64       * @param request Represents the request sent to a portlet to handle initializing the portlet.
65       * @param response Represents the response sent to a portlet to handle initializing the portlet.
66       * @throws PortletException
67       */
68      public void load(PortletRequest request, RenderResponse response) throws PortletException;
69  }