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.factory;
17  
18  import org.apache.pluto.om.portlet.PortletDefinition;
19  import org.apache.pluto.invoker.PortletInvoker;
20  
21  /***
22   * <p>
23   * Portlet Invoker Factory creates portlet invokers based on the servlet context.
24   * This class is part of the contract between Pluto and the portal implementations as defined
25   * in the interfaces under <code>org.apache.pluto.factory</code>
26   * The Pluto container uses portlet invokers to abstract access to portlets.
27   * An invoker interfaces defines which actions are performed between the portal and container,
28   * namely action, render and optionally load. Portlet invoker factories are implemented by
29   * the portal implementation. The Pluto container uses pluggable portlet invoker factories
30   * in order to get portlet invokers, and then invoke methods on portlets (render, action, load). 
31   * </p>
32   * <p>
33   * The Portlet Invoker Factory is a Pluto factory. Pluto defines a basic lifecycle for Pluto
34   * factory services in the <code>org.apach.pluto.factory.Factory</code> interface with
35   * standard <code>init</code> and <code>destroy</code> methods.
36   * </p>
37   * 
38   * @version $Id: PortletInvokerFactory.java 35916 2004-03-02 14:55:19Z cziegeler $
39   */
40  
41  public interface PortletInvokerFactory extends Factory 
42  {
43      /***
44       * The container calls this method to get a portlet invoker from the portal.
45       * With this abstraction, the portal should handle optional pooling of invokers.
46       *  
47       * @param portletDefinition The portlet definition describing the portlet to be invoked.
48       * @return A portlet invoker ready to invoke portlets.
49       */
50      PortletInvoker getPortletInvoker(PortletDefinition portletDefinition);
51      
52      /***
53       * The container calls this method to release a portlet invoker back to the portal, indicating
54       * that the container is done with the invoker. At this time, the invoker could be released
55       * to an object pool.
56       * 
57       * @param invoker The portlet invoker ready to be released.
58       */
59      void releasePortletInvoker(PortletInvoker invoker);
60  }