View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    * 
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   * 
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package org.apache.jetspeed.container.invoker;
18  
19  import javax.servlet.ServletConfig;
20  
21  import org.apache.jetspeed.factory.PortletFactory;
22  import org.apache.pluto.invoker.PortletInvoker;
23  import org.apache.pluto.om.portlet.PortletDefinition;
24  
25  /***
26   * JetspeedPortletInvoker extends Pluto's portlet invoker and extends it
27   * with lifecycle management. Portlet Invokers can be pooled, and activated
28   * and passivated per request cycle.
29   *
30   * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
31   * @version $Id: JetspeedPortletInvoker.java 516448 2007-03-09 16:25:47Z ate $
32   */
33  public interface JetspeedPortletInvoker extends PortletInvoker
34  {
35      /***
36       * Activating an invoker makes it ready to invoke portlets.
37       * If an invoker's state is not activated, it can not invoke.
38       * 
39       * @param portletFactory The factory to get access to the portlet being invoked.
40       * @param portletDefinition The portlet's definition that is being invoked.
41       * @param servletConfig The servlet configuration of the portal. 
42       * @param containerServlet
43       */
44      void activate(PortletFactory portletFactory, PortletDefinition portletDefinition, ServletConfig servletConfig);
45  
46      /***
47       * Activating an invoker makes it ready to invoke portlets.
48       * If an invoker's state is not activated, it can not invoke.
49       * This second signature allows for activating with an extra property.
50       * 
51       * @param portletFactory The factory to get access to the portlet being invoked.
52       * @param portletDefinition The portlet's definition that is being invoked.
53       * @param servletConfig The servlet configuration of the portal. 
54       * @param property Implementation specific property
55       * @param containerServlet
56       */
57      void activate(PortletFactory portletFactory, PortletDefinition portletDefinition, ServletConfig servletConfig, String property);
58      
59      /***
60       * Passivates an invoker, freeing it back to the invoker pool.
61       * If an invoker's state is passivated, it cannot be used to invoke portlets.
62       */
63      void passivate();
64      
65      /***
66       * Returns true if the state of this invoke is 'activated', and false if it is 'passivated'.
67       * @return True if the current state of the invoker is 'activated' otherwise false.
68       */
69      boolean isActivated();
70  }