Author: mstruk
Date: 2012-02-22 14:27:28 -0500 (Wed, 22 Feb 2012)
New Revision: 8453
Added:
sandbox/as7_support/branches/gatein-as7/wci/test/portlets/native-skipped-portlet/
sandbox/as7_support/branches/gatein-as7/wci/test/portlets/native-skipped-portlet/pom.xml
sandbox/as7_support/branches/gatein-as7/wci/test/portlets/native-skipped-portlet/src/
sandbox/as7_support/branches/gatein-as7/wci/test/portlets/native-skipped-portlet/src/main/
sandbox/as7_support/branches/gatein-as7/wci/test/portlets/native-skipped-portlet/src/main/webapp/
sandbox/as7_support/branches/gatein-as7/wci/test/portlets/native-skipped-portlet/src/main/webapp/WEB-INF/
sandbox/as7_support/branches/gatein-as7/wci/test/portlets/native-skipped-portlet/src/main/webapp/WEB-INF/web.xml
sandbox/as7_support/branches/gatein-as7/wci/test/portlets/native-skipped-with-gateinservlet-portlet/
sandbox/as7_support/branches/gatein-as7/wci/test/portlets/native-skipped-with-gateinservlet-portlet/.settings/
sandbox/as7_support/branches/gatein-as7/wci/test/portlets/native-skipped-with-gateinservlet-portlet/pom.xml
sandbox/as7_support/branches/gatein-as7/wci/test/portlets/native-skipped-with-gateinservlet-portlet/src/
sandbox/as7_support/branches/gatein-as7/wci/test/portlets/native-skipped-with-gateinservlet-portlet/src/main/
sandbox/as7_support/branches/gatein-as7/wci/test/portlets/native-skipped-with-gateinservlet-portlet/src/main/webapp/
sandbox/as7_support/branches/gatein-as7/wci/test/portlets/native-skipped-with-gateinservlet-portlet/src/main/webapp/WEB-INF/
sandbox/as7_support/branches/gatein-as7/wci/test/portlets/native-skipped-with-gateinservlet-portlet/src/main/webapp/WEB-INF/web.xml
sandbox/as7_support/branches/gatein-as7/wci/wci/src/main/java/org/gatein/wci/api/GateInServletRegistrations.java
Modified:
sandbox/as7_support/branches/gatein-as7/wci/exo/pom.xml
sandbox/as7_support/branches/gatein-as7/wci/jboss/jboss6/pom.xml
sandbox/as7_support/branches/gatein-as7/wci/jboss/jboss6/src/main/java/org/gatein/wci/jboss/JB6ServletContainerContext.java
sandbox/as7_support/branches/gatein-as7/wci/jboss/pom.xml
sandbox/as7_support/branches/gatein-as7/wci/jetty/pom.xml
sandbox/as7_support/branches/gatein-as7/wci/jetty/src/main/java/org/gatein/wci/jetty/Jetty6ServletContainerContext.java
sandbox/as7_support/branches/gatein-as7/wci/pom.xml
sandbox/as7_support/branches/gatein-as7/wci/test/core/pom.xml
sandbox/as7_support/branches/gatein-as7/wci/test/core/src/main/java/org/gatein/wci/container/ServletContainerContextImpl.java
sandbox/as7_support/branches/gatein-as7/wci/test/pom.xml
sandbox/as7_support/branches/gatein-as7/wci/test/portlets/exo-portlet/pom.xml
sandbox/as7_support/branches/gatein-as7/wci/test/portlets/gatein-portlet/pom.xml
sandbox/as7_support/branches/gatein-as7/wci/test/portlets/native-portlet/pom.xml
sandbox/as7_support/branches/gatein-as7/wci/test/portlets/pom.xml
sandbox/as7_support/branches/gatein-as7/wci/test/servers/jboss51/pom.xml
sandbox/as7_support/branches/gatein-as7/wci/test/servers/jboss6/pom.xml
sandbox/as7_support/branches/gatein-as7/wci/test/servers/jetty6/pom.xml
sandbox/as7_support/branches/gatein-as7/wci/test/servers/pom.xml
sandbox/as7_support/branches/gatein-as7/wci/test/servers/src/common/resources/common.xml
sandbox/as7_support/branches/gatein-as7/wci/test/servers/tomcat6/pom.xml
sandbox/as7_support/branches/gatein-as7/wci/test/servers/tomcat7/pom.xml
sandbox/as7_support/branches/gatein-as7/wci/tomcat/pom.xml
sandbox/as7_support/branches/gatein-as7/wci/tomcat/tomcat6/pom.xml
sandbox/as7_support/branches/gatein-as7/wci/tomcat/tomcat6/src/main/java/org/gatein/wci/tomcat/TC6ServletContainerContext.java
sandbox/as7_support/branches/gatein-as7/wci/tomcat/tomcat7/pom.xml
sandbox/as7_support/branches/gatein-as7/wci/tomcat/tomcat7/src/main/java/org/gatein/wci/tomcat/TC7ServletContainerContext.java
sandbox/as7_support/branches/gatein-as7/wci/wci/pom.xml
sandbox/as7_support/branches/gatein-as7/wci/wci/src/main/java/org/gatein/wci/api/GateInServlet.java
sandbox/as7_support/branches/gatein-as7/wci/wci/src/main/java/org/gatein/wci/api/GateInServletListener.java
sandbox/as7_support/branches/gatein-as7/wci/wci/src/main/java/org/gatein/wci/endpoint/EndPointServlet.java
sandbox/as7_support/branches/gatein-as7/wci/wci/src/main/java/org/gatein/wci/impl/DefaultServletContainer.java
sandbox/as7_support/branches/gatein-as7/wci/wci/src/main/java/org/gatein/wci/impl/generic/GenericServletContainerContext.java
sandbox/as7_support/branches/gatein-as7/wci/wci/src/main/java/org/gatein/wci/security/WCILoginController.java
sandbox/as7_support/branches/gatein-as7/wci/wci/src/main/java/org/gatein/wci/spi/ServletContainerContext.java
Log:
Updated wci to 2.1.1-Beta03
Modified: sandbox/as7_support/branches/gatein-as7/wci/exo/pom.xml
===================================================================
--- sandbox/as7_support/branches/gatein-as7/wci/exo/pom.xml 2012-02-22 16:10:35 UTC (rev
8452)
+++ sandbox/as7_support/branches/gatein-as7/wci/exo/pom.xml 2012-02-22 19:27:28 UTC (rev
8453)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-parent</artifactId>
- <version>2.1.0-Beta07-AS7-Beta02</version>
+ <version>2.1.1-Beta03-AS7-Beta03</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-exo</artifactId>
Modified: sandbox/as7_support/branches/gatein-as7/wci/jboss/jboss6/pom.xml
===================================================================
--- sandbox/as7_support/branches/gatein-as7/wci/jboss/jboss6/pom.xml 2012-02-22 16:10:35
UTC (rev 8452)
+++ sandbox/as7_support/branches/gatein-as7/wci/jboss/jboss6/pom.xml 2012-02-22 19:27:28
UTC (rev 8453)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-jboss</artifactId>
- <version>2.1.0-Beta07-AS7-Beta02</version>
+ <version>2.1.1-Beta03-AS7-Beta03</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-jboss6</artifactId>
Modified:
sandbox/as7_support/branches/gatein-as7/wci/jboss/jboss6/src/main/java/org/gatein/wci/jboss/JB6ServletContainerContext.java
===================================================================
---
sandbox/as7_support/branches/gatein-as7/wci/jboss/jboss6/src/main/java/org/gatein/wci/jboss/JB6ServletContainerContext.java 2012-02-22
16:10:35 UTC (rev 8452)
+++
sandbox/as7_support/branches/gatein-as7/wci/jboss/jboss6/src/main/java/org/gatein/wci/jboss/JB6ServletContainerContext.java 2012-02-22
19:27:28 UTC (rev 8453)
@@ -37,12 +37,15 @@
import org.gatein.wci.RequestDispatchCallback;
import org.gatein.wci.ServletContainerVisitor;
import org.gatein.wci.WebApp;
+import org.gatein.wci.api.GateInServlet;
+import org.gatein.wci.api.GateInServletRegistrations;
import org.gatein.wci.authentication.GenericAuthentication;
import org.gatein.wci.authentication.TicketService;
import org.gatein.wci.command.CommandDispatcher;
import org.gatein.wci.impl.DefaultServletContainerFactory;
import org.gatein.wci.security.Credentials;
import org.gatein.wci.spi.ServletContainerContext;
+import org.gatein.wci.spi.WebAppContext;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
@@ -50,7 +53,9 @@
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
+import java.util.HashMap;
import java.util.HashSet;
+import java.util.Map;
import java.util.Set;
/**
@@ -71,6 +76,9 @@
/** The monitored contexts. */
private final Set<String> monitoredContexts = new HashSet<String>();
+
+ /** The monitored contexts which were manually added. */
+ private static Map<String, String> manualMonitoredContexts = new
HashMap<String, String>();
/** . */
private final Engine engine;
@@ -88,13 +96,23 @@
public Object include(ServletContext targetServletContext, HttpServletRequest request,
HttpServletResponse response,
RequestDispatchCallback callback, Object handback) throws ServletException,
IOException
- {
- return dispatcher.include(targetServletContext, request, response, callback,
handback);
- }
+ {
+ if
(manualMonitoredContexts.containsKey(targetServletContext.getServletContextName()))
+ {
+ String dispatherPath =
manualMonitoredContexts.get(targetServletContext.getServletContextName());
+ CommandDispatcher dispatcher = new CommandDispatcher(dispatherPath);
+ return dispatcher.include(targetServletContext, request, response, callback,
handback);
+ }
+ else
+ {
+ return dispatcher.include(targetServletContext, request, response, callback,
handback);
+ }
+ }
public void setCallback(Registration registration)
{
this.registration = registration;
+ GateInServletRegistrations.setServletContainerContext(this);
}
public void unsetCallback(Registration registration)
@@ -345,13 +363,18 @@
{
try
{
- log.debug("Context added " + context.getPath());
- JB6WebAppContext webAppContext = new JB6WebAppContext(context);
+ // skip if the webapp has explicitly stated it doesn't want native
registration
+ // usefull when portlets are dependent on servlet ordering
+ if (!isDisabledNativeRegistration(context.getServletContext()))
+ {
+ log.debug("Context added " + context.getPath());
+ JB6WebAppContext webAppContext = new JB6WebAppContext(context);
- //
- if (registration != null)
- {
- registration.registerWebApp(webAppContext);
+ //
+ if (registration != null)
+ {
+ registration.registerWebApp(webAppContext);
+ }
}
}
catch (Exception e)
@@ -364,9 +387,14 @@
{
try
{
- if (registration != null)
+ // skip if the webapp has explicitly stated it doesn't want native
registration
+ // usefull when portlets are dependent on servlet ordering
+ if (!isDisabledNativeRegistration(context.getServletContext()))
{
- registration.unregisterWebApp(context.getPath());
+ if (registration != null)
+ {
+ registration.unregisterWebApp(context.getPath());
+ }
}
}
catch (Exception e)
@@ -374,4 +402,49 @@
e.printStackTrace();
}
}
+
+ private boolean isDisabledNativeRegistration(ServletContext servletContext)
+ {
+ if (servletContext != null)
+ {
+ String disableWCINativeRegistration =
servletContext.getInitParameter(GateInServlet.WCIDISABLENATIVEREGISTRATION);
+ if (disableWCINativeRegistration != null &&
disableWCINativeRegistration.equalsIgnoreCase("true"))
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ @Override
+ public void registerWebApp(WebAppContext webappContext, String dispatchPath)
+ {
+ if (isDisabledNativeRegistration(webappContext.getServletContext()))
+ {
+
this.manualMonitoredContexts.put(webappContext.getServletContext().getServletContextName(),
dispatchPath);
+ registration.registerWebApp(webappContext);
+ }
+ }
+
+ @Override
+ public void unregisterWebApp(ServletContext servletContext)
+ {
+ if (isDisabledNativeRegistration(servletContext))
+ {
+ this.manualMonitoredContexts.remove(servletContext.getServletContextName());
+ //if the registration is null, then this ServletContainerContext has been stopped
already
+ //and all the registrations have already been removed.
+ if (registration != null)
+ {
+ registration.unregisterWebApp(servletContext.getContextPath());
+ }
+ }
+ }
}
Modified: sandbox/as7_support/branches/gatein-as7/wci/jboss/pom.xml
===================================================================
--- sandbox/as7_support/branches/gatein-as7/wci/jboss/pom.xml 2012-02-22 16:10:35 UTC (rev
8452)
+++ sandbox/as7_support/branches/gatein-as7/wci/jboss/pom.xml 2012-02-22 19:27:28 UTC (rev
8453)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-parent</artifactId>
- <version>2.1.0-Beta07-AS7-Beta02</version>
+ <version>2.1.1-Beta03-AS7-Beta03</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-jboss</artifactId>
Modified: sandbox/as7_support/branches/gatein-as7/wci/jetty/pom.xml
===================================================================
--- sandbox/as7_support/branches/gatein-as7/wci/jetty/pom.xml 2012-02-22 16:10:35 UTC (rev
8452)
+++ sandbox/as7_support/branches/gatein-as7/wci/jetty/pom.xml 2012-02-22 19:27:28 UTC (rev
8453)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-parent</artifactId>
- <version>2.1.0-Beta07-AS7-Beta02</version>
+ <version>2.1.1-Beta03-AS7-Beta03</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-jetty</artifactId>
Modified:
sandbox/as7_support/branches/gatein-as7/wci/jetty/src/main/java/org/gatein/wci/jetty/Jetty6ServletContainerContext.java
===================================================================
---
sandbox/as7_support/branches/gatein-as7/wci/jetty/src/main/java/org/gatein/wci/jetty/Jetty6ServletContainerContext.java 2012-02-22
16:10:35 UTC (rev 8452)
+++
sandbox/as7_support/branches/gatein-as7/wci/jetty/src/main/java/org/gatein/wci/jetty/Jetty6ServletContainerContext.java 2012-02-22
19:27:28 UTC (rev 8453)
@@ -1,7 +1,9 @@
package org.gatein.wci.jetty;
import java.io.IOException;
+import java.util.HashMap;
import java.util.HashSet;
+import java.util.Map;
import java.util.Set;
import javax.servlet.ServletContext;
@@ -13,6 +15,8 @@
import org.gatein.wci.RequestDispatchCallback;
import org.gatein.wci.ServletContainerVisitor;
import org.gatein.wci.WebApp;
+import org.gatein.wci.api.GateInServlet;
+import org.gatein.wci.api.GateInServletRegistrations;
import org.gatein.wci.authentication.GenericAuthentication;
import org.gatein.wci.command.CommandDispatcher;
import org.gatein.wci.impl.DefaultServletContainerFactory;
@@ -41,6 +45,9 @@
/** The monitored contexts. */
private final Set<String> monitoredContexts = new HashSet<String>();
+ /** The monitored contexts which were manually added. */
+ private static Map<String, String> manualMonitoredContexts = new
HashMap<String, String>();
+
private final Set<String> monitoredContextHandlerCollection = new
HashSet<String>();
/** Perform cross-context session invalidation on logout, or not */
@@ -58,13 +65,22 @@
HttpServletRequest request, HttpServletResponse response,
RequestDispatchCallback callback, Object handback)
throws ServletException, IOException
- {
- return dispatcher.include(targetServletContext, request, response,
- callback, handback);
- }
+ {
+ if
(manualMonitoredContexts.containsKey(targetServletContext.getServletContextName()))
+ {
+ String dispatherPath =
manualMonitoredContexts.get(targetServletContext.getServletContextName());
+ CommandDispatcher dispatcher = new CommandDispatcher(dispatherPath);
+ return dispatcher.include(targetServletContext, request, response, callback,
handback);
+ }
+ else
+ {
+ return dispatcher.include(targetServletContext, request, response, callback,
handback);
+ }
+ }
public void setCallback(Registration registration) {
this.registration = registration;
+ GateInServletRegistrations.setServletContainerContext(this);
}
public void unsetCallback(Registration registration) {
@@ -182,36 +198,46 @@
private void startWebAppContext(WebAppContext webappContext)
{
- try
+ try
+ {
+ // skip if the webapp has explicitly stated it doesn't want native
registration
+ // usefull when portlets are dependent on servlet ordering
+ if (!isDisabledNativeRegistration(webappContext.getServletContext()))
{
Jetty6WebAppContext context = new Jetty6WebAppContext(webappContext);
-
+
//
if (registration != null)
{
registration.registerWebApp(context);
}
}
- catch (Exception e)
- {
- e.printStackTrace();
- }
-
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+
}
private void stopWebAppContext(WebAppContext webappContext)
{
- try
+ try
+ {
+ // skip if the webapp has explicitly stated it doesn't want native
registration
+ // usefull when portlets are dependent on servlet ordering
+ if (!isDisabledNativeRegistration(webappContext.getServletContext()))
{
if (registration != null)
{
registration.unregisterWebApp(webappContext.getContextPath());
}
}
- catch (Exception e)
- {
- e.printStackTrace();
- }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
}
private void registerWebAppContext(WebAppContext wac)
@@ -302,5 +328,49 @@
//Ignore event
}
+ private boolean isDisabledNativeRegistration(ServletContext servletContext)
+ {
+ if (servletContext != null)
+ {
+ String disableWCINativeRegistration =
servletContext.getInitParameter(GateInServlet.WCIDISABLENATIVEREGISTRATION);
+ if (disableWCINativeRegistration != null &&
disableWCINativeRegistration.equalsIgnoreCase("true"))
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ @Override
+ public void registerWebApp(org.gatein.wci.spi.WebAppContext webappContext, String
dispatchPath)
+ {
+ if (isDisabledNativeRegistration(webappContext.getServletContext()))
+ {
+
this.manualMonitoredContexts.put(webappContext.getServletContext().getServletContextName(),
dispatchPath);
+ registration.registerWebApp(webappContext);
+ }
+ }
+
+ @Override
+ public void unregisterWebApp(ServletContext servletContext)
+ {
+ if (isDisabledNativeRegistration(servletContext))
+ {
+ this.manualMonitoredContexts.remove(servletContext.getServletContextName());
+ //if the registration is null, then this ServletContainerContext has been stopped
already
+ //and all the registrations have already been removed.
+ if (registration != null)
+ {
+ registration.unregisterWebApp(servletContext.getContextPath());
+ }
+ }
+ }
}
Modified: sandbox/as7_support/branches/gatein-as7/wci/pom.xml
===================================================================
--- sandbox/as7_support/branches/gatein-as7/wci/pom.xml 2012-02-22 16:10:35 UTC (rev
8452)
+++ sandbox/as7_support/branches/gatein-as7/wci/pom.xml 2012-02-22 19:27:28 UTC (rev
8453)
@@ -6,23 +6,23 @@
<groupId>org.gatein.wci</groupId>
<artifactId>wci-parent</artifactId>
- <version>2.1.0-Beta07-AS7-Beta02</version>
+ <version>2.1.1-Beta03-AS7-Beta03</version>
<packaging>pom</packaging>
<parent>
<groupId>org.gatein</groupId>
<artifactId>gatein-parent</artifactId>
- <version>1.1.0-Beta02</version>
+ <version>1.1.0-GA</version>
</parent>
<scm>
-
<
connection>scm:svn:http://anonsvn.jboss.org/repos/gatein/components/wc...
-
<
developerConnection>scm:svn:https://svn.jboss.org/repos/gatein/compone...
- <
url>http://fisheye.jboss.org/browse/gatein/components/wci/trunk/</u...
+
<
connection>scm:svn:http://anonsvn.jboss.org/repos/gatein/components/wc...
+
<
developerConnection>scm:svn:https://svn.jboss.org/repos/gatein/compone...
+
<
url>http://fisheye.jboss.org/browse/gatein/components/wci/tags/2.1.1-B...
</scm>
<properties>
- <version.gatein.common>2.0.4-Beta03</version.gatein.common>
+ <version.gatein.common>2.0.4-GA</version.gatein.common>
<version.junit>3.8.2-brew</version.junit>
<version.jboss.unit>1.2.3</version.jboss.unit>
@@ -44,7 +44,7 @@
<dependency>
<groupId>org.gatein</groupId>
<artifactId>gatein-dep</artifactId>
- <version>1.1.0-Beta06</version>
+ <version>1.1.0-GA</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Modified: sandbox/as7_support/branches/gatein-as7/wci/test/core/pom.xml
===================================================================
--- sandbox/as7_support/branches/gatein-as7/wci/test/core/pom.xml 2012-02-22 16:10:35 UTC
(rev 8452)
+++ sandbox/as7_support/branches/gatein-as7/wci/test/core/pom.xml 2012-02-22 19:27:28 UTC
(rev 8453)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-test-parent</artifactId>
- <version>2.1.0-Beta07-SNAPSHOT</version>
+ <version>2.1.1-Beta03-AS7-Beta03</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-test-core</artifactId>
Modified:
sandbox/as7_support/branches/gatein-as7/wci/test/core/src/main/java/org/gatein/wci/container/ServletContainerContextImpl.java
===================================================================
---
sandbox/as7_support/branches/gatein-as7/wci/test/core/src/main/java/org/gatein/wci/container/ServletContainerContextImpl.java 2012-02-22
16:10:35 UTC (rev 8452)
+++
sandbox/as7_support/branches/gatein-as7/wci/test/core/src/main/java/org/gatein/wci/container/ServletContainerContextImpl.java 2012-02-22
19:27:28 UTC (rev 8453)
@@ -24,6 +24,7 @@
import org.gatein.wci.security.Credentials;
import org.gatein.wci.spi.ServletContainerContext;
+import org.gatein.wci.spi.WebAppContext;
import org.gatein.wci.RequestDispatchCallback;
import javax.servlet.ServletContext;
@@ -39,45 +40,59 @@
public class ServletContainerContextImpl implements ServletContainerContext
{
- Registration registration;
+ Registration registration;
- public Object include(
- ServletContext targetServletContext,
- HttpServletRequest request,
- HttpServletResponse response,
- RequestDispatchCallback callback,
- Object handback) throws ServletException, IOException
- {
- throw new UnsupportedOperationException();
- }
+ public Object include(
+ ServletContext targetServletContext,
+ HttpServletRequest request,
+ HttpServletResponse response,
+ RequestDispatchCallback callback,
+ Object handback) throws ServletException, IOException
+ {
+ throw new UnsupportedOperationException();
+ }
- public void setCallback(Registration registration)
- {
- this.registration = registration;
- }
+ public void setCallback(Registration registration)
+ {
+ this.registration = registration;
+ }
- public void unsetCallback(Registration registration)
- {
- this.registration = null;
- }
+ public void unsetCallback(Registration registration)
+ {
+ this.registration = null;
+ }
- public void login(HttpServletRequest request, HttpServletResponse response,
Credentials credentials, long validityMillis)
- {
- throw new UnsupportedOperationException();
- }
+ public void login(HttpServletRequest request, HttpServletResponse response,
Credentials credentials, long validityMillis)
+ {
+ throw new UnsupportedOperationException();
+ }
- public void login(HttpServletRequest request, HttpServletResponse response,
Credentials credentials, long validityMillis, String initialURI)
- {
- throw new UnsupportedOperationException();
- }
+ public void login(HttpServletRequest request, HttpServletResponse response,
Credentials credentials, long validityMillis, String initialURI)
+ {
+ throw new UnsupportedOperationException();
+ }
- public void logout(HttpServletRequest request, HttpServletResponse response)
- {
- throw new UnsupportedOperationException();
- }
+ public void logout(HttpServletRequest request, HttpServletResponse response)
+ {
+ throw new UnsupportedOperationException();
+ }
- public String getContainerInfo()
- {
- return "Impl";
- }
+ public String getContainerInfo()
+ {
+ return "Impl";
+ }
+
+ @Override
+ public void registerWebApp(WebAppContext webappContext, String dispatchPath)
+ {
+ // FIXME registerWebApp
+
+ }
+
+ @Override
+ public void unregisterWebApp(ServletContext servletContext)
+ {
+ // FIXME unregisterWebApp
+
+ }
}
Modified: sandbox/as7_support/branches/gatein-as7/wci/test/pom.xml
===================================================================
--- sandbox/as7_support/branches/gatein-as7/wci/test/pom.xml 2012-02-22 16:10:35 UTC (rev
8452)
+++ sandbox/as7_support/branches/gatein-as7/wci/test/pom.xml 2012-02-22 19:27:28 UTC (rev
8453)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-parent</artifactId>
- <version>2.1.0-Beta07-AS7-Beta02</version>
+ <version>2.1.1-Beta03-AS7-Beta03</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-test-parent</artifactId>
@@ -32,6 +32,18 @@
</dependency>
<dependency>
<groupId>org.gatein.wci</groupId>
+ <artifactId>wci-test-native-skipped-portlet</artifactId>
+ <type>war</type>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.wci</groupId>
+
<artifactId>wci-test-native-skipped-with-gateinservlet-portlet</artifactId>
+ <type>war</type>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.wci</groupId>
<artifactId>wci-test-gatein-portlet</artifactId>
<type>war</type>
<version>${project.version}</version>
Modified: sandbox/as7_support/branches/gatein-as7/wci/test/portlets/exo-portlet/pom.xml
===================================================================
---
sandbox/as7_support/branches/gatein-as7/wci/test/portlets/exo-portlet/pom.xml 2012-02-22
16:10:35 UTC (rev 8452)
+++
sandbox/as7_support/branches/gatein-as7/wci/test/portlets/exo-portlet/pom.xml 2012-02-22
19:27:28 UTC (rev 8453)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-test-portlets</artifactId>
- <version>2.1.0-Beta07-AS7-Beta02</version>
+ <version>2.1.1-Beta03-AS7-Beta03</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-test-exo-portlet</artifactId>
Modified:
sandbox/as7_support/branches/gatein-as7/wci/test/portlets/gatein-portlet/pom.xml
===================================================================
---
sandbox/as7_support/branches/gatein-as7/wci/test/portlets/gatein-portlet/pom.xml 2012-02-22
16:10:35 UTC (rev 8452)
+++
sandbox/as7_support/branches/gatein-as7/wci/test/portlets/gatein-portlet/pom.xml 2012-02-22
19:27:28 UTC (rev 8453)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-test-portlets</artifactId>
- <version>2.1.0-Beta07-AS7-Beta02</version>
+ <version>2.1.1-Beta03-AS7-Beta03</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-test-gatein-portlet</artifactId>
Modified:
sandbox/as7_support/branches/gatein-as7/wci/test/portlets/native-portlet/pom.xml
===================================================================
---
sandbox/as7_support/branches/gatein-as7/wci/test/portlets/native-portlet/pom.xml 2012-02-22
16:10:35 UTC (rev 8452)
+++
sandbox/as7_support/branches/gatein-as7/wci/test/portlets/native-portlet/pom.xml 2012-02-22
19:27:28 UTC (rev 8453)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-test-portlets</artifactId>
- <version>2.1.0-Beta07-AS7-Beta02</version>
+ <version>2.1.1-Beta03-AS7-Beta03</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-test-native-portlet</artifactId>
Added:
sandbox/as7_support/branches/gatein-as7/wci/test/portlets/native-skipped-portlet/pom.xml
===================================================================
---
sandbox/as7_support/branches/gatein-as7/wci/test/portlets/native-skipped-portlet/pom.xml
(rev 0)
+++
sandbox/as7_support/branches/gatein-as7/wci/test/portlets/native-skipped-portlet/pom.xml 2012-02-22
19:27:28 UTC (rev 8453)
@@ -0,0 +1,11 @@
+<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">
+ <parent>
+ <groupId>org.gatein.wci</groupId>
+ <artifactId>wci-test-portlets</artifactId>
+ <version>2.1.1-Beta03-AS7-Beta03</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>wci-test-native-skipped-portlet</artifactId>
+ <packaging>war</packaging>
+ <name>GateIn - WCI Native Skip Test Portlet</name>
+</project>
Added:
sandbox/as7_support/branches/gatein-as7/wci/test/portlets/native-skipped-portlet/src/main/webapp/WEB-INF/web.xml
===================================================================
---
sandbox/as7_support/branches/gatein-as7/wci/test/portlets/native-skipped-portlet/src/main/webapp/WEB-INF/web.xml
(rev 0)
+++
sandbox/as7_support/branches/gatein-as7/wci/test/portlets/native-skipped-portlet/src/main/webapp/WEB-INF/web.xml 2012-02-22
19:27:28 UTC (rev 8453)
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+ <!-- Disable the Native Application Registration -->
+ <context-param>
+ <param-name>gatein.wci.native.DisableRegistration</param-name>
+ <param-value>true</param-value>
+ </context-param>
+</web-app>
+
Added:
sandbox/as7_support/branches/gatein-as7/wci/test/portlets/native-skipped-with-gateinservlet-portlet/pom.xml
===================================================================
---
sandbox/as7_support/branches/gatein-as7/wci/test/portlets/native-skipped-with-gateinservlet-portlet/pom.xml
(rev 0)
+++
sandbox/as7_support/branches/gatein-as7/wci/test/portlets/native-skipped-with-gateinservlet-portlet/pom.xml 2012-02-22
19:27:28 UTC (rev 8453)
@@ -0,0 +1,11 @@
+<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">
+ <parent>
+ <groupId>org.gatein.wci</groupId>
+ <artifactId>wci-test-portlets</artifactId>
+ <version>2.1.1-Beta03-AS7-Beta03</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
<artifactId>wci-test-native-skipped-with-gateinservlet-portlet</artifactId>
+ <packaging>war</packaging>
+ <name>GateIn - WCI Native Skip Test Portlet With GateInServlet
Registration</name>
+</project>
Added:
sandbox/as7_support/branches/gatein-as7/wci/test/portlets/native-skipped-with-gateinservlet-portlet/src/main/webapp/WEB-INF/web.xml
===================================================================
---
sandbox/as7_support/branches/gatein-as7/wci/test/portlets/native-skipped-with-gateinservlet-portlet/src/main/webapp/WEB-INF/web.xml
(rev 0)
+++
sandbox/as7_support/branches/gatein-as7/wci/test/portlets/native-skipped-with-gateinservlet-portlet/src/main/webapp/WEB-INF/web.xml 2012-02-22
19:27:28 UTC (rev 8453)
@@ -0,0 +1,49 @@
+<?xml version="1.0"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+
+ <!-- Disable the Native Application Registration -->
+ <context-param>
+ <param-name>gatein.wci.native.DisableRegistration</param-name>
+ <param-value>true</param-value>
+ </context-param>
+
+ <!-- Register Using the Generic Method -->
+ <servlet>
+ <servlet-name>GateInServlet</servlet-name>
+ <servlet-class>org.gatein.wci.api.GateInServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>GateInServlet</servlet-name>
+ <url-pattern>/gateinservlet</url-pattern>
+ </servlet-mapping>
+
+</web-app>
+
Modified: sandbox/as7_support/branches/gatein-as7/wci/test/portlets/pom.xml
===================================================================
--- sandbox/as7_support/branches/gatein-as7/wci/test/portlets/pom.xml 2012-02-22 16:10:35
UTC (rev 8452)
+++ sandbox/as7_support/branches/gatein-as7/wci/test/portlets/pom.xml 2012-02-22 19:27:28
UTC (rev 8453)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-test-parent</artifactId>
- <version>2.1.0-Beta07-AS7-Beta02</version>
+ <version>2.1.1-Beta03-AS7-Beta03</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-test-portlets</artifactId>
@@ -13,5 +13,7 @@
<module>exo-portlet</module>
<module>gatein-portlet</module>
<module>native-portlet</module>
+ <module>native-skipped-portlet</module>
+ <module>native-skipped-with-gateinservlet-portlet</module>
</modules>
</project>
Modified: sandbox/as7_support/branches/gatein-as7/wci/test/servers/jboss51/pom.xml
===================================================================
--- sandbox/as7_support/branches/gatein-as7/wci/test/servers/jboss51/pom.xml 2012-02-22
16:10:35 UTC (rev 8452)
+++ sandbox/as7_support/branches/gatein-as7/wci/test/servers/jboss51/pom.xml 2012-02-22
19:27:28 UTC (rev 8453)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-test-server-parent</artifactId>
- <version>2.1.0-Beta07-AS7-Beta02</version>
+ <version>2.1.1-Beta03-AS7-Beta03</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-test-jboss51</artifactId>
@@ -38,6 +38,18 @@
</dependency>
<dependency>
<groupId>org.gatein.wci</groupId>
+ <artifactId>wci-test-native-skipped-portlet</artifactId>
+ <scope>test</scope>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.wci</groupId>
+
<artifactId>wci-test-native-skipped-with-gateinservlet-portlet</artifactId>
+ <scope>test</scope>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.wci</groupId>
<artifactId>wci-test-gatein-portlet</artifactId>
<scope>test</scope>
<type>war</type>
@@ -375,6 +387,8 @@
<property name="test.generic.portlet.war"
value="${maven.dependency.org.gatein.wci.wci-test-gatein-portlet.war.path}"
/>
<property name="test.native.portlet.war"
value="${maven.dependency.org.gatein.wci.wci-test-native-portlet.war.path}"
/>
+ <property name="test.native-skip.portlet.war"
value="${maven.dependency.org.gatein.wci.wci-test-native-skipped-portlet.war.path}"
/>
+ <property
name="test.native-skip-with-gateinservlet.portlet.war"
value="${maven.dependency.org.gatein.wci.wci-test-native-skipped-with-gateinservlet-portlet.war.path}"
/>
<property name="test.exo.portlet.war"
value="${maven.dependency.org.gatein.wci.wci-test-exo-portlet.war.path}" />
<!-- location of common.xml shared between the different server's
build.xml -->
Modified: sandbox/as7_support/branches/gatein-as7/wci/test/servers/jboss6/pom.xml
===================================================================
--- sandbox/as7_support/branches/gatein-as7/wci/test/servers/jboss6/pom.xml 2012-02-22
16:10:35 UTC (rev 8452)
+++ sandbox/as7_support/branches/gatein-as7/wci/test/servers/jboss6/pom.xml 2012-02-22
19:27:28 UTC (rev 8453)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-test-server-parent</artifactId>
- <version>2.1.0-Beta07-AS7-Beta02</version>
+ <version>2.1.1-Beta03-AS7-Beta03</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-test-jboss6</artifactId>
@@ -34,15 +34,33 @@
<groupId>org.gatein.wci</groupId>
<artifactId>wci-test-core</artifactId>
<scope>test</scope>
- </dependency>
+ </dependency>
<dependency>
<groupId>org.gatein.wci</groupId>
+ <artifactId>wci-test-native-skipped-portlet</artifactId>
+ <scope>test</scope>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.wci</groupId>
<artifactId>wci-test-native-portlet</artifactId>
<scope>test</scope>
<type>war</type>
</dependency>
<dependency>
<groupId>org.gatein.wci</groupId>
+
<artifactId>wci-test-native-skipped-with-gateinservlet-portlet</artifactId>
+ <scope>test</scope>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.wci</groupId>
+ <artifactId>wci-test-native-portlet</artifactId>
+ <scope>test</scope>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.wci</groupId>
<artifactId>wci-test-gatein-portlet</artifactId>
<scope>test</scope>
<type>war</type>
@@ -397,6 +415,8 @@
<property name="test.generic.portlet.war"
value="${maven.dependency.org.gatein.wci.wci-test-gatein-portlet.war.path}"
/>
<property name="test.native.portlet.war"
value="${maven.dependency.org.gatein.wci.wci-test-native-portlet.war.path}"
/>
+ <property name="test.native-skip.portlet.war"
value="${maven.dependency.org.gatein.wci.wci-test-native-skipped-portlet.war.path}"
/>
+ <property
name="test.native-skip-with-gateinservlet.portlet.war"
value="${maven.dependency.org.gatein.wci.wci-test-native-skipped-with-gateinservlet-portlet.war.path}"
/>
<property name="test.exo.portlet.war"
value="${maven.dependency.org.gatein.wci.wci-test-exo-portlet.war.path}" />
<!-- location of common.xml shared between the different server's
build.xml -->
Modified: sandbox/as7_support/branches/gatein-as7/wci/test/servers/jetty6/pom.xml
===================================================================
--- sandbox/as7_support/branches/gatein-as7/wci/test/servers/jetty6/pom.xml 2012-02-22
16:10:35 UTC (rev 8452)
+++ sandbox/as7_support/branches/gatein-as7/wci/test/servers/jetty6/pom.xml 2012-02-22
19:27:28 UTC (rev 8453)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-test-server-parent</artifactId>
- <version>2.1.0-Beta07-AS7-Beta02</version>
+ <version>2.1.1-Beta03-AS7-Beta03</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-test-jetty6</artifactId>
@@ -38,6 +38,18 @@
</dependency>
<dependency>
<groupId>org.gatein.wci</groupId>
+ <artifactId>wci-test-native-skipped-portlet</artifactId>
+ <scope>test</scope>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.wci</groupId>
+
<artifactId>wci-test-native-skipped-with-gateinservlet-portlet</artifactId>
+ <scope>test</scope>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.wci</groupId>
<artifactId>wci-test-gatein-portlet</artifactId>
<scope>test</scope>
<type>war</type>
@@ -392,6 +404,9 @@
<property name="test.generic.portlet.war"
value="${maven.dependency.org.gatein.wci.wci-test-gatein-portlet.war.path}"
/>
<property name="test.native.portlet.war"
value="${maven.dependency.org.gatein.wci.wci-test-native-portlet.war.path}"
/>
<property name="test.exo.portlet.war"
value="${maven.dependency.org.gatein.wci.wci-test-exo-portlet.war.path}" />
+ <property name="test.native-skip.portlet.war"
value="${maven.dependency.org.gatein.wci.wci-test-native-skipped-portlet.war.path}"
/>
+ <property
name="test.native-skip-with-gateinservlet.portlet.war"
value="${maven.dependency.org.gatein.wci.wci-test-native-skipped-with-gateinservlet-portlet.war.path}"
/>
+ <property name="test.exo.portlet.war"
value="${maven.dependency.org.gatein.wci.wci-test-exo-portlet.war.path}" />
<!-- location of common.xml shared between the different server's
build.xml -->
<property name="common.xml.file"
value="${test.common.xml}" />
Modified: sandbox/as7_support/branches/gatein-as7/wci/test/servers/pom.xml
===================================================================
--- sandbox/as7_support/branches/gatein-as7/wci/test/servers/pom.xml 2012-02-22 16:10:35
UTC (rev 8452)
+++ sandbox/as7_support/branches/gatein-as7/wci/test/servers/pom.xml 2012-02-22 19:27:28
UTC (rev 8453)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-test-parent</artifactId>
- <version>2.1.0-Beta07-AS7-Beta02</version>
+ <version>2.1.1-Beta03-AS7-Beta03</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-test-server-parent</artifactId>
Modified:
sandbox/as7_support/branches/gatein-as7/wci/test/servers/src/common/resources/common.xml
===================================================================
---
sandbox/as7_support/branches/gatein-as7/wci/test/servers/src/common/resources/common.xml 2012-02-22
16:10:35 UTC (rev 8452)
+++
sandbox/as7_support/branches/gatein-as7/wci/test/servers/src/common/resources/common.xml 2012-02-22
19:27:28 UTC (rev 8453)
@@ -64,14 +64,15 @@
<target name="test-native" if="test.native.enable">
<property name="test.archive.path"
value="${test.apps.dir}/${test.server.name}-${test.server.version}-native"/>
- <!-- setup the generic tests -->
+ <!-- setup the native tests -->
<mkdir dir="${test.archive.path}"/>
<copy file="${test.native.portlet.war}"
tofile="${test.archive.path}/test-spi-app.war"/>
<copy file="${test.native.server.war}"
tofile="${test.archive.path}/test-spi-server.war"/>
<copy file="${test.generic.portlet.war}"
tofile="${test.archive.path}/test-generic-app.war"/>
<copy file="${test.exo.portlet.war}"
tofile="${test.archive.path}/test-exo-app.war"/>
+ <copy file="${test.native-skip.portlet.war}"
tofile="${test.archive.path}/test-native-skip-app.war"/>
+ <copy file="${test.native-skip-with-gateinservlet.portlet.war}"
tofile="${test.archive.path}/test-native-skip-with-gateinservlet-app.war"/>
-
<antcall target="tests.execute">
<param name="test.id"
value="${test.remote.server.name}-spi-native"/>
<param name="test.war"
value="${test.native.server.war}"/>
Modified: sandbox/as7_support/branches/gatein-as7/wci/test/servers/tomcat6/pom.xml
===================================================================
--- sandbox/as7_support/branches/gatein-as7/wci/test/servers/tomcat6/pom.xml 2012-02-22
16:10:35 UTC (rev 8452)
+++ sandbox/as7_support/branches/gatein-as7/wci/test/servers/tomcat6/pom.xml 2012-02-22
19:27:28 UTC (rev 8453)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-test-server-parent</artifactId>
- <version>2.1.0-Beta07-AS7-Beta02</version>
+ <version>2.1.1-Beta03-AS7-Beta03</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-test-tomcat6</artifactId>
@@ -38,6 +38,18 @@
</dependency>
<dependency>
<groupId>org.gatein.wci</groupId>
+ <artifactId>wci-test-native-skipped-portlet</artifactId>
+ <scope>test</scope>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.wci</groupId>
+
<artifactId>wci-test-native-skipped-with-gateinservlet-portlet</artifactId>
+ <scope>test</scope>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.wci</groupId>
<artifactId>wci-test-gatein-portlet</artifactId>
<scope>test</scope>
<type>war</type>
@@ -387,6 +399,8 @@
<property name="test.generic.portlet.war"
value="${maven.dependency.org.gatein.wci.wci-test-gatein-portlet.war.path}"
/>
<property name="test.native.portlet.war"
value="${maven.dependency.org.gatein.wci.wci-test-native-portlet.war.path}"
/>
+ <property name="test.native-skip.portlet.war"
value="${maven.dependency.org.gatein.wci.wci-test-native-skipped-portlet.war.path}"
/>
+ <property
name="test.native-skip-with-gateinservlet.portlet.war"
value="${maven.dependency.org.gatein.wci.wci-test-native-skipped-with-gateinservlet-portlet.war.path}"
/>
<property name="test.exo.portlet.war"
value="${maven.dependency.org.gatein.wci.wci-test-exo-portlet.war.path}" />
<!-- location of common.xml shared between the different server's
build.xml -->
Modified: sandbox/as7_support/branches/gatein-as7/wci/test/servers/tomcat7/pom.xml
===================================================================
--- sandbox/as7_support/branches/gatein-as7/wci/test/servers/tomcat7/pom.xml 2012-02-22
16:10:35 UTC (rev 8452)
+++ sandbox/as7_support/branches/gatein-as7/wci/test/servers/tomcat7/pom.xml 2012-02-22
19:27:28 UTC (rev 8453)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-test-server-parent</artifactId>
- <version>2.1.0-Beta07-AS7-Beta02</version>
+ <version>2.1.1-Beta03-AS7-Beta03</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-test-tomcat7</artifactId>
@@ -38,6 +38,18 @@
</dependency>
<dependency>
<groupId>org.gatein.wci</groupId>
+ <artifactId>wci-test-native-skipped-portlet</artifactId>
+ <scope>test</scope>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.wci</groupId>
+
<artifactId>wci-test-native-skipped-with-gateinservlet-portlet</artifactId>
+ <scope>test</scope>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.wci</groupId>
<artifactId>wci-test-gatein-portlet</artifactId>
<scope>test</scope>
<type>war</type>
@@ -381,6 +393,8 @@
<property name="test.generic.portlet.war"
value="${maven.dependency.org.gatein.wci.wci-test-gatein-portlet.war.path}"
/>
<property name="test.native.portlet.war"
value="${maven.dependency.org.gatein.wci.wci-test-native-portlet.war.path}"
/>
+ <property name="test.native-skip.portlet.war"
value="${maven.dependency.org.gatein.wci.wci-test-native-skipped-portlet.war.path}"
/>
+ <property
name="test.native-skip-with-gateinservlet.portlet.war"
value="${maven.dependency.org.gatein.wci.wci-test-native-skipped-with-gateinservlet-portlet.war.path}"
/>
<property name="test.exo.portlet.war"
value="${maven.dependency.org.gatein.wci.wci-test-exo-portlet.war.path}" />
<!-- location of common.xml shared between the different server's
build.xml -->
Modified: sandbox/as7_support/branches/gatein-as7/wci/tomcat/pom.xml
===================================================================
--- sandbox/as7_support/branches/gatein-as7/wci/tomcat/pom.xml 2012-02-22 16:10:35 UTC
(rev 8452)
+++ sandbox/as7_support/branches/gatein-as7/wci/tomcat/pom.xml 2012-02-22 19:27:28 UTC
(rev 8453)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-parent</artifactId>
- <version>2.1.0-Beta07-AS7-Beta02</version>
+ <version>2.1.1-Beta03-AS7-Beta03</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-tomcat</artifactId>
Modified: sandbox/as7_support/branches/gatein-as7/wci/tomcat/tomcat6/pom.xml
===================================================================
--- sandbox/as7_support/branches/gatein-as7/wci/tomcat/tomcat6/pom.xml 2012-02-22 16:10:35
UTC (rev 8452)
+++ sandbox/as7_support/branches/gatein-as7/wci/tomcat/tomcat6/pom.xml 2012-02-22 19:27:28
UTC (rev 8453)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-tomcat</artifactId>
- <version>2.1.0-Beta07-AS7-Beta02</version>
+ <version>2.1.1-Beta03-AS7-Beta03</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-tomcat6</artifactId>
Modified:
sandbox/as7_support/branches/gatein-as7/wci/tomcat/tomcat6/src/main/java/org/gatein/wci/tomcat/TC6ServletContainerContext.java
===================================================================
---
sandbox/as7_support/branches/gatein-as7/wci/tomcat/tomcat6/src/main/java/org/gatein/wci/tomcat/TC6ServletContainerContext.java 2012-02-22
16:10:35 UTC (rev 8452)
+++
sandbox/as7_support/branches/gatein-as7/wci/tomcat/tomcat6/src/main/java/org/gatein/wci/tomcat/TC6ServletContainerContext.java 2012-02-22
19:27:28 UTC (rev 8453)
@@ -22,6 +22,17 @@
******************************************************************************/
package org.gatein.wci.tomcat;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
import org.apache.catalina.Container;
import org.apache.catalina.ContainerEvent;
import org.apache.catalina.ContainerListener;
@@ -31,28 +42,21 @@
import org.apache.catalina.Lifecycle;
import org.apache.catalina.LifecycleEvent;
import org.apache.catalina.LifecycleListener;
+import org.apache.catalina.core.StandardContext;
import org.gatein.common.logging.Logger;
import org.gatein.common.logging.LoggerFactory;
import org.gatein.wci.RequestDispatchCallback;
import org.gatein.wci.ServletContainerVisitor;
import org.gatein.wci.WebApp;
-
+import org.gatein.wci.api.GateInServlet;
+import org.gatein.wci.api.GateInServletRegistrations;
import org.gatein.wci.authentication.GenericAuthentication;
import org.gatein.wci.command.CommandDispatcher;
import org.gatein.wci.impl.DefaultServletContainerFactory;
import org.gatein.wci.security.Credentials;
import org.gatein.wci.spi.ServletContainerContext;
-import org.apache.catalina.core.StandardContext;
+import org.gatein.wci.spi.WebAppContext;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-import java.io.IOException;
-import java.util.HashSet;
-import java.util.Set;
-
/**
* An implementation of the <code>ServletContainerContext</code> for Tomcat.
*
@@ -71,6 +75,9 @@
/** The monitored contexts. */
private final Set<String> monitoredContexts = new HashSet<String>();
+
+ /** The monitored contexts which were manually added. */
+ private static HashMap<String, String> manualMonitoredContexts = new
HashMap<String, String>();
/** . */
private final Engine engine;
@@ -96,12 +103,22 @@
RequestDispatchCallback callback,
Object handback) throws ServletException, IOException
{
- return dispatcher.include(targetServletContext, request, response, callback,
handback);
+ if
(manualMonitoredContexts.containsKey(targetServletContext.getServletContextName()))
+ {
+ String dispatherPath =
manualMonitoredContexts.get(targetServletContext.getServletContextName());
+ CommandDispatcher dispatcher = new CommandDispatcher(dispatherPath);
+ return dispatcher.include(targetServletContext, request, response, callback,
handback);
+ }
+ else
+ {
+ return dispatcher.include(targetServletContext, request, response, callback,
handback);
+ }
}
public void setCallback(Registration registration)
{
this.registration = registration;
+ GateInServletRegistrations.setServletContainerContext(this);
}
public void unsetCallback(Registration registration)
@@ -328,13 +345,19 @@
{
try
{
- log.debug("Context added " + context.getPath());
- TC6WebAppContext webAppContext = new TC6WebAppContext(context);
+ // skip if the webapp has explicitly stated it doesn't want native
registration
+ // usefull when portlets are dependent on servlet ordering
+ if (!isDisabledNativeRegistration(context.getServletContext()))
+ {
- //
- if (registration != null)
- {
- registration.registerWebApp(webAppContext);
+ log.debug("Context added " + context.getPath());
+ TC6WebAppContext webAppContext = new TC6WebAppContext(context);
+
+ //
+ if (registration != null)
+ {
+ registration.registerWebApp(webAppContext);
+ }
}
}
catch (Exception e)
@@ -347,9 +370,14 @@
{
try
{
- if (registration != null)
+ // skip if the webapp has explicitly stated it doesn't want native
registration
+ // usefull when portlets are dependent on servlet ordering
+ if (!isDisabledNativeRegistration(context.getServletContext()))
{
- registration.unregisterWebApp(context.getPath());
+ if (registration != null)
+ {
+ registration.unregisterWebApp(context.getPath());
+ }
}
}
catch (Exception e)
@@ -357,4 +385,49 @@
e.printStackTrace();
}
}
+
+ private boolean isDisabledNativeRegistration(ServletContext servletContext)
+ {
+ if (servletContext != null)
+ {
+ String disableWCINativeRegistration =
servletContext.getInitParameter(GateInServlet.WCIDISABLENATIVEREGISTRATION);
+ if (disableWCINativeRegistration != null &&
disableWCINativeRegistration.equalsIgnoreCase("true"))
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ @Override
+ public void registerWebApp(WebAppContext webappContext, String dispatchPath)
+ {
+ if (isDisabledNativeRegistration(webappContext.getServletContext()))
+ {
+
this.manualMonitoredContexts.put(webappContext.getServletContext().getServletContextName(),
dispatchPath);
+ registration.registerWebApp(webappContext);
+ }
+ }
+
+ @Override
+ public void unregisterWebApp(ServletContext servletContext)
+ {
+ if (isDisabledNativeRegistration(servletContext))
+ {
+ this.manualMonitoredContexts.remove(servletContext.getServletContextName());
+ //if the registration is null, then this ServletContainerContext has been stopped
already
+ //and all the registrations have already been removed.
+ if (registration != null)
+ {
+ registration.unregisterWebApp(servletContext.getContextPath());
+ }
+ }
+ }
}
Modified: sandbox/as7_support/branches/gatein-as7/wci/tomcat/tomcat7/pom.xml
===================================================================
--- sandbox/as7_support/branches/gatein-as7/wci/tomcat/tomcat7/pom.xml 2012-02-22 16:10:35
UTC (rev 8452)
+++ sandbox/as7_support/branches/gatein-as7/wci/tomcat/tomcat7/pom.xml 2012-02-22 19:27:28
UTC (rev 8453)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-tomcat</artifactId>
- <version>2.1.0-Beta07-AS7-Beta02</version>
+ <version>2.1.1-Beta03-AS7-Beta03</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-tomcat7</artifactId>
Modified:
sandbox/as7_support/branches/gatein-as7/wci/tomcat/tomcat7/src/main/java/org/gatein/wci/tomcat/TC7ServletContainerContext.java
===================================================================
---
sandbox/as7_support/branches/gatein-as7/wci/tomcat/tomcat7/src/main/java/org/gatein/wci/tomcat/TC7ServletContainerContext.java 2012-02-22
16:10:35 UTC (rev 8452)
+++
sandbox/as7_support/branches/gatein-as7/wci/tomcat/tomcat7/src/main/java/org/gatein/wci/tomcat/TC7ServletContainerContext.java 2012-02-22
19:27:28 UTC (rev 8453)
@@ -39,6 +39,8 @@
import org.gatein.wci.ServletContainerVisitor;
import org.gatein.wci.WebApp;
+import org.gatein.wci.api.GateInServlet;
+import org.gatein.wci.api.GateInServletRegistrations;
import org.gatein.wci.authentication.GenericAuthentication;
import org.gatein.wci.authentication.TicketService;
@@ -46,6 +48,7 @@
import org.gatein.wci.impl.DefaultServletContainerFactory;
import org.gatein.wci.security.Credentials;
import org.gatein.wci.spi.ServletContainerContext;
+import org.gatein.wci.spi.WebAppContext;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
@@ -53,7 +56,9 @@
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
+import java.util.HashMap;
import java.util.HashSet;
+import java.util.Map;
import java.util.Set;
/**
@@ -74,6 +79,9 @@
/** The monitored contexts. */
private final Set<String> monitoredContexts = new HashSet<String>();
+
+ /** The monitored contexts which were manually added. */
+ private static Map<String, String> manualMonitoredContexts = new
HashMap<String, String>();
/** . */
private final Engine engine;
@@ -96,12 +104,22 @@
RequestDispatchCallback callback,
Object handback) throws ServletException, IOException
{
- return dispatcher.include(targetServletContext, request, response, callback,
handback);
+ if
(manualMonitoredContexts.containsKey(targetServletContext.getServletContextName()))
+ {
+ String dispatherPath =
manualMonitoredContexts.get(targetServletContext.getServletContextName());
+ CommandDispatcher dispatcher = new CommandDispatcher(dispatherPath);
+ return dispatcher.include(targetServletContext, request, response, callback,
handback);
+ }
+ else
+ {
+ return dispatcher.include(targetServletContext, request, response, callback,
handback);
+ }
}
public void setCallback(Registration registration)
{
this.registration = registration;
+ GateInServletRegistrations.setServletContainerContext(this);
}
public void unsetCallback(Registration registration)
@@ -349,13 +367,18 @@
{
try
{
- log.debug("Context added " + context.getPath());
- TC7WebAppContext webAppContext = new TC7WebAppContext(context);
+ // skip if the webapp has explicitly stated it doesn't want native
registration
+ // usefull when portlets are dependent on servlet ordering
+ if (!isDisabledNativeRegistration(context.getServletContext()))
+ {
+ log.debug("Context added " + context.getPath());
+ TC7WebAppContext webAppContext = new TC7WebAppContext(context);
- //
- if (registration != null)
- {
- registration.registerWebApp(webAppContext);
+ //
+ if (registration != null)
+ {
+ registration.registerWebApp(webAppContext);
+ }
}
}
catch (Exception e)
@@ -368,9 +391,14 @@
{
try
{
- if (registration != null)
+ // skip if the webapp has explicitly stated it doesn't want native
registration
+ // usefull when portlets are dependent on servlet ordering
+ if (!isDisabledNativeRegistration(context.getServletContext()))
{
- registration.unregisterWebApp(context.getPath());
+ if (registration != null)
+ {
+ registration.unregisterWebApp(context.getPath());
+ }
}
}
catch (Exception e)
@@ -378,4 +406,49 @@
e.printStackTrace();
}
}
+
+ private boolean isDisabledNativeRegistration(ServletContext servletContext)
+ {
+ if (servletContext != null)
+ {
+ String disableWCINativeRegistration =
servletContext.getInitParameter(GateInServlet.WCIDISABLENATIVEREGISTRATION);
+ if (disableWCINativeRegistration != null &&
disableWCINativeRegistration.equalsIgnoreCase("true"))
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ @Override
+ public void registerWebApp(WebAppContext webappContext, String dispatchPath)
+ {
+ if (isDisabledNativeRegistration(webappContext.getServletContext()))
+ {
+
this.manualMonitoredContexts.put(webappContext.getServletContext().getServletContextName(),
dispatchPath);
+ registration.registerWebApp(webappContext);
+ }
+ }
+
+ @Override
+ public void unregisterWebApp(ServletContext servletContext)
+ {
+ if (isDisabledNativeRegistration(servletContext))
+ {
+ this.manualMonitoredContexts.remove(servletContext.getServletContextName());
+ //if the registration is null, then this ServletContainerContext has been stopped
already
+ //and all the registrations have already been removed.
+ if (registration != null)
+ {
+ registration.unregisterWebApp(servletContext.getContextPath());
+ }
+ }
+ }
}
Modified: sandbox/as7_support/branches/gatein-as7/wci/wci/pom.xml
===================================================================
--- sandbox/as7_support/branches/gatein-as7/wci/wci/pom.xml 2012-02-22 16:10:35 UTC (rev
8452)
+++ sandbox/as7_support/branches/gatein-as7/wci/wci/pom.xml 2012-02-22 19:27:28 UTC (rev
8453)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-parent</artifactId>
- <version>2.1.0-Beta07-AS7-Beta02</version>
+ <version>2.1.1-Beta03-AS7-Beta03</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-wci</artifactId>
Modified:
sandbox/as7_support/branches/gatein-as7/wci/wci/src/main/java/org/gatein/wci/api/GateInServlet.java
===================================================================
---
sandbox/as7_support/branches/gatein-as7/wci/wci/src/main/java/org/gatein/wci/api/GateInServlet.java 2012-02-22
16:10:35 UTC (rev 8452)
+++
sandbox/as7_support/branches/gatein-as7/wci/wci/src/main/java/org/gatein/wci/api/GateInServlet.java 2012-02-22
19:27:28 UTC (rev 8453)
@@ -25,6 +25,7 @@
import org.gatein.wci.command.CommandServlet;
import org.gatein.wci.impl.generic.GenericServletContainerContext;
import org.gatein.wci.impl.generic.GenericWebAppContext;
+import org.gatein.wci.spi.WebAppContext;
import javax.servlet.ServletException;
import javax.servlet.ServletContext;
@@ -41,6 +42,8 @@
private String contextPath;
private ServletContext servletContext;
+
+ public static final String WCIDISABLENATIVEREGISTRATION =
"gatein.wci.native.DisableRegistration";
public void init() throws ServletException
{
@@ -52,10 +55,11 @@
//
String contextPath = (String)m.invoke(servletContext);
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
- GenericWebAppContext webAppContext = new GenericWebAppContext(servletContext,
contextPath, classLoader);
+
+ WebAppContext webAppContext = new GenericWebAppContext(servletContext,
contextPath, classLoader);
- //
- GenericServletContainerContext.register(webAppContext,
"/gateinservlet");
+ GateInServletRegistrations.register(webAppContext, "/gateinservlet");
+
this.contextPath = contextPath;
this.servletContext = servletContext;
}
@@ -69,8 +73,7 @@
{
if (contextPath != null)
{
- //GenericServletContainerContext.unregister(contextPath);
- GenericServletContainerContext.unregister(servletContext);
+ GateInServletRegistrations.unregister(servletContext);
}
}
}
\ No newline at end of file
Modified:
sandbox/as7_support/branches/gatein-as7/wci/wci/src/main/java/org/gatein/wci/api/GateInServletListener.java
===================================================================
---
sandbox/as7_support/branches/gatein-as7/wci/wci/src/main/java/org/gatein/wci/api/GateInServletListener.java 2012-02-22
16:10:35 UTC (rev 8452)
+++
sandbox/as7_support/branches/gatein-as7/wci/wci/src/main/java/org/gatein/wci/api/GateInServletListener.java 2012-02-22
19:27:28 UTC (rev 8453)
@@ -45,13 +45,13 @@
GenericWebAppContext webAppContext = new GenericWebAppContext(servletContext,
contextPath, classLoader);
- GenericServletContainerContext.register(webAppContext, "/PortletWrapper");
+ GateInServletRegistrations.register(webAppContext, "/PortletWrapper");
}
public void contextDestroyed(ServletContextEvent event)
{
ServletContext servletContext = event.getServletContext();
- GenericServletContainerContext.unregister(servletContext);
+ GateInServletRegistrations.unregister(servletContext);
}
}
Added:
sandbox/as7_support/branches/gatein-as7/wci/wci/src/main/java/org/gatein/wci/api/GateInServletRegistrations.java
===================================================================
---
sandbox/as7_support/branches/gatein-as7/wci/wci/src/main/java/org/gatein/wci/api/GateInServletRegistrations.java
(rev 0)
+++
sandbox/as7_support/branches/gatein-as7/wci/wci/src/main/java/org/gatein/wci/api/GateInServletRegistrations.java 2012-02-22
19:27:28 UTC (rev 8453)
@@ -0,0 +1,99 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2011, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.gatein.wci.api;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.servlet.ServletContext;
+
+import org.gatein.wci.ServletContainer;
+import org.gatein.wci.impl.DefaultServletContainer;
+import org.gatein.wci.impl.DefaultServletContainerFactory;
+import org.gatein.wci.impl.generic.GenericWebAppContext;
+import org.gatein.wci.spi.ServletContainerContext;
+import org.gatein.wci.spi.ServletContainerContext.Registration;
+import org.gatein.wci.spi.WebAppContext;
+
+/**
+ * @author <a href="mailto:mwringe@redhat.com">Matt Wringe</a>
+ * @version $Revision$
+ */
+public class GateInServletRegistrations
+{
+ /** . */
+ private static final Map<String, WebAppContext> pendingContexts =
Collections.synchronizedMap(new LinkedHashMap<String, WebAppContext>(16, 0.5f,
false));
+ private static HashMap<ServletContext, String> requestDispatchMap = new
HashMap<ServletContext, String>();
+
+ private static ServletContainerContext servletContainerContext;
+
+ public static void register(WebAppContext webAppContext, String dispatcherPath)
+ {
+ requestDispatchMap.put(webAppContext.getServletContext(), dispatcherPath);
+
+ if (servletContainerContext != null)
+ {
+ servletContainerContext.registerWebApp(webAppContext, dispatcherPath);
+ }
+ else
+ {
+ pendingContexts.put(webAppContext.getContextPath(), webAppContext);
+ }
+ }
+
+ public static void unregister(ServletContext servletContext)
+ {
+ requestDispatchMap.remove(servletContext);
+
+ String contextPath = servletContext.getContextPath();
+
+ if (servletContainerContext != null)
+ {
+ servletContainerContext.unregisterWebApp(servletContext);
+ }
+
+ //
+ if (pendingContexts.containsKey(contextPath))
+ {
+ pendingContexts.remove(contextPath);
+ }
+ }
+
+ public static void setServletContainerContext(ServletContainerContext context)
+ {
+ servletContainerContext = context;
+
+ for (String contextPath : pendingContexts.keySet())
+ {
+ WebAppContext webAppContext = pendingContexts.get(contextPath);
+ String dispatcherPath =
requestDispatchMap.get(webAppContext.getServletContext());
+ servletContainerContext.registerWebApp(webAppContext, dispatcherPath);
+ }
+ }
+}
+
Modified:
sandbox/as7_support/branches/gatein-as7/wci/wci/src/main/java/org/gatein/wci/endpoint/EndPointServlet.java
===================================================================
---
sandbox/as7_support/branches/gatein-as7/wci/wci/src/main/java/org/gatein/wci/endpoint/EndPointServlet.java 2012-02-22
16:10:35 UTC (rev 8452)
+++
sandbox/as7_support/branches/gatein-as7/wci/wci/src/main/java/org/gatein/wci/endpoint/EndPointServlet.java 2012-02-22
19:27:28 UTC (rev 8453)
@@ -44,6 +44,7 @@
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpression;
+import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import java.io.IOException;
import java.io.InputStream;
@@ -122,7 +123,13 @@
//
try
{
- Document doc =
XMLTools.getDocumentBuilderFactory().newDocumentBuilder().parse(new
ByteArrayInputStream(bytes));
+ DocumentBuilderFactory factory = XMLTools.getDocumentBuilderFactory();
+ factory.setValidating(false);
+
factory.setFeature("http://xml.org/sax/features/namespaces", false);
+
factory.setFeature("http://xml.org/sax/features/validation", false);
+
factory.setFeature("http://apache.org/xml/features/nonvalidating/loa...;,
false);
+
factory.setFeature("http://apache.org/xml/features/nonvalidating/loa...;,
false);
+ Document doc = factory.newDocumentBuilder().parse(new
ByteArrayInputStream(bytes));
//
NodeList nodes = (NodeList)expr.evaluate(doc, XPathConstants.NODESET);
Modified:
sandbox/as7_support/branches/gatein-as7/wci/wci/src/main/java/org/gatein/wci/impl/DefaultServletContainer.java
===================================================================
---
sandbox/as7_support/branches/gatein-as7/wci/wci/src/main/java/org/gatein/wci/impl/DefaultServletContainer.java 2012-02-22
16:10:35 UTC (rev 8452)
+++
sandbox/as7_support/branches/gatein-as7/wci/wci/src/main/java/org/gatein/wci/impl/DefaultServletContainer.java 2012-02-22
19:27:28 UTC (rev 8453)
@@ -354,37 +354,27 @@
{
throw new IllegalStateException("Disposed registration");
}
-
- if (webAppId == null)
+ synchronized (container.lock)
{
- throw new IllegalArgumentException("No null web app id accepted");
- }
+ if (webAppId == null)
+ {
+ throw new IllegalArgumentException("No null web app id
accepted");
+ }
- WebAppImpl webApp = container.webAppMap.get(webAppId);
- if (webApp == null)
- {
- log.debug("Web application " + webAppId + " was not
registered");
- return false;
- }
- // lock context before locking container to prevent deadlocks
- synchronized (webApp.context)
- {
- synchronized (container.lock)
+ //
+ WebAppImpl webApp = container.webAppMap.remove(webAppId);
+ if (webApp != null)
{
- webApp = container.webAppMap.remove(webAppId);
- if (webApp != null)
- {
- log.debug("Web application " + webAppId + "
cleanup");
- container.fireEvent(new WebAppLifeCycleEvent(webApp,
WebAppLifeCycleEvent.REMOVED));
- webApp.context.stop();
- return true;
- }
- else
- {
- log.debug("Web application " + webAppId + " was not
registered");
- return false;
- }
+ log.debug("Web application " + webAppId + "
cleanup");
+ container.fireEvent(new WebAppLifeCycleEvent(webApp,
WebAppLifeCycleEvent.REMOVED));
+ webApp.context.stop();
+ return true;
}
+ else
+ {
+ log.debug("Web application " + webAppId + " was not
registered");
+ return false;
+ }
}
}
Modified:
sandbox/as7_support/branches/gatein-as7/wci/wci/src/main/java/org/gatein/wci/impl/generic/GenericServletContainerContext.java
===================================================================
---
sandbox/as7_support/branches/gatein-as7/wci/wci/src/main/java/org/gatein/wci/impl/generic/GenericServletContainerContext.java 2012-02-22
16:10:35 UTC (rev 8452)
+++
sandbox/as7_support/branches/gatein-as7/wci/wci/src/main/java/org/gatein/wci/impl/generic/GenericServletContainerContext.java 2012-02-22
19:27:28 UTC (rev 8453)
@@ -23,10 +23,13 @@
package org.gatein.wci.impl.generic;
import org.gatein.wci.RequestDispatchCallback;
+import org.gatein.wci.api.GateInServletRegistrations;
import org.gatein.wci.authentication.GenericAuthentication;
+import org.gatein.wci.impl.DefaultServletContainer;
import org.gatein.wci.impl.DefaultServletContainerFactory;
import org.gatein.wci.security.Credentials;
import org.gatein.wci.spi.ServletContainerContext;
+import org.gatein.wci.spi.WebAppContext;
import org.gatein.wci.command.CommandDispatcher;
import javax.servlet.ServletContext;
@@ -46,11 +49,7 @@
*/
public class GenericServletContainerContext implements ServletContainerContext,
ServletContextListener
{
-
/** . */
- private static final Map<String, GenericWebAppContext> pendingContexts =
Collections.synchronizedMap(new HashMap<String, GenericWebAppContext>());
-
- /** . */
private static GenericServletContainerContext instance;
private static HashMap<ServletContext, String> requestDispatchMap = new
HashMap<ServletContext, String>();
@@ -70,37 +69,6 @@
{
}
- public static void register(GenericWebAppContext webAppContext, String
dispatcherPath)
- {
- requestDispatchMap.put(webAppContext.getServletContext(), dispatcherPath);
- if (instance != null && instance.registration != null)
- {
- instance.registration.registerWebApp(webAppContext);
- }
- else
- {
- pendingContexts.put(webAppContext.getContextPath(), webAppContext);
- }
- }
-
- public static void unregister(ServletContext servletContext)
- {
- requestDispatchMap.remove(servletContext);
-
- String contextPath = servletContext.getContextPath();
-
- if (instance != null && instance.registration != null)
- {
- instance.registration.unregisterWebApp(contextPath);
- }
-
- //
- if (pendingContexts.containsKey(contextPath))
- {
- pendingContexts.remove(contextPath);
- }
- }
-
/** . */
public Object include(
@@ -119,12 +87,7 @@
public void setCallback(Registration registration)
{
this.registration = registration;
-
- //
- for (GenericWebAppContext pendingContext : pendingContexts.values())
- {
- registration.registerWebApp(pendingContext);
- }
+ GateInServletRegistrations.setServletContainerContext(this);
}
public void unsetCallback(Registration registration)
@@ -172,4 +135,18 @@
{
// Should we really do something ?
}
+
+ @Override
+ public void registerWebApp(WebAppContext webappContext, String dispatcherPath)
+ {
+ requestDispatchMap.put(webappContext.getServletContext(), dispatcherPath);
+ instance.registration.registerWebApp(webappContext);
+ }
+
+ @Override
+ public void unregisterWebApp(ServletContext servletContext)
+ {
+ requestDispatchMap.remove(servletContext);
+ instance.registration.unregisterWebApp(servletContext.getContextPath());
+ }
}
\ No newline at end of file
Modified:
sandbox/as7_support/branches/gatein-as7/wci/wci/src/main/java/org/gatein/wci/security/WCILoginController.java
===================================================================
---
sandbox/as7_support/branches/gatein-as7/wci/wci/src/main/java/org/gatein/wci/security/WCILoginController.java 2012-02-22
16:10:35 UTC (rev 8452)
+++
sandbox/as7_support/branches/gatein-as7/wci/wci/src/main/java/org/gatein/wci/security/WCILoginController.java 2012-02-22
19:27:28 UTC (rev 8453)
@@ -43,7 +43,7 @@
String password = req.getParameter("password");
if (
- req.getSession().getAttribute(Credentials.CREDENTIALS) != null
+ getCredentials(req) != null
&& username == null
&& password == null
) return;
@@ -52,9 +52,9 @@
if (username != null && password != null)
{
- log.debug("Found username and password and set credentials in http
session");
+ log.debug("Found username and password. Save credentials for later
use.");
Credentials credentials = new Credentials(username, password);
- req.getSession().setAttribute(Credentials.CREDENTIALS, credentials);
+ setCredentials(req, credentials);
}
}
@@ -62,4 +62,14 @@
{
doGet(req, resp);
}
+
+ protected Credentials getCredentials(HttpServletRequest req)
+ {
+ return (Credentials)req.getSession().getAttribute(Credentials.CREDENTIALS);
+ }
+
+ protected void setCredentials(HttpServletRequest req, Credentials credentials)
+ {
+ req.getSession().setAttribute(Credentials.CREDENTIALS, credentials);
+ }
}
Modified:
sandbox/as7_support/branches/gatein-as7/wci/wci/src/main/java/org/gatein/wci/spi/ServletContainerContext.java
===================================================================
---
sandbox/as7_support/branches/gatein-as7/wci/wci/src/main/java/org/gatein/wci/spi/ServletContainerContext.java 2012-02-22
16:10:35 UTC (rev 8452)
+++
sandbox/as7_support/branches/gatein-as7/wci/wci/src/main/java/org/gatein/wci/spi/ServletContainerContext.java 2012-02-22
19:27:28 UTC (rev 8453)
@@ -43,111 +43,126 @@
*/
public interface ServletContainerContext
{
- /**
- * Generic detyped request dispatch to a servlet context using the include mechanism.
- *
- * @param targetServletContext the target servlet context to dispatch to
- * @param request the request valid in the current servlet context
- * @param response the response valid in the current servlet context
- * @param callback the callback to perform after the dispatch operation
- * @param handback the handback object that will be provided to the callback
- * @return the object returned by the callback
- * @throws ServletException any servlet exception
- * @throws IOException any io exception
- */
- Object include(
- ServletContext targetServletContext, HttpServletRequest request,
- HttpServletResponse response,
- RequestDispatchCallback callback,
- Object handback) throws ServletException, IOException;
+ /**
+ * Generic detyped request dispatch to a servlet context using the include
mechanism.
+ *
+ * @param targetServletContext the target servlet context to dispatch to
+ * @param request the request valid in the current servlet context
+ * @param response the response valid in the current servlet context
+ * @param callback the callback to perform after the dispatch operation
+ * @param handback the handback object that will be provided to the callback
+ * @return the object returned by the callback
+ * @throws ServletException any servlet exception
+ * @throws IOException any io exception
+ */
+ Object include(
+ ServletContext targetServletContext, HttpServletRequest request,
+ HttpServletResponse response,
+ RequestDispatchCallback callback,
+ Object handback) throws ServletException, IOException;
- /**
- * Install the call back object.
- *
- * @param registration the call back
- */
- void setCallback(Registration registration);
+ /**
+ * Install the call back object.
+ *
+ * @param registration the call back
+ */
+ void setCallback(Registration registration);
- /**
- * Uninstall the call back object.
- *
- * @param registration the call back
- */
- void unsetCallback(Registration registration);
+ /**
+ * Uninstall the call back object.
+ *
+ * @param registration the call back
+ */
+ void unsetCallback(Registration registration);
- /**
- * Authentication support.
- *
- * @param request the request valid in the current servlet context
- * @param response the response valid in the current servlet context
- * @param credentials the credentials which try to authenticate
- * @param validityMillis the validity of the authentication
- */
- void login(HttpServletRequest request, HttpServletResponse response, Credentials
credentials, long validityMillis) throws ServletException, IOException;
+ /**
+ * Manually register a webapp with this ServletContainerContext.
+ *
+ * @param webappContext the WebAppContext associated with the application
+ * @param dispathPath the path to be used
+ */
+ void registerWebApp(WebAppContext webappContext, String dispatchPath);
- /**
- * Authentication support.
- *
- * @param request the request valid in the current servlet context
- * @param response the response valid in the current servlet context
- * @param credentials the credentials which try to authenticate
- * @param validityMillis the validity of the authentication
- */
- void login(HttpServletRequest request, HttpServletResponse response, Credentials
credentials, long validityMillis, String initialURI) throws ServletException,
IOException;
+ /**
+ * Manually unregister a webapp associated with this ServletContainerContext.
+ *
+ * @param servletContext the servletContext of the application to be deregistered
+ */
+ void unregisterWebApp(ServletContext servletContext);
- /**
- * Authentication support.
- *
- * @param request the request valid in the current servlet context
- * @param response the response valid in the current servlet context
- */
- void logout(HttpServletRequest request, HttpServletResponse response) throws
ServletException;
+ /**
+ * Authentication support.
+ *
+ * @param request the request valid in the current servlet context
+ * @param response the response valid in the current servlet context
+ * @param credentials the credentials which try to authenticate
+ * @param validityMillis the validity of the authentication
+ */
+ void login(HttpServletRequest request, HttpServletResponse response, Credentials
credentials, long validityMillis) throws ServletException, IOException;
- /**
- * Returns the name and version of the servlet container in which the
- * context is running.
- *
- * <P>
- * The form of the returned string is
<code>containername/versionnumber</code>.
- *
- *
- * @return the string containing at least name and version number
- */
- public String getContainerInfo();
+ /**
+ * Authentication support.
+ *
+ * @param request the request valid in the current servlet context
+ * @param response the response valid in the current servlet context
+ * @param credentials the credentials which try to authenticate
+ * @param validityMillis the validity of the authentication
+ */
+ void login(HttpServletRequest request, HttpServletResponse response, Credentials
credentials, long validityMillis, String initialURI) throws ServletException,
IOException;
- /**
- * The callback interface that a servlet container context can obtain from its
registration against
- * the <code>org.jboss.portal.web.ServletContainer</code> singleton.
- */
- interface Registration
- {
+ /**
+ * Authentication support.
+ *
+ * @param request the request valid in the current servlet context
+ * @param response the response valid in the current servlet context
+ */
+ void logout(HttpServletRequest request, HttpServletResponse response) throws
ServletException;
- /**
- * Registers a web application.
- *
- * @param webAppContext the web application context
- * @return true if the registration was done
- * @throws IllegalArgumentException if the argument is null
- * @throws IllegalStateException if the registration is cancelled
- */
- boolean registerWebApp(WebAppContext webAppContext) throws IllegalStateException,
IllegalArgumentException;
+ /**
+ * Returns the name and version of the servlet container in which the
+ * context is running.
+ *
+ * <P>
+ * The form of the returned string is
<code>containername/versionnumber</code>.
+ *
+ *
+ * @return the string containing at least name and version number
+ */
+ public String getContainerInfo();
- /**
- * Unregister a web application.
- *
- * @param contextPath the web application id
- * @return true if the unregistration was done
- * @throws IllegalArgumentException if the argument is null
- * @throws IllegalStateException if the registration is cancelled
- */
- boolean unregisterWebApp(String contextPath) throws IllegalStateException,
IllegalArgumentException;
+ /**
+ * The callback interface that a servlet container context can obtain from its
registration against
+ * the <code>org.jboss.portal.web.ServletContainer</code> singleton.
+ */
+ interface Registration
+ {
- /**
- * Cancel the registration against the servlet container.
- *
- * @throws IllegalStateException if the registration is cancelled
- */
- void cancel() throws IllegalStateException;
- }
+ /**
+ * Registers a web application.
+ *
+ * @param webAppContext the web application context
+ * @return true if the registration was done
+ * @throws IllegalArgumentException if the argument is null
+ * @throws IllegalStateException if the registration is cancelled
+ */
+ boolean registerWebApp(WebAppContext webAppContext) throws IllegalStateException,
IllegalArgumentException;
+ /**
+ * Unregister a web application.
+ *
+ * @param contextPath the web application id
+ * @return true if the unregistration was done
+ * @throws IllegalArgumentException if the argument is null
+ * @throws IllegalStateException if the registration is cancelled
+ */
+ boolean unregisterWebApp(String contextPath) throws IllegalStateException,
IllegalArgumentException;
+
+ /**
+ * Cancel the registration against the servlet container.
+ *
+ * @throws IllegalStateException if the registration is cancelled
+ */
+ void cancel() throws IllegalStateException;
+ }
+
}