You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-scm@portals.apache.org by ms...@apache.org on 2014/11/25 13:50:22 UTC

[17/19] portals-pluto git commit: Moved the portlet spec 2 API classes into the Pluto project in preparation for prototyping the Partial Action sequence. The Partial Action implementation will require an update to the ResourceRequest class in order to ma

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/f0a1530f/portlet-api_2.0_spec/LICENSE
----------------------------------------------------------------------
diff --git a/portlet-api_2.0_spec/LICENSE b/portlet-api_2.0_spec/LICENSE
new file mode 100644
index 0000000..d645695
--- /dev/null
+++ b/portlet-api_2.0_spec/LICENSE
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/f0a1530f/portlet-api_2.0_spec/NOTICE
----------------------------------------------------------------------
diff --git a/portlet-api_2.0_spec/NOTICE b/portlet-api_2.0_spec/NOTICE
new file mode 100644
index 0000000..76aa882
--- /dev/null
+++ b/portlet-api_2.0_spec/NOTICE
@@ -0,0 +1,11 @@
+
+Java Portlet Specification V2.0
+Copyright 2004-2009 Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+
+Original code
+� Copyright IBM Corp. 2006, 2007
+All rights reserved.

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/f0a1530f/portlet-api_2.0_spec/pom.xml
----------------------------------------------------------------------
diff --git a/portlet-api_2.0_spec/pom.xml b/portlet-api_2.0_spec/pom.xml
new file mode 100644
index 0000000..ed01ebf
--- /dev/null
+++ b/portlet-api_2.0_spec/pom.xml
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+  
+  $Id: pom.xml 774158 2009-05-13 00:42:04Z ate $
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.portals.pluto</groupId>
+    <artifactId>pluto</artifactId>
+    <version>2.1.0-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>portlet-api_2.0_spec</artifactId>
+  <packaging>bundle</packaging>
+  <name>Java Portlet Specification V2.0</name>
+  <description>The Java Portlet API version 2.0 developed by the Java Community Process JSR-286 Expert Group.</description>
+
+  <url>http://portals.apache.org/portlet-spec/portlet-api-2.0</url>
+
+  <dependencies>
+    <dependency>
+      <groupId>javax.servlet</groupId>
+      <artifactId>servlet-api</artifactId>
+      <scope>provided</scope>
+    </dependency>
+  </dependencies>
+
+  <scm>
+    <connection>scm:svn:http://svn.apache.org/repos/asf/portals/portlet-spec/trunk/portlet-api_2.0_spec</connection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/portals/portlet-spec/trunk/portlet-api_2.0_spec</developerConnection>
+    <url>http://svn.apache.org/viewvc/portals/portlet-spec/trunk/portlet-api_2.0_spec</url>
+  </scm>
+
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-compiler-plugin</artifactId>
+          <configuration>
+            <source>1.5</source>
+            <target>1.5</target>
+          </configuration>
+        </plugin>
+        <plugin>
+          <groupId>org.apache.felix</groupId>
+          <artifactId>maven-bundle-plugin</artifactId>
+          <version>2.0.0</version>
+          <extensions>true</extensions>
+          <configuration>
+            <instructions>
+              <Export-Package>javax.portlet.filter;version=2.0.0,
+                javax.portlet;version=2.0.0
+              </Export-Package>
+              <Import-Package>
+                javax.servlet.http;version=2.4,*
+              </Import-Package>
+              <Implementation-Title>${project.name}</Implementation-Title>
+              <Implementation-Version>${project.version}</Implementation-Version>
+              <Bundle-DocURL>${project.url}</Bundle-DocURL>
+            </instructions>
+          </configuration>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+
+    <plugins>
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+      </plugin>
+    </plugins>
+  </build>
+  
+</project>
+
+

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/f0a1530f/portlet-api_2.0_spec/src/main/appended-resources/META-INF/NOTICE.vm
----------------------------------------------------------------------
diff --git a/portlet-api_2.0_spec/src/main/appended-resources/META-INF/NOTICE.vm b/portlet-api_2.0_spec/src/main/appended-resources/META-INF/NOTICE.vm
new file mode 100644
index 0000000..0b24114
--- /dev/null
+++ b/portlet-api_2.0_spec/src/main/appended-resources/META-INF/NOTICE.vm
@@ -0,0 +1,3 @@
+Original code
+� Copyright IBM Corp. 2006, 2007
+All rights reserved.

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/f0a1530f/portlet-api_2.0_spec/src/main/java/javax/portlet/ActionRequest.java
----------------------------------------------------------------------
diff --git a/portlet-api_2.0_spec/src/main/java/javax/portlet/ActionRequest.java b/portlet-api_2.0_spec/src/main/java/javax/portlet/ActionRequest.java
new file mode 100644
index 0000000..4400d77
--- /dev/null
+++ b/portlet-api_2.0_spec/src/main/java/javax/portlet/ActionRequest.java
@@ -0,0 +1,48 @@
+/*  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet;
+
+
+/**
+ * The <CODE>ActionRequest</CODE> represents the request sent to the portlet
+ * to handle an action.<br>
+ * It extends the ClientDataRequest interface and provides action request
+ * information to portlets.
+ * <p>
+ * The portlet container creates an <CODE>ActionRequest</CODE> object and
+ * passes it as argument to the portlet's <CODE>processAction</CODE> method.
+ * 
+ * @see ClientDataRequest
+ */
+public interface ActionRequest extends ClientDataRequest
+{
+	/**
+	 * Predefined action name for usage with the
+	 * <code>@ProcessAction</code> annotation.
+	 * 
+	 * @since 2.0
+	 */
+	public static final String ACTION_NAME = "javax.portlet.action";
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/f0a1530f/portlet-api_2.0_spec/src/main/java/javax/portlet/ActionResponse.java
----------------------------------------------------------------------
diff --git a/portlet-api_2.0_spec/src/main/java/javax/portlet/ActionResponse.java b/portlet-api_2.0_spec/src/main/java/javax/portlet/ActionResponse.java
new file mode 100644
index 0000000..3d617fb
--- /dev/null
+++ b/portlet-api_2.0_spec/src/main/java/javax/portlet/ActionResponse.java
@@ -0,0 +1,123 @@
+/*  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet;
+
+
+/**
+ * The <CODE>ActionResponse</CODE> interface represents the portlet
+ * response to an action request.
+ * It extends the <CODE>StateAwareResponse</CODE> interface to provide specific 
+ * action response functionality to portlets.<br>
+ * The portlet container creates an <CODE>ActionResponse</CODE> object and 
+ * passes it as argument to the portlet's <CODE>processAction</CODE> method.
+ * 
+ * @see StateAwareResponse 
+ * @see PortletResponse
+ * @see ActionRequest
+ */
+public interface ActionResponse extends StateAwareResponse
+{
+
+  /**
+   * Instructs the portlet container to send a redirect response 
+   * to the client using the specified redirect location URL.  
+   * <p>
+   * This method only accepts an absolute URL (e.g. 
+   * <code>http://my.co/myportal/mywebap/myfolder/myresource.gif</code>)
+   * or a full path URI (e.g. <code>/myportal/mywebap/myfolder/myresource.gif</code>).
+   * If required, 
+   * the portlet container may encode the given URL before the 
+   * redirection is issued to the client.
+   * <p>
+   * The sendRedirect method can not be invoked after any of the 
+   * following methods of the ActionResponse interface has been called:
+   * <ul>
+   * <li>setPortletMode</li>
+   * <li>setWindowState</li>
+   * <li>setRenderParameter</li>
+   * <li>setRenderParameters</li>
+   * <li>removePublicRenderParamter</li>
+   * </ul>
+   *
+   * @param		location	the redirect location URL
+   *
+   * @exception	java.io.IOException	
+   *                    if an input or output exception occurs.
+   * @exception	java.lang.IllegalArgumentException	
+   *                    if a relative path URL is given
+   * @exception java.lang.IllegalStateException
+   *                    if the method is invoked after any of above mentioned methods of 
+   *                    the ActionResponse interface has been called.
+   */
+
+  public void sendRedirect(String location)
+    throws java.io.IOException; 
+
+  /**
+   * Instructs the portlet container to send a redirect response 
+   * to the client using the specified redirect location URL and
+   * encode a render URL as parameter on the redirect URL.  
+   * <p>
+   * This method only accepts an absolute URL (e.g. 
+   * <code>http://my.co/myportal/mywebap/myfolder/myresource.gif</code>)
+   * or a full path URI (e.g. <code>/myportal/mywebap/myfolder/myresource.gif</code>).
+   * If required, 
+   * the portlet container may encode the given URL before the 
+   * redirection is issued to the client.
+   * <p>
+   * The portlet container will attach a render URL with the currently set portlet mode, window state
+   * and render parameters on the <code>ActionResponse</code> and the current public render parameters. 
+   * The attached URL will be available as query parameter value under the key provided with the 
+   * <code>renderUrlParamName</code> parameter.
+   * <p>
+   * New values for
+   * <ul>
+   * <li>setPortletMode
+   * <li>setWindowState
+   * <li>setRenderParameter
+   * <li>setRenderParameters
+   * </ul>
+   * are only used for creating the render URL and not remembered after the redirect
+   * is issued. 
+   *
+   * @param		location	the redirect location URL
+   * @param     renderUrlParamName	name of the query parameter under which the portlet container should
+   *                                store a render URL to this portlet
+   *                                
+   * @exception	java.io.IOException	
+   *                    if an input or output exception occurs.
+   * @exception	java.lang.IllegalArgumentException	
+   *                    if a relative path URL is given
+   *                    
+   * @since 2.0
+   */
+
+  public void sendRedirect(String location, String renderUrlParamName)
+    throws java.io.IOException; 
+}
+
+
+
+

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/f0a1530f/portlet-api_2.0_spec/src/main/java/javax/portlet/BaseURL.java
----------------------------------------------------------------------
diff --git a/portlet-api_2.0_spec/src/main/java/javax/portlet/BaseURL.java b/portlet-api_2.0_spec/src/main/java/javax/portlet/BaseURL.java
new file mode 100644
index 0000000..025e2c2
--- /dev/null
+++ b/portlet-api_2.0_spec/src/main/java/javax/portlet/BaseURL.java
@@ -0,0 +1,251 @@
+/*  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet;
+
+/**
+ * The <CODE>BaseURL</CODE> defines the basic capabilities
+ * of a portlet URL pointing back to the portlet.
+ *
+ * @since 2.0
+ */
+public interface BaseURL {
+
+    /**
+     * Sets the given String parameter to this URL. 
+     * <p>
+     * This method replaces all parameters with the given key.
+     * <p>
+     * The <code>PortletURL</code> implementation 'x-www-form-urlencoded' encodes
+     * all  parameter names and values. Developers should not encode them.
+     * <p>
+     * A portlet container may prefix the attribute names internally 
+     * in order to preserve a unique namespace for the portlet.
+     * <p>
+     * A parameter value of <code>null</code> indicates that this
+     * parameter should be removed.
+     *
+     * @param   name
+     *          the parameter name
+     * @param   value
+     *          the parameter value
+     *
+     * @exception  java.lang.IllegalArgumentException 
+     *                            if name is <code>null</code>.
+     */
+
+    public void setParameter (String name, String value);
+
+
+    /**
+     * Sets the given String array parameter to this URL. 
+     * <p>
+     * This method replaces all parameters with the given key.
+     * <p>
+     * The <code>PortletURL</code> implementation 'x-www-form-urlencoded' encodes
+     * all  parameter names and values. Developers should not encode them.
+     * <p>
+     * A portlet container may prefix the attribute names internally 
+     * in order to preserve a unique namespace for the portlet.
+     *
+     * @param   name
+     *          the parameter name
+     * @param   values
+     *          the parameter values
+     *
+     * @exception  java.lang.IllegalArgumentException 
+     *                            if name is <code>null</code>.
+     */
+
+    public void setParameter (String name, String[] values);
+
+
+    /**
+     * Sets a parameter map for this URL.
+     * <p>
+     * All previously set parameters are cleared.
+     * <p>
+     * The <code>PortletURL</code> implementation 'x-www-form-urlencoded' encodes
+     * all  parameter names and values. Developers should not encode them.
+     * <p>
+     * A portlet container may prefix the attribute names internally, 
+     * in order to preserve a unique namespace for the portlet.
+     *
+     * @param  parameters   Map containing parameter names for 
+     *                      the render phase as 
+     *                      keys and parameter values as map 
+     *                      values. The keys in the parameter
+     *                      map must be of type String. The values 
+     *                      in the parameter map must be of type
+     *                      String array (<code>String[]</code>).
+     *
+     * @exception   java.lang.IllegalArgumentException 
+     *                      if parameters is <code>null</code>, if
+     *                      any of the keys in the Map are <code>null</code>, 
+     *                      if any of the keys is not a String, or if any of 
+     *                      the values is not a String array.
+     */
+
+    public void setParameters(java.util.Map<String, String[]> parameters);
+
+
+    /**
+     * Indicated the security setting for this URL. 
+     * <p>
+     * Secure set to <code>true</code> indicates that the portlet requests
+     * a secure connection between the client and the portlet window for
+     * this URL. Secure set to <code>false</code> indicates that the portlet 
+     * does not need a secure connection for this URL. If the security is not
+     * set for a URL, it should stay the same as the current request. 
+     *
+     * @param  secure  true, if portlet requests to have a secure connection
+     *                 between its portlet window and the client; false, if
+     *                 the portlet does not require a secure connection.
+     *
+     * @throws PortletSecurityException  if the run-time environment does
+     *                                   not support the indicated setting
+     */
+
+    public void setSecure (boolean secure) throws PortletSecurityException;
+
+    /**
+     * Returns the portlet URL string representation to be embedded in the
+     * markup.<br>
+     * Note that the returned String may not be a valid URL, as it may
+     * be rewritten by the portal/portlet-container before returning the 
+     * markup to the client.
+     * <p>
+     * The returned URL is not XML escaped.
+     * <p>
+     * For writing URLs to an output stream the {@link #write(java.io.Writer)} or 
+     * {@link #write(java.io.Writer, boolean)} method should be used as these are
+     * more efficient.
+     * 
+     * @return   the encoded URL as a string
+     */
+
+    public String toString ();
+    
+    /** 
+     * Returns a <code>Map</code> of the parameters 
+     * currently set on this portlet URL via the 
+     * <code>setParameter</code> or <code>setParameters</code>
+     * methods.
+     * <p>
+     * The values in the returned <code>Map</code> are from type
+     * String array (<code>String[]</code>).
+     * <p>
+     * If no parameters exist this method returns an empty <code>Map</code>.
+     *             
+     * @return     <code>Map</code> containing parameter names as 
+     *             keys and parameter values as map values, or an empty <code>Map</code>
+     *             if no parameters exist. The keys in the parameter
+     *             map are of type String. The values in the parameter map are of type
+     *             String array (<code>String[]</code>).
+     *
+     * @since 2.0
+     */
+
+    public java.util.Map<String, String[]> getParameterMap();
+
+    /**
+     * Writes the portlet URL to the output stream using the provided writer.
+     * <p>
+     * Note that the URL written to the output stream may not be a valid URL, as it may
+     * be rewritten by the portal/portlet-container before returning the 
+     * markup to the client.
+     * <p>
+     * The URL written to the output stream is always XML escaped. For writing
+     * non-escaped URLs use {@link #write(java.io.Writer, boolean)}.
+     *  
+     * @param out  the writer to write the portlet URL to
+     * @throws java.io.IOException  if an I/O error occured while writing the URL
+     *
+     * @since 2.0
+     */
+    public void write(java.io.Writer out) throws java.io.IOException;
+    
+    /**
+     * Writes the portlet URL to the output stream using the provided writer.
+     * If the parameter escapeXML is set to true the URL will be escaped to be
+     * valid XML characters, i.e. &lt, &gt, &amp, &#039, &#034 will get converted
+     * into their corresponding character entity codes (&lt to &&lt, &gt to &&gt, 
+     * &amp to &&amp, &#039 to &&#039, &#034 to &&#034).
+     * If escapeXML is set to false no escaping will be done.
+     * <p>
+     * Note that the URL written to the output stream may not be a valid URL, as it may
+     * be rewritten by the portal/portlet-container before returning the 
+     * markup to the client.
+     *  
+     * @param out       the writer to write the portlet URL to
+     * @param escapeXML denotes if the URL should be XML escaped before written to the output
+     *                  stream or not
+     * @throws java.io.IOException  if an I/O error occurred while writing the URL
+     *
+     * @since 2.0
+     */
+     public void write(java.io.Writer out, boolean escapeXML) throws java.io.IOException;
+
+    
+    /**
+     * Adds a String property to an existing key on the URL.
+     * <p>
+     * This method allows URL properties to have multiple values.
+     * <p>
+     * Properties can be used by portlets to provide vendor specific information
+     * to the URL.
+     *
+     * @param key
+     *            the key of the property
+     * @param value
+     *            the value of the property
+     *
+     * @exception java.lang.IllegalArgumentException
+     *                if key is <code>null</code>.
+     *
+     * @since 2.0
+     */
+    public void addProperty(String key, String value);
+
+
+    /**
+     * Sets a String property on the URL.
+     * <p>
+     * Properties can be used by portlets to provide vendor specific information
+     * to the URL.
+     * <p>
+     * This method resets all properties previously added with the same key.
+     *
+     * @param key
+     *            the key of the property
+     * @param value
+     *            the value of the property
+     *
+     * @exception java.lang.IllegalArgumentException
+     *                if key is <code>null</code>.
+     *
+     * @since 2.0
+     */
+    public void setProperty(String key, String value);
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/f0a1530f/portlet-api_2.0_spec/src/main/java/javax/portlet/CacheControl.java
----------------------------------------------------------------------
diff --git a/portlet-api_2.0_spec/src/main/java/javax/portlet/CacheControl.java b/portlet-api_2.0_spec/src/main/java/javax/portlet/CacheControl.java
new file mode 100644
index 0000000..c25b88b
--- /dev/null
+++ b/portlet-api_2.0_spec/src/main/java/javax/portlet/CacheControl.java
@@ -0,0 +1,166 @@
+/*  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet;
+
+/**
+ * The <code>CacheControl</code> interface represents cache settings
+ * for a piece of markup. The settings are only valid for the current
+ * request.
+ *
+ * @since 2.0
+ */
+public interface CacheControl {
+
+    /**
+     * Get the currently set expiration time.
+     * If no expiration time is set on this response the
+     * default defined in the portlet deployment descriptor
+     * with the <code>expiration-cache<code> tag is returned,
+     * or <code>0</code> if no default is defined.
+     * <p>
+     * This call returns the same value as the
+     * <code>getProperty(EXPIRATION_CACHE)</code>
+     * call.
+     * 
+     * @return  the currently set expiration time in seconds,
+     *          or <code>0</code> if no expiration time
+     *          is set.
+     */
+    public int getExpirationTime();
+    
+    /**
+     * Sets a new expiration time for the current response
+     * in seconds.
+     * <p>
+     * If the expiration value is set to 0, caching is disabled for this
+     * portlet; if the value is set to -1, the cache does not expire.
+     * <p>
+     * This call is equivalent to calling
+     * <code>setProperty(EXPIRATION_CACHE)</code>.
+     * 
+     * @param time  expiration time in seconds
+     */
+    public void setExpirationTime(int time);
+    
+    
+    /**
+     * Returns a boolean indicating whether the
+     * caching scope is set to public for the current response.
+     * If no caching scope is set on this response, the default 
+     * defined in the deployment descriptor with the
+     * <code>cache-scope</code> tag is returned,
+ 	 * or <code>false</code> if no default is defined.
+     * <p>
+     * Public cache scope indicates that the cache entry can be shared across
+     * users. Non-public, or private cache scope indicates that the cache entry
+     * must not be shared across users.
+     * <p>
+     * This call is equivalent to calling
+     * <code>getProperty(CACHE_SCOPE).equals(PUBLIC_SCOPE)</code>.
+     * 
+     * @return true if the cache scope is public for the
+     *         current response.
+     */
+    public boolean isPublicScope();
+    
+    /**
+     * Sets the caching scope for the current response
+     * to public with <code>true</code> as 
+     * <code>publicScope</code> and to private with
+     * <code>false</code> as <code>publicScope</code>.
+     * <p>
+     * Public cache scope indicates that the cache entry can be shared across
+     * users. Non-public, or private cache scope indicates that the cache entry 
+     * must not be shared across users.
+     * <p>
+     * This call is equivalent to calling
+     * <code>(publicScope ? setProperty(CACHE_SCOPE, PUBLIC_SCOPE | 
+     *        setProperty(CACHE_SCOPE, PRIVATE_SCOPE)</code>.
+     * 
+     * @param publicScope  indicating if the cache entry can be shared across users
+     */
+    public void setPublicScope(boolean publicScope);
+    
+    /**
+     * Returns the ETag for the current response that is
+     * used as validation tag, or <code>null</null>
+     * if no ETag is set on the response.
+     * <p>
+     * This call is equivalent to calling
+     * <code>getProperty(ETAG)</code>.
+     * 
+     * @return  the ETag for the current response that is
+     *          used as validation tag, or <code>null</null>
+     *          if no ETag is set.
+     */
+    public String getETag();
+    
+    /**
+     * Sets an ETag for the current response that is
+     * used as validation tag. If an ETag was already
+     * set it is replaced with the new value.
+     * <p>
+     * This call is equivalent to calling
+     * <code>setProperty(ETAG, token)</code>.
+     * <p>
+     * Setting the ETag to <code>null</code> removes
+     * the currently set ETag.
+     *  
+     * @param token  the ETag token
+     */
+    public void setETag(String token);
+    
+    
+    /**
+     * Returns a boolean indicating whether the
+     * cached content for the provided ETag at the request
+     * can still be considerated valid.
+     * If not set, the default is <code>false</code>.
+     * <p>
+     * This call is equivalent to calling
+     * <code>getProperty(USE_CACHED_CONTENT)</code> and getting a non-null
+     * value back.
+     * 
+     * @return  boolean indicating whether the
+     *          caching scope is set to public for the current response
+     */
+    public boolean useCachedContent();
+    
+    /**
+     * Sets the indication whether the cached content
+     * for the provided ETag at the request is still valid or not.
+     * If set to <code>true</code> no output should be rendered,
+     * but a new expiration time should be set for the
+     * markup with the given ETag . 
+     * <p>
+     * This call is equivalent to calling
+     * <code>setProperty(USE_CACHED_CONTENT, "true")</code>.
+     *        
+     * @param useCachedContent  boolean indication whether the
+     *          the cached content is still valid or not
+     */
+    public void setUseCachedContent(boolean useCachedContent);
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/f0a1530f/portlet-api_2.0_spec/src/main/java/javax/portlet/ClientDataRequest.java
----------------------------------------------------------------------
diff --git a/portlet-api_2.0_spec/src/main/java/javax/portlet/ClientDataRequest.java b/portlet-api_2.0_spec/src/main/java/javax/portlet/ClientDataRequest.java
new file mode 100644
index 0000000..4b837a9
--- /dev/null
+++ b/portlet-api_2.0_spec/src/main/java/javax/portlet/ClientDataRequest.java
@@ -0,0 +1,164 @@
+/*  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet;
+
+/**
+ * The <CODE>ClientDataRequest</CODE> represents the request information 
+ * of the HTTP request issued from the client to the portal.<BR>
+ * It extends the PortletRequest interface.
+ * 
+ * @since 2.0
+ * @see PortletRequest
+ */
+public interface ClientDataRequest extends PortletRequest {
+
+    /**
+     * Retrieves the body of the HTTP request from client to
+     * portal as binary data using
+     * an <CODE>InputStream</CODE>. Either this method or 
+     * {@link #getReader} may be called to read the body, but not both.
+     * <p>
+     * For HTTP POST data of type application/x-www-form-urlencoded
+     * this method throws an <code>IllegalStateException</code>
+     * as this data has been already processed by the 
+     * portal/portlet-container and is available as request parameters.
+     *
+     * @return an input stream containing the body of the request
+     *
+     * @exception java.lang.IllegalStateException
+     *                   if getReader was already called, or it is a 
+     *                   HTTP POST data of type application/x-www-form-urlencoded
+     * @exception java.io.IOException
+     *                   if an input or output exception occurred
+     */
+    public java.io.InputStream getPortletInputStream () throws java.io.IOException;
+
+
+
+    /**
+     * Overrides the name of the character encoding used in the body of this
+     * request. This method must be called prior to reading input 
+     * using {@link #getReader} or {@link #getPortletInputStream}.
+     * <p>
+     * This method only sets the character set for the Reader that the
+     * {@link #getReader} method returns.
+     *
+     * @param   enc a <code>String</code> containing the name of 
+     *          the character encoding.
+     *
+     * @exception       java.io.UnsupportedEncodingException if this is not a valid encoding
+     * @exception       java.lang.IllegalStateException      if this method is called after 
+     *                                   reading request parameters or reading input using 
+     *                                   <code>getReader()</code>
+     */
+
+    public void setCharacterEncoding(String enc) 
+      throws java.io.UnsupportedEncodingException;
+
+
+    /**
+     * Retrieves the body of the HTTP request from the client to the portal
+     * as character data using
+     * a <code>BufferedReader</code>.  The reader translates the character
+     * data according to the character encoding used on the body.
+     * Either this method or {@link #getPortletInputStream} may be called to read the
+     * body, not both.
+     * <p>
+     * For HTTP POST data of type application/x-www-form-urlencoded
+     * this method throws an <code>IllegalStateException</code>
+     * as this data has been already processed by the 
+     * portal/portlet-container and is available as request parameters.
+     *
+     * @return  a <code>BufferedReader</code>
+     *      containing the body of the request  
+     *
+     * @exception  java.io.UnsupportedEncodingException     
+     *                 if the character set encoding used is 
+     *           not supported and the text cannot be decoded
+     * @exception  java.lang.IllegalStateException      
+     *                 if {@link #getPortletInputStream} method
+     *           has been called on this request,  it is a 
+     *                   HTTP POST data of type application/x-www-form-urlencoded.
+     * @exception  java.io.IOException
+     *                 if an input or output exception occurred
+     *
+     * @see #getPortletInputStream
+     */
+    
+    public java.io.BufferedReader getReader()
+      throws java.io.UnsupportedEncodingException, java.io.IOException;
+      
+      
+    /**
+     * Returns the name of the character encoding used in the body of this request.
+     * This method returns <code>null</code> if the request
+     * does not specify a character encoding.
+     *
+     * @return      a <code>String</code> containing the name of 
+     *          the character encoding, or <code>null</code>
+     *          if the request does not specify a character encoding.
+     */
+    
+    public java.lang.String getCharacterEncoding();
+
+
+
+    /**
+     * Returns the MIME type of the body of the request, 
+     * or null if the type is not known.
+     *
+     * @return      a <code>String</code> containing the name 
+     *          of the MIME type of the request, or null 
+     *                    if the type is not known.
+     */
+
+    public java.lang.String getContentType();
+
+
+    /**
+     * Returns the length, in bytes, of the request body 
+     * which is made available by the input stream, or -1 if the
+     * length is not known. 
+     *
+     *
+     * @return      an integer containing the length of the 
+     *          request body or -1 if the length is not known
+     *
+     */
+
+    public int getContentLength();
+      
+    /**
+     * Returns the name of the HTTP method with which this request was made, 
+     * for example, GET, POST, or PUT.
+     * 
+     * @since 2.0
+     * @return  a String specifying the name of the HTTP method with which 
+     *          this request was made
+     */
+    public String getMethod();
+
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/f0a1530f/portlet-api_2.0_spec/src/main/java/javax/portlet/Event.java
----------------------------------------------------------------------
diff --git a/portlet-api_2.0_spec/src/main/java/javax/portlet/Event.java b/portlet-api_2.0_spec/src/main/java/javax/portlet/Event.java
new file mode 100644
index 0000000..790721c
--- /dev/null
+++ b/portlet-api_2.0_spec/src/main/java/javax/portlet/Event.java
@@ -0,0 +1,64 @@
+/*  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet;
+
+/**
+ * The <code>Event</code> interface represents an event that the portlet has received
+ * in the event processing phase.
+ * <p>
+ * The <code>Event</code> interface encapsulates the event name and event payload,
+ * it does not represent the event object itself.
+ * <p>
+ * The portlet must define the events it is able to receive in the portlet deployment
+ * descriptor with the <code>supported-processing-event</code>.
+ * 
+ * @since 2.0
+ * @see EventPortlet
+ */
+public interface Event {
+    
+    /**
+     * Get the event QName.
+     * 
+     * @return  the QName of the event, never <code>null</code>.
+     */
+    public javax.xml.namespace.QName getQName();
+
+    /**
+     * Get the local part of the event name.
+     * 
+     * @return  the local part of the event, never <code>null</code>.
+     */
+    public java.lang.String getName();
+
+    /**
+     * Get the event payload.
+     * 
+     * @return  event payload, must be serializable.
+     *          May return <code>null</code> if this event has no payload.
+     */
+    public java.io.Serializable getValue();
+   
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/f0a1530f/portlet-api_2.0_spec/src/main/java/javax/portlet/EventPortlet.java
----------------------------------------------------------------------
diff --git a/portlet-api_2.0_spec/src/main/java/javax/portlet/EventPortlet.java b/portlet-api_2.0_spec/src/main/java/javax/portlet/EventPortlet.java
new file mode 100644
index 0000000..a35dfd7
--- /dev/null
+++ b/portlet-api_2.0_spec/src/main/java/javax/portlet/EventPortlet.java
@@ -0,0 +1,70 @@
+/*  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet;
+
+import java.io.IOException;
+
+/**
+ * The <code>EventPortlet</code> interface allows
+ * portlets receiving events.
+ * <p>
+ * Events are part of the action processing and must
+ * be finished before the rendering phase can start.
+ * Portlets can receive events issued by other portlets or
+ * portlet container defined events.
+ * <p>
+ * Portlets should declare the events it would like to receive
+ * via the <code>supported-processing-event</code> tag and events published
+ * via the <code>supported-publishing-event</code> tag in the portlet 
+ * deployment descriptor. 
+ * <p>
+ * The event model is a loosely coupled model where the wiring between
+ * published and receiving events is done at the portal / portlet container
+ * level.
+ * 
+ * @since 2.0
+ */
+
+public interface EventPortlet {
+
+    /**
+     * Called by the portlet container requesting the portlet
+     * to process a specific event.
+     * 
+     * @param request  the event request
+     * @param response  the event response
+     * @exception  PortletException
+     *                   if the portlet has problems fulfilling the
+     *                   request
+     * @exception  UnavailableException   
+     *                   if the portlet is unavailable to process the event at this time
+     * @exception  PortletSecurityException  
+     *                   if the portlet cannot fullfill this request because of security reasons
+     * @exception  IOException
+     *                   if the streaming causes an I/O problem
+     */
+    public void processEvent (EventRequest request, EventResponse response) 
+        throws PortletException, java.io.IOException;
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/f0a1530f/portlet-api_2.0_spec/src/main/java/javax/portlet/EventRequest.java
----------------------------------------------------------------------
diff --git a/portlet-api_2.0_spec/src/main/java/javax/portlet/EventRequest.java b/portlet-api_2.0_spec/src/main/java/javax/portlet/EventRequest.java
new file mode 100644
index 0000000..6c0bd97
--- /dev/null
+++ b/portlet-api_2.0_spec/src/main/java/javax/portlet/EventRequest.java
@@ -0,0 +1,59 @@
+/*  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet;
+
+/**
+ * The <CODE>EventRequest</CODE> represents the request sent to the portlet
+ * to handle an event.
+ * It extends the PortletRequest interface to provide event request
+ * information to portlets.<br>
+ * The portlet container creates an <CODE>EventRequest</CODE> object and
+ * passes it as argument to the portlet's <CODE>processEvent</CODE> method.
+ * 
+ * @see ActionRequest
+ * @see PortletRequest
+ * @since 2.0
+ */
+public interface EventRequest extends PortletRequest {
+
+    /**
+     * Returns the event that triggered the call to the processEvent method.
+     * 
+     * @return      the event that triggered the current processEvent call. 
+     */
+    
+    public Event getEvent();
+    
+    /**
+     * Returns the name of the HTTP method with which the original action request was made, 
+     * for example, POST, or PUT.
+     * 
+     * @since 2.0
+     * @return  a String specifying the name of the HTTP method with which 
+     *          this request was made
+     */
+    public String getMethod();
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/f0a1530f/portlet-api_2.0_spec/src/main/java/javax/portlet/EventResponse.java
----------------------------------------------------------------------
diff --git a/portlet-api_2.0_spec/src/main/java/javax/portlet/EventResponse.java b/portlet-api_2.0_spec/src/main/java/javax/portlet/EventResponse.java
new file mode 100644
index 0000000..e4bd253
--- /dev/null
+++ b/portlet-api_2.0_spec/src/main/java/javax/portlet/EventResponse.java
@@ -0,0 +1,62 @@
+/*  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet;
+
+
+/**
+ * The <CODE>EventResponse</CODE> interface represents the portlet
+ * response to an event request.
+ * It extends the <CODE>StateAwareResponse</CODE> interface.<br>
+ * The portlet container creates an <CODE>EventResponse</CODE> object and 
+ * passes it as argument to the portlet's <CODE>processEvent</CODE> method.
+ * 
+ * @see StateAwareResponse 
+ * @see PortletResponse
+ * @since 2.0
+ */
+public interface EventResponse extends StateAwareResponse {
+
+    /**
+     * Maintain the current render parameters of the request for
+     * the response.
+     * <p>
+     * All previously set render parameters are cleared.
+     * <p>
+     * These parameters will be accessible in all
+     * subsequent render calls via the
+     * <code>PortletRequest.getParameter</code> call until
+     * a new request is targeted to the portlet.
+     * <p>
+     * The given parameters do not need to be encoded
+     * prior to calling this method.
+     *
+     * @param  request   The request the portlet has been provided
+     *                   with by the portlet container for the current
+     *                   <code>processEvent</code> call, must not be 
+     *                   <code>null</code>.
+     */
+    public void setRenderParameters(EventRequest request);
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/f0a1530f/portlet-api_2.0_spec/src/main/java/javax/portlet/GenericPortlet.java
----------------------------------------------------------------------
diff --git a/portlet-api_2.0_spec/src/main/java/javax/portlet/GenericPortlet.java b/portlet-api_2.0_spec/src/main/java/javax/portlet/GenericPortlet.java
new file mode 100644
index 0000000..e1ff6de
--- /dev/null
+++ b/portlet-api_2.0_spec/src/main/java/javax/portlet/GenericPortlet.java
@@ -0,0 +1,771 @@
+/*  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet;
+
+import java.io.IOException;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+import java.util.Collection;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+/**
+ * The <CODE>GenericPortlet</CODE> class provides a default implementation for
+ * the <CODE>Portlet</CODE> interface.
+ * <p>
+ * It provides an abstract class to be subclassed to create portlets. A subclass
+ * of <CODE>GenericPortlet</CODE> should either use one of the following annotations:
+ * <ul>
+ * <li><code>@ProcessAction</code></li>
+ * <li><code>@ProcessEvent</code></li>
+ * <li><code>@RenderMode</code></li>
+ * </ul>
+ * or override at least one method, usually
+ * one of the following:
+ * <ul>
+ * <li>processAction, to handle action requests</li>
+ * <li>doView, to handle render requests when in VIEW mode</li>
+ * <li>doEdit, to handle render requests when in EDIT mode</li>
+ * <li>doHelp, to handle render request when in HELP mode</li>
+ * <li>init and destroy, to manage resources that are held for the life of the
+ * servlet</li>
+ * </ul>
+ * <p>
+ * Normally there is no need to override the render or the doDispatch methods.
+ * Render handles render requests setting the title of the portlet in the
+ * response and invoking doDispatch. doDispatch dispatches the request to one of
+ * the doView, doEdit or doHelp method depending on the portlet mode indicated
+ * in the request.
+ * <p>
+ * Portlets typically run on multithreaded servers, so please note that a
+ * portlet must handle concurrent requests and be careful to synchronize access
+ * to shared resources. Shared resources include in-memory data such as instance
+ * or class variables and external objects such as files, database connections,
+ * and network connections.
+ */
+public abstract class GenericPortlet implements Portlet, PortletConfig, EventPortlet, ResourceServingPortlet {
+
+	private transient PortletConfig config;
+
+	private transient Map<String, Method> processActionHandlingMethodsMap = new HashMap<String, Method>();
+	private transient Map<String, Method> processEventHandlingMethodsMap = new HashMap<String, Method>();
+	private transient Map<String, Method> renderModeHandlingMethodsMap = new HashMap<String, Method>();
+
+	/**
+	 * Does nothing.
+	 */
+
+	public GenericPortlet() {
+	}
+
+	/**
+	 * Called by the portlet container to indicate to a portlet that the portlet
+	 * is being placed into service.
+	 * <p>
+	 * The default implementation stores the <code>PortletConfig</code> object
+	 * and checks for annotated methods with the annotations
+	 * <ul>
+	 * <li>@ProcessAction</li>
+	 * <li>@ProcessEvent</li>
+	 * <li>@RenderMode</li>
+	 * </ul>
+	 * and stores these in a hashmap for later dispatching.
+	 * <p>
+	 * The portlet container calls the <code>init</code> method exactly once
+	 * after instantiating the portlet. The <code>init</code> method must
+	 * complete successfully before the portlet can receive any requests.
+	 * 
+	 * <p>
+	 * The portlet container cannot place the portlet into service if the
+	 * <code>init</code> method does one of the following:
+	 * <ol>
+	 * <li>it throws a <code>PortletException</code>
+	 * <li>it does not return within a time period defined by the Web server
+	 * </ol>
+	 * 
+	 * 
+	 * @param config
+	 *            a <code>PortletConfig</code> object containing the portlet
+	 *            configuration and initialization parameters
+	 * 
+	 * @exception PortletException
+	 *                if an exception has occurred that interferes with the
+	 *                portlet normal operation.
+	 * @exception UnavailableException
+	 *                if the portlet cannot perform the initialization at this
+	 *                time.
+	 */
+	public void init(PortletConfig config) throws PortletException {
+		this.config = config;
+		cacheAnnotatedMethods();
+		this.init();
+	}
+
+
+	/**
+	 * 
+	 * A convenience method which can be overridden so that there's no need to
+	 * call <code>super.init(config)</code>.
+	 * 
+	 * <p>
+	 * Instead of overriding {@link #init(PortletConfig)}, simply override this
+	 * method and it will be called by
+	 * <code>GenericPortlet.init(PortletConfig config)</code>. The
+	 * <code>PortletConfig</code> object can still be retrieved via {@link
+	 * #getPortletConfig}.
+	 * 
+	 * @exception PortletException
+	 *                if an exception has occurred that interferes with the
+	 *                portlet normal operation.
+	 * @exception UnavailableException
+	 *                if the portlet is unavailable to perform init
+	 */
+	public void init() throws PortletException {
+	}
+
+	/**
+	 * Called by the portlet container to allow the portlet to process an action
+	 * request. This method is called if the client request was originated by a
+	 * URL created (by the portlet) with the
+	 * <code>RenderResponse.createActionURL()</code> method.
+	 * <p>
+	 * The default implementation tries to dispatch to a method
+	 * annotated with <code>@ProcessAction</name> that matches the action parameter 
+	 * value <code>ActionRequest.ACTION_NAME</code> or, if no
+	 * such method is found throws a <code>PortletException</code>.<br>
+ 	 * Note that the annotated methods needs to be public in order
+	 * to be allowed to be called by <code>GenericPortlet</code>.
+
+	 * 
+	 * @param request
+	 *            the action request
+	 * @param response
+	 *            the action response
+	 * @exception PortletException
+	 *                if the portlet cannot fulfilling the request
+	 * @exception UnavailableException
+	 *                if the portlet is unavailable to process the action at
+	 *                this time
+	 * @exception PortletSecurityException
+	 *                if the portlet cannot fullfill this request because of
+	 *                security reasons
+	 * @exception java.io.IOException
+	 *                if the streaming causes an I/O problem
+	 */
+	public void processAction(ActionRequest request, ActionResponse response) throws PortletException,
+			java.io.IOException {
+		String action = request.getParameter(ActionRequest.ACTION_NAME);
+
+		try {
+			// check if action is cached
+			Method actionMethod = processActionHandlingMethodsMap.get(action);
+			if (actionMethod != null) {
+				actionMethod.invoke(this, request, response);
+				return;
+			}
+		} catch (Exception e) {
+			throw new PortletException(e);
+		}
+
+		// if no action processing method was found throw exc
+		throw new PortletException("processAction method not implemented");
+	}
+
+	/**
+	 * The default implementation of this method sets the headers using the
+	 * <code>doHeaders</code> method, sets the title using the
+	 * <code>getTitle</code> method and invokes the <code>doDispatch</code>
+	 * method.
+	 * <p>
+	 * It also evaluates the <code>RENDER_PART</code> request attribute and if
+	 * set calls the <code>doHeaders, getNextPossiblePortletModes</code> and
+	 * <code>getTitle</code> methods for the <code>RENDER_HEADERS</code>
+	 * part and the <code>doDispatch</code> method for the
+	 * <code>RENDER_MARKUP</code> part.<br>
+	 * If the <code>RENDER_PART</code> request attribute is not set all of the
+	 * above methods will be called.
+	 * 
+	 * @param request
+	 *            the render request
+	 * @param response
+	 *            the render response
+	 * 
+	 * @exception PortletException
+	 *                if the portlet cannot fulfilling the request
+	 * @exception UnavailableException
+	 *                if the portlet is unavailable to perform render at this
+	 *                time
+	 * @exception PortletSecurityException
+	 *                if the portlet cannot fullfill this request because of
+	 *                security reasons
+	 * @exception java.io.IOException
+	 *                if the streaming causes an I/O problem
+	 * 
+	 */
+	public void render(RenderRequest request, RenderResponse response) throws PortletException, java.io.IOException {
+		Object renderPartAttrValue = request.getAttribute(RenderRequest.RENDER_PART);
+		if (renderPartAttrValue != null) {
+			// streaming portal calling
+			if (renderPartAttrValue.equals(RenderRequest.RENDER_HEADERS)) {
+				doHeaders(request, response);
+				Collection<PortletMode> nextModes = getNextPossiblePortletModes(request);
+				if (nextModes != null)
+					response.setNextPossiblePortletModes(nextModes);
+				response.setTitle(getTitle(request));
+			} else if (renderPartAttrValue.equals(RenderRequest.RENDER_MARKUP)) {
+				doDispatch(request, response);
+			} else {
+				throw new PortletException("Unknown value of the 'javax.portlet.render_part' request attribute");
+			}
+		} else {
+			// buffered portal calling
+			doHeaders(request, response);
+			Collection<PortletMode> nextModes = getNextPossiblePortletModes(request);
+			if (nextModes != null)
+				response.setNextPossiblePortletModes(nextModes);
+			response.setTitle(getTitle(request));
+			doDispatch(request, response);
+		}
+	}
+
+	/**
+	 * Used by the render method to get the title.
+	 * <p>
+	 * The default implementation gets the title from the ResourceBundle of the
+	 * PortletConfig of the portlet. The title is retrieved using the
+	 * 'javax.portlet.title' resource name.
+	 * <p>
+	 * Portlets can overwrite this method to provide dynamic titles (e.g. based
+	 * on locale, client, and session information). Examples are:
+	 * <UL>
+	 * <LI>language-dependent titles for multi-lingual portals</li>
+	 * <LI>shorter titles for WAP phones</li>
+	 * <LI>the number of messages in a mailbox portlet</li>
+	 * </UL>
+	 * 
+	 * @return the portlet title for this window
+	 * @throws java.lang.IllegalStateException
+	 *             if no portlet config object is available
+	 */
+	protected java.lang.String getTitle(RenderRequest request) {
+		if (config == null)
+			throw new java.lang.IllegalStateException(
+					"Config is null, please ensure that your init(config) method calls super.init(config)");
+
+		return config.getResourceBundle(request.getLocale()).getString("javax.portlet.title");
+	}
+
+	/**
+	 * The default implementation of this method routes the render request to:
+	 * <ol>
+	 * <li>method annotated with <code>@RenderMode</name> and the name of the
+	 *       portlet mode</li>
+	 *   <li>a set of helper methods depending on the current portlet mode the portlet
+	 * 		 is currently in. These methods are:
+	 * 		<ul>
+	 * 			<li><code>doView</code> for handling <code>view</code> requests</li>
+	 * 			<li><code>doEdit</code> for handling <code>edit</code> requests</li>
+	 * 			<li><code>doHelp</code> for handling <code>help</code> requests</li>
+	 * 		</ul>
+	 *	</li>
+	 * </ul> 
+	 * <P>
+	 * If the window state of this portlet is <code>minimized</code>, this
+	 * method does not invoke any of the portlet mode rendering methods.
+	 * <p>
+	 * For handling custom portlet modes the portlet should either use the
+	 * <code>@RenderMode</code> annotation or override this
+	 * method. Note that the annotated methods needs to be public in order
+	 * to be allowed to be called by <code>GenericPortlet</code>.
+	 * 
+	 * @param request
+	 *            the render request
+	 * @param response
+	 *            the render response
+	 * 
+	 * @exception PortletException
+	 *                if the portlet cannot fulfilling the request
+	 * @exception UnavailableException
+	 *                if the portlet is unavailable to perform render at this
+	 *                time
+	 * @exception PortletSecurityException
+	 *                if the portlet cannot fullfill this request because of
+	 *                security reasons
+	 * @exception java.io.IOException
+	 *                if the streaming causes an I/O problem
+	 * 
+	 * @see #doView(RenderRequest, RenderResponse)
+	 * @see #doEdit(RenderRequest, RenderResponse)
+	 * @see #doHelp(RenderRequest, RenderResponse)
+	 */
+	protected void doDispatch(RenderRequest request, RenderResponse response) throws PortletException,
+			java.io.IOException {
+		WindowState state = request.getWindowState();
+
+		if (!state.equals(WindowState.MINIMIZED)) {
+			PortletMode mode = request.getPortletMode();
+			// first look if there are methods annotated for
+			// handling the rendering of this mode
+			try {
+				// check if mode is cached
+				Method renderMethod = renderModeHandlingMethodsMap.get(mode.toString());
+				if (renderMethod != null) {
+					renderMethod.invoke(this, request, response);
+					return;
+				}
+			} catch (Exception e) {
+				throw new PortletException(e);
+			}
+
+			// if not, try the default doXYZ methods
+			if (mode.equals(PortletMode.VIEW)) {
+				doView(request, response);
+			} else if (mode.equals(PortletMode.EDIT)) {
+				doEdit(request, response);
+			} else if (mode.equals(PortletMode.HELP)) {
+				doHelp(request, response);
+			} else {
+				throw new PortletException("unknown portlet mode: " + mode);
+			}
+		}
+	}
+
+	/**
+	 * Helper method to serve up the mandatory <code>view</code> mode.
+	 * <p>
+	 * The default implementation throws an exception.
+	 * 
+	 * @param request
+	 *            the portlet request
+	 * @param response
+	 *            the render response
+	 * 
+	 * @exception PortletException
+	 *                if the portlet cannot fulfilling the request
+	 * @exception UnavailableException
+	 *                if the portlet is unavailable to perform render at this
+	 *                time
+	 * @exception PortletSecurityException
+	 *                if the portlet cannot fullfill this request because of
+	 *                security reasons
+	 * @exception java.io.IOException
+	 *                if the streaming causes an I/O problem
+	 * 
+	 */
+	protected void doView(RenderRequest request, RenderResponse response) throws PortletException, java.io.IOException {
+		throw new PortletException("doView method not implemented");
+	}
+
+	/**
+	 * Helper method to serve up the <code>edit</code> mode.
+	 * <p>
+	 * The default implementation throws an exception.
+	 * 
+	 * @param request
+	 *            the portlet request
+	 * @param response
+	 *            the render response
+	 * 
+	 * @exception PortletException
+	 *                if the portlet cannot fulfilling the request
+	 * @exception UnavailableException
+	 *                if the portlet is unavailable to perform render at this
+	 *                time
+	 * @exception PortletSecurityException
+	 *                if the portlet cannot fullfill this request because of
+	 *                security reasons
+	 * @exception java.io.IOException
+	 *                if the streaming causes an I/O problem
+	 * 
+	 */
+	protected void doEdit(RenderRequest request, RenderResponse response) throws PortletException, java.io.IOException {
+		throw new PortletException("doEdit method not implemented");
+	}
+
+	/**
+	 * Helper method to serve up the <code>help</code> mode.
+	 * <p>
+	 * The default implementation throws an exception.
+	 * 
+	 * @param request
+	 *            the portlet request
+	 * @param response
+	 *            the render response
+	 * 
+	 * @exception PortletException
+	 *                if the portlet cannot fulfilling the request
+	 * @exception UnavailableException
+	 *                if the portlet is unavailable to perform render at this
+	 *                time
+	 * @exception PortletSecurityException
+	 *                if the portlet cannot fullfill this request because of
+	 *                security reasons
+	 * @exception java.io.IOException
+	 *                if the streaming causes an I/O problem
+	 */
+	protected void doHelp(RenderRequest request, RenderResponse response) throws PortletException, java.io.IOException {
+		throw new PortletException("doHelp method not implemented");
+	}
+
+	/**
+	 * Returns the PortletConfig object of this portlet.
+	 * 
+	 * @return the PortletConfig object of this portlet
+	 */
+	public PortletConfig getPortletConfig() {
+		return config;
+	}
+
+	/**
+	 * Called by the portlet container to indicate to a portlet that the portlet
+	 * is being taken out of service.
+	 * <p>
+	 * The default implementation does nothing.
+	 * 
+	 */
+	public void destroy() {
+		// do nothing
+	}
+
+	// -------------------------------------------------------------------------
+	// implement PortletConfig
+	// -------------------------------------------------------------------------
+
+	/**
+	 * Returns the name of this portlet.
+	 * 
+	 * @return the portlet name
+	 * 
+	 * @see PortletConfig#getPortletName()
+	 */
+	public String getPortletName() {
+		if (config == null)
+			throw new java.lang.IllegalStateException(
+					"Config is null, please ensure that your init(config) method calls super.init(config)");
+
+		return config.getPortletName();
+	}
+
+	/**
+	 * Returns the <code>PortletContext</code> of the portlet application the
+	 * portlet is in.
+	 * 
+	 * @return the portlet application context
+	 */
+	public PortletContext getPortletContext() {
+		if (config == null)
+			throw new java.lang.IllegalStateException(
+					"Config is null, please ensure that your init(config) method calls super.init(config)");
+
+		return config.getPortletContext();
+	}
+
+	/**
+	 * Gets the resource bundle for the given locale based on the resource
+	 * bundle defined in the deployment descriptor with
+	 * <code>resource-bundle</code> tag or the inlined resources defined in
+	 * the deployment descriptor.
+	 * 
+	 * @return the resource bundle for the given locale
+	 */
+	public java.util.ResourceBundle getResourceBundle(java.util.Locale locale) {
+		if (config == null)
+			throw new java.lang.IllegalStateException(
+					"Config is null, please ensure that your init(config) method calls super.init(config)");
+
+		return config.getResourceBundle(locale);
+	}
+
+	/**
+	 * Returns a String containing the value of the named initialization	 * parameter, or null if the parameter does not exist.
+	 * 
+	 * @param name
+	 *            a <code>String</code> specifying the name of the
+	 *            initialization parameter
+	 * 
+	 * @return a <code>String</code> containing the value of the
+	 *         initialization parameter
+	 * 
+	 * @exception java.lang.IllegalArgumentException
+	 *                if name is <code>null</code>.
+	 */
+	public String getInitParameter(java.lang.String name) {
+		if (config == null)
+			throw new java.lang.IllegalStateException(
+					"Config is null, please ensure that your init(config) method calls super.init(config)");
+
+		return config.getInitParameter(name);
+	}
+
+	/**
+	 * Returns the names of the portlet initialization parameters as an
+	 * Enumeration of String objects, or an empty Enumeration if the portlet has
+	 * no initialization parameters.
+	 * 
+	 * @return an <code>Enumeration</code> of <code>String</code> objects
+	 *         containing the names of the portlet initialization parameters, or
+	 *         an empty Enumeration if the portlet has no initialization
+	 *         parameters.
+	 */
+	public java.util.Enumeration<String> getInitParameterNames() {
+		if (config == null)
+			throw new java.lang.IllegalStateException(
+					"Config is null, please ensure that your init(config) method calls super.init(config)");
+
+		return config.getInitParameterNames();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see javax.portlet.PortletConfig#getProcessingEventQNames()
+	 */
+	public Enumeration<QName> getProcessingEventQNames() {
+		if (config == null)
+			throw new java.lang.IllegalStateException(
+					"Config is null, please ensure that your init(config) method calls super.init(config)");
+
+		return config.getProcessingEventQNames();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see javax.portlet.PortletConfig#getPublishingEventQNames()
+	 */
+	public Enumeration<QName> getPublishingEventQNames() {
+		if (config == null)
+			throw new java.lang.IllegalStateException(
+					"Config is null, please ensure that your init(config) method calls super.init(config)");
+
+		return config.getPublishingEventQNames();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see javax.portlet.PortletConfig#getSupportedLocales()
+	 */
+	public Enumeration<Locale> getSupportedLocales() {
+		if (config == null)
+			throw new java.lang.IllegalStateException(
+					"Config is null, please ensure that your init(config) method calls super.init(config)");
+
+		return config.getSupportedLocales();
+	}
+
+	/* (non-Javadoc)
+	 * @see javax.portlet.PortletConfig#getContainerRuntimeOptions()
+	 */
+	public Map<String, String[]> getContainerRuntimeOptions() {
+		return config.getContainerRuntimeOptions();
+	}
+
+	// -------------------------------------------------------------------------
+	// V 2.0 additions
+	// -------------------------------------------------------------------------
+
+	/**
+	 * Default resource serving.
+	 * <p>
+	 * The default implemention of this method is to call a
+	 * RequestDispatcher.foward with the ResourceID of the ResourceRequest.
+	 * <p>
+	 * If no ResourceID is set on the resource URL the default implementation
+	 * does nothing.
+	 * 
+	 * @since 2.0
+	 */
+	public void serveResource(ResourceRequest request, ResourceResponse response) throws PortletException, IOException {
+		if (request.getResourceID() != null) {
+			PortletRequestDispatcher rd = getPortletConfig().getPortletContext().getRequestDispatcher(
+					request.getResourceID());
+			if (rd != null)
+				rd.forward(request, response);
+		}
+	}
+
+	/**
+	 * The default implementation tries to dispatch to a method
+	 * annotated with <code>@ProcessEvent</name> that matches the 
+	 * event name or, if no
+	 * such method is found just sets the current render parameters on
+	 * the response.<br>
+ 	 * Note that the annotated methods needs to be public in order
+	 * to be allowed to be called by <code>GenericPortlet</code>.
+	 * 
+	 * @see javax.portlet.EventPortlet#processEvent(javax.portlet.EventRequest,
+	 *      javax.portlet.EventResponse)
+	 * @since 2.0
+	 */
+	public void processEvent(EventRequest request, EventResponse response) throws PortletException, IOException {
+		String eventName = request.getEvent().getQName().toString();
+
+		try {
+			// check for exact match
+			Method eventMethod = processEventHandlingMethodsMap.get(eventName);
+			if (eventMethod != null) {
+				eventMethod.invoke(this, request, response);
+				return;
+			} else {
+				// Search for the longest possible matching wildcard annotation
+				int endPos = eventName.indexOf('}');
+				int dotPos = eventName.lastIndexOf('.');
+				while (dotPos > endPos) {
+					String wildcardLookup = eventName.substring(0, dotPos + 1);
+					eventMethod = processEventHandlingMethodsMap.get(wildcardLookup);
+					if (eventMethod != null) {
+						eventMethod.invoke(this, request, response);
+						return;
+					}
+					if (dotPos == 0) {
+						break;
+					}
+					dotPos = eventName.lastIndexOf('.', dotPos - 1);
+				}
+			}
+		} catch (Exception e) {
+			throw new PortletException(e);
+		}
+
+		// if no event processing method was found just keep render params
+		response.setRenderParameters(request);
+	}
+
+	/**
+	 * Used by the render method to set the response properties and headers.
+	 * <p>
+	 * The portlet should override this method and set its response header using
+	 * this method in order to ensure that they are set before anything is
+	 * written to the output stream.
+	 * <p>
+	 * The default implemention of this method is emtpy.
+	 * 
+	 * @param request  the render request
+	 * @param response the render response
+	 * @since 2.0
+	 */
+	protected void doHeaders(RenderRequest request, RenderResponse response) {
+		return;
+	}
+
+	/**
+	 * Used by the render method to set the next possible portlet modes.
+	 * <p>
+	 * The portlet should override this method and set the next possible portlet
+	 * modes using this method in order to ensure that they are set before
+	 * anything is written to the output stream.
+	 * <p>
+	 * The default implemention of this method returns <code>null</code>.
+	 * 
+	 * @since 2.0
+	 */
+	protected java.util.Collection<PortletMode> getNextPossiblePortletModes(RenderRequest request) {
+		return null;
+	}
+
+	/**
+	 * Returns the names of the public render parameters supported by the
+	 * portlet as an <code>Enumeration</code> of String objects, or an empty
+	 * <code>Enumeration</code> if the portlet has no public render
+	 * parameters.
+	 * 
+	 * @return an <code>Enumeration</code> of <code>String</code> objects
+	 *         containing the names of the public render parameters, or an empty
+	 *         <code>Enumeration</code> if the portlet does not define any
+	 *         public render parameters.
+	 * 
+	 * @see javax.portlet.PortletConfig#getPublicRenderParameterNames()
+	 */
+	public Enumeration<String> getPublicRenderParameterNames() {
+		if (config == null)
+			throw new java.lang.IllegalStateException(
+					"Config is null, please ensure that your init(config) method calls super.init(config)");
+
+		return config.getPublicRenderParameterNames();
+	}
+
+	/**
+	 * Returns the default namespace for events and public parameters. This
+	 * namespace is defined in the portlet deployment descriptor with the
+	 * <code>default-namespace</code> element.
+	 * <p>
+	 * If no default namespace is defined in the portlet deployment descriptor
+	 * this methods returns the XML default namespace
+	 * <code>XMLConstants.NULL_NS_URI</code>.
+	 * 
+	 * @return the default namespace defined in the portlet deployment
+	 *         descriptor, or <code>XMLConstants.NULL_NS_URI</code> is non is
+	 *         defined.
+	 * 
+	 * @see javax.portlet.PortletConfig#getDefaultNamespace()
+	 */
+	public String getDefaultNamespace() {
+		if (config == null)
+			throw new java.lang.IllegalStateException(
+					"Config is null, please ensure that your init(config) method calls super.init(config)");
+
+		return config.getDefaultNamespace();
+	}
+
+	private void cacheAnnotatedMethods() {
+		// cache all annotated and visible public methods
+		for (Method method : this.getClass().getMethods()) {
+			Annotation[] annotations = method.getAnnotations();
+			if (annotations != null) {
+				for (Annotation annotation : annotations) {
+					Class<? extends Annotation> annotationType = annotation.annotationType();
+					if (ProcessAction.class.equals(annotationType)) {
+						String name = ((ProcessAction) annotation).name();
+						if (name != null && name.length() > 0)
+							processActionHandlingMethodsMap.put(name, method);
+					} else if (ProcessEvent.class.equals(annotationType)) {
+						String qname = ((ProcessEvent) annotation).qname();
+						if (qname == null || qname.length() <= 0) {
+							if (config == null)
+								throw new java.lang.IllegalStateException(
+										"Config is null, please ensure that your init(config) method calls super.init(config)");
+
+							String name = ((ProcessEvent) annotation).name();
+							if (name != null && name.length() > 0) {
+								qname = new QName(config.getDefaultNamespace(), name).toString();
+								processEventHandlingMethodsMap.put(qname, method);
+							}
+						} else
+							processEventHandlingMethodsMap.put(qname, method);
+					} else if (RenderMode.class.equals(annotationType)) {
+						String name = ((RenderMode) annotation).name();
+						if (name != null && name.length() > 0)
+							renderModeHandlingMethodsMap.put(name.toLowerCase(), method);
+					}
+				}
+			}
+		}
+	}
+}