gatein SVN: r222 - components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168.
by do-not-reply@jboss.org
Author: mwringe
Date: 2009-10-01 00:23:52 -0400 (Thu, 01 Oct 2009)
New Revision: 222
Modified:
components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/PortletUtils.java
Log:
Enforce that the namespace starts with a letter.
Modified: components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/PortletUtils.java
===================================================================
--- components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/PortletUtils.java 2009-10-01 04:09:06 UTC (rev 221)
+++ components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/PortletUtils.java 2009-10-01 04:23:52 UTC (rev 222)
@@ -104,6 +104,7 @@
{
int length = windowId.length();
StringBuffer tmp = new StringBuffer(length + 10);
+ tmp.append('G');
for (int i = windowId.lastIndexOf(SLASH) + 1; i < length; i++)
{
char c = windowId.charAt(i);
15 years, 2 months
gatein SVN: r221 - in components/wci/trunk: jetty and 2 other directories.
by do-not-reply@jboss.org
Author: mwringe
Date: 2009-10-01 00:09:06 -0400 (Thu, 01 Oct 2009)
New Revision: 221
Modified:
components/wci/trunk/exo/
components/wci/trunk/jetty/
components/wci/trunk/test/
components/wci/trunk/tomcat/
Log:
Add target directories to svn ignore.
Property changes on: components/wci/trunk/exo
___________________________________________________________________
Name: svn:ignore
+ target
Property changes on: components/wci/trunk/jetty
___________________________________________________________________
Name: svn:ignore
+ target
Property changes on: components/wci/trunk/test
___________________________________________________________________
Name: svn:ignore
+ target
Property changes on: components/wci/trunk/tomcat
___________________________________________________________________
Name: svn:ignore
+ target
15 years, 2 months
gatein SVN: r220 - in components/wci/trunk: build and 34 other directories.
by do-not-reply@jboss.org
Author: mwringe
Date: 2009-09-30 23:58:59 -0400 (Wed, 30 Sep 2009)
New Revision: 220
Added:
components/wci/trunk/.settings/
components/wci/trunk/exo/
components/wci/trunk/exo/pom.xml
components/wci/trunk/exo/src/
components/wci/trunk/exo/src/main/
components/wci/trunk/exo/src/main/java/
components/wci/trunk/exo/src/main/java/org/
components/wci/trunk/exo/src/main/java/org/exoplatform/
components/wci/trunk/exo/src/main/java/org/exoplatform/services/
components/wci/trunk/exo/src/main/java/org/exoplatform/services/portletcontainer/
components/wci/trunk/exo/src/main/java/org/exoplatform/services/portletcontainer/impl/
components/wci/trunk/exo/src/main/java/org/exoplatform/services/portletcontainer/impl/servlet/
components/wci/trunk/exo/src/main/java/org/exoplatform/services/portletcontainer/impl/servlet/PortletApplicationListener.java
components/wci/trunk/exo/src/main/java/org/exoplatform/services/portletcontainer/impl/servlet/ServletWrapper.java
components/wci/trunk/jetty/
components/wci/trunk/jetty/pom.xml
components/wci/trunk/jetty/src/
components/wci/trunk/jetty/src/main/
components/wci/trunk/jetty/src/main/java/
components/wci/trunk/jetty/src/main/java/org/
components/wci/trunk/jetty/src/main/java/org/gatein/
components/wci/trunk/jetty/src/main/java/org/gatein/wci/
components/wci/trunk/jetty/src/main/java/org/gatein/wci/jetty/
components/wci/trunk/jetty/src/main/java/org/gatein/wci/jetty/Jetty6Handler.java
components/wci/trunk/jetty/src/main/java/org/gatein/wci/jetty/Jetty6ServletContainerContext.java
components/wci/trunk/jetty/src/main/java/org/gatein/wci/jetty/Jetty6WebAppContext.java
components/wci/trunk/test/
components/wci/trunk/test/.project
components/wci/trunk/test/pom.xml
components/wci/trunk/test/src/
components/wci/trunk/test/src/test/
components/wci/trunk/test/src/test/build.xml
components/wci/trunk/test/src/test/java/
components/wci/trunk/test/src/test/resources/
components/wci/trunk/tomcat/
components/wci/trunk/tomcat/pom.xml
components/wci/trunk/tomcat/src/
components/wci/trunk/tomcat/src/main/
components/wci/trunk/tomcat/src/main/java/
components/wci/trunk/tomcat/src/main/java/org/
components/wci/trunk/tomcat/src/main/java/org/gatein/
components/wci/trunk/tomcat/src/main/java/org/gatein/wci/
components/wci/trunk/tomcat/src/main/java/org/gatein/wci/tomcat/
components/wci/trunk/tomcat/src/main/java/org/gatein/wci/tomcat/TC6ContainerServlet.java
components/wci/trunk/tomcat/src/main/java/org/gatein/wci/tomcat/TC6LifecycleListener.java
components/wci/trunk/tomcat/src/main/java/org/gatein/wci/tomcat/TC6ServletContainerContext.java
components/wci/trunk/tomcat/src/main/java/org/gatein/wci/tomcat/TC6WebAppContext.java
components/wci/trunk/wci/src/main/java/org/gatein/wci/api/GateInServletListener.java
Removed:
components/wci/trunk/wci/src/main/java/org/gatein/wci/impl/jetty/
components/wci/trunk/wci/src/main/java/org/gatein/wci/impl/tomcat/
components/wci/trunk/wci/src/test/build.xml
components/wci/trunk/wci/src/test/java/
components/wci/trunk/wci/src/test/resources/
Modified:
components/wci/trunk/build/pom.xml
components/wci/trunk/pom.xml
components/wci/trunk/wci/pom.xml
components/wci/trunk/wci/src/main/java/org/gatein/wci/api/GateInServlet.java
components/wci/trunk/wci/src/main/java/org/gatein/wci/impl/generic/GenericServletContainerContext.java
Log:
Split up wci component into multiple submodules.
Modified: components/wci/trunk/build/pom.xml
===================================================================
--- components/wci/trunk/build/pom.xml 2009-10-01 03:25:02 UTC (rev 219)
+++ components/wci/trunk/build/pom.xml 2009-10-01 03:58:59 UTC (rev 220)
@@ -23,6 +23,9 @@
<name>GateIn - Web Container Integration component (parent)</name>
<properties>
+ <maven.compiler.source>1.5</maven.compiler.source>
+ <maven.compiler.target>1.5</maven.compiler.target>
+
<version.concurrent>1.3.4</version.concurrent>
<version.servlet.api>2.5</version.servlet.api>
<version.apache.tomcat>6.0.16</version.apache.tomcat>
Added: components/wci/trunk/exo/pom.xml
===================================================================
--- components/wci/trunk/exo/pom.xml (rev 0)
+++ components/wci/trunk/exo/pom.xml 2009-10-01 03:58:59 UTC (rev 220)
@@ -0,0 +1,25 @@
+<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>module-parent</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ <relativePath>../build/pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>wci-exo</artifactId>
+ <packaging>jar</packaging>
+ <name>GateIn - WCI eXo backwards compatibility component</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.gatein.wci</groupId>
+ <artifactId>wci-wci</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+ <properties>
+ </properties>
+
+</project>
Added: components/wci/trunk/exo/src/main/java/org/exoplatform/services/portletcontainer/impl/servlet/PortletApplicationListener.java
===================================================================
--- components/wci/trunk/exo/src/main/java/org/exoplatform/services/portletcontainer/impl/servlet/PortletApplicationListener.java (rev 0)
+++ components/wci/trunk/exo/src/main/java/org/exoplatform/services/portletcontainer/impl/servlet/PortletApplicationListener.java 2009-10-01 03:58:59 UTC (rev 220)
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.services.portletcontainer.impl.servlet;
+
+import javax.servlet.ServletContextEvent;
+import org.gatein.wci.api.GateInServletListener;
+
+/**
+ * <p>This class is used as a wrapper around the GateInServletListener. This class
+ * only exists to provide backwards compatiblity for portlets that have been setup to be
+ * deployable on versions of eXo portal.</p>
+ *
+ * @author <a href="mailto:mwringe@redhat.com">Matt Wringe</a>
+ * @version $Revision$
+ */
+public class PortletApplicationListener extends GateInServletListener {
+}
Added: components/wci/trunk/exo/src/main/java/org/exoplatform/services/portletcontainer/impl/servlet/ServletWrapper.java
===================================================================
--- components/wci/trunk/exo/src/main/java/org/exoplatform/services/portletcontainer/impl/servlet/ServletWrapper.java (rev 0)
+++ components/wci/trunk/exo/src/main/java/org/exoplatform/services/portletcontainer/impl/servlet/ServletWrapper.java 2009-10-01 03:58:59 UTC (rev 220)
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.services.portletcontainer.impl.servlet;
+
+import org.gatein.wci.command.CommandServlet;
+
+/**
+ * This class is just an empty wrapper around the generic bootstrap servlet. This class
+ * exists to provide backwards compatiblity with portlets that were deployable with the eXo portal.
+ *
+ * @author <a href="mailto:mwringe@redhat.com">Matt Wringe</a>
+ * @version $Revision$
+ */
+public class ServletWrapper extends CommandServlet {
+
+}
Added: components/wci/trunk/jetty/pom.xml
===================================================================
--- components/wci/trunk/jetty/pom.xml (rev 0)
+++ components/wci/trunk/jetty/pom.xml 2009-10-01 03:58:59 UTC (rev 220)
@@ -0,0 +1,25 @@
+<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>module-parent</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ <relativePath>../build/pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>wci-jetty</artifactId>
+ <packaging>jar</packaging>
+ <name>GateIn - WCI Jetty compatibility component</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.gatein.wci</groupId>
+ <artifactId>wci-wci</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+ <properties>
+ </properties>
+
+</project>
Copied: components/wci/trunk/jetty/src/main/java/org/gatein/wci/jetty/Jetty6Handler.java (from rev 217, components/wci/trunk/wci/src/main/java/org/gatein/wci/impl/jetty/Jetty6Handler.java)
===================================================================
--- components/wci/trunk/jetty/src/main/java/org/gatein/wci/jetty/Jetty6Handler.java (rev 0)
+++ components/wci/trunk/jetty/src/main/java/org/gatein/wci/jetty/Jetty6Handler.java 2009-10-01 03:58:59 UTC (rev 220)
@@ -0,0 +1,47 @@
+//package org.jboss.portal.web.impl.jetty;
+//
+//import java.io.IOException;
+//
+//import javax.servlet.ServletException;
+//import javax.servlet.http.HttpServletRequest;
+//import javax.servlet.http.HttpServletResponse;
+//
+//import org.mortbay.jetty.Server;
+//import org.mortbay.jetty.handler.AbstractHandler;
+//
+//public class Jetty6Handler extends AbstractHandler
+//{
+// Server server;
+// Jetty6ServletContainerContext containerContext;
+//
+// public Jetty6Handler (Server server)
+// {
+// this.server = server;
+// System.out.println("SERVER : " + server);
+// server.addHandler(this);
+// }
+//
+// protected void doStart() throws Exception {
+// super.doStart();
+// containerContext = new Jetty6ServletContainerContext(server);
+// containerContext.start();
+// }
+//
+// protected void doStop() throws Exception {
+// super.doStop();
+//
+// if (containerContext != null)
+// {
+// containerContext.stop();
+// containerContext = null;
+// }
+// }
+//
+// public void handle(String target, HttpServletRequest request,
+// HttpServletResponse response, int dispatch) throws IOException,
+// ServletException {
+// // Do Nothing for now. This doesn't actually handle anything, but needs to be a handler
+// // to tie in the jetty lifecycle and to be able to have access to the server object..
+// }
+//
+//}
\ No newline at end of file
Copied: components/wci/trunk/jetty/src/main/java/org/gatein/wci/jetty/Jetty6ServletContainerContext.java (from rev 217, components/wci/trunk/wci/src/main/java/org/gatein/wci/impl/jetty/Jetty6ServletContainerContext.java)
===================================================================
--- components/wci/trunk/jetty/src/main/java/org/gatein/wci/jetty/Jetty6ServletContainerContext.java (rev 0)
+++ components/wci/trunk/jetty/src/main/java/org/gatein/wci/jetty/Jetty6ServletContainerContext.java 2009-10-01 03:58:59 UTC (rev 220)
@@ -0,0 +1,255 @@
+//package org.jboss.portal.web.impl.jetty;
+//
+//import java.io.IOException;
+//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 org.jboss.portal.web.RequestDispatchCallback;
+//import org.jboss.portal.web.command.CommandDispatcher;
+//import org.jboss.portal.web.impl.DefaultServletContainerFactory;
+//import org.jboss.portal.web.spi.ServletContainerContext;
+//import org.mortbay.component.Container;
+//import org.mortbay.component.LifeCycle;
+//import org.mortbay.component.LifeCycle.Listener;
+//import org.mortbay.component.Container.Relationship;
+//import org.mortbay.jetty.Handler;
+//import org.mortbay.jetty.Server;
+//import org.mortbay.jetty.handler.ContextHandlerCollection;
+//import org.mortbay.jetty.webapp.WebAppContext;
+//
+//public class Jetty6ServletContainerContext implements ServletContainerContext, org.mortbay.component.Container.Listener, LifeCycle.Listener
+//{
+//
+// private Registration registration;
+//
+// private Container container;
+// private Server server;
+// private ContextHandlerCollection chc;
+//
+// /** The monitored contexts. */
+// private final Set<String> monitoredContexts = new HashSet<String>();
+//
+// private final Set<String> monitoredContextHandlerCollection = new HashSet<String>();
+//
+// public Jetty6ServletContainerContext(Server server) {
+// this.server = server;
+// this.container = server.getContainer();
+// }
+//
+// /** . */
+// private final CommandDispatcher dispatcher = new CommandDispatcher();
+//
+// public Object include(ServletContext targetServletContext,
+// HttpServletRequest request, HttpServletResponse response,
+// RequestDispatchCallback callback, Object handback)
+// throws ServletException, IOException
+// {
+// return dispatcher.include(targetServletContext, request, response,
+// callback, handback);
+// }
+//
+// public void setCallback(Registration registration) {
+// this.registration = registration;
+// }
+//
+// public void unsetCallback(Registration registration) {
+// this.registration = null;
+// }
+//
+//
+// public void start()
+// {
+// DefaultServletContainerFactory.registerContext(this);
+//
+// Handler[] children = server.getChildHandlersByClass(ContextHandlerCollection.class);
+// for (int i = 0; i < children.length; i++)
+// {
+// ContextHandlerCollection chc = (ContextHandlerCollection)children[i];
+// registerContextHandlerCollection(chc);
+// }
+// container.addEventListener(this);
+// }
+//
+// public void stop()
+// {
+// container.removeEventListener(this);
+//
+// Handler[] children = server.getChildHandlersByClass(ContextHandlerCollection.class);
+// for (int i=0; i< children.length; i++)
+// {
+// ContextHandlerCollection chc = (ContextHandlerCollection)children[i];
+// unregisterContextHandlerCollection(chc);
+// }
+//
+// registration.cancel();
+// registration = null;
+// }
+//
+// public void addBean(Object bean)
+// {
+// if (bean instanceof ContextHandlerCollection)
+// {
+// ContextHandlerCollection chc = (ContextHandlerCollection)bean;
+// registerContextHandlerCollection(chc);
+// }
+// else if (bean instanceof WebAppContext)
+// {
+// WebAppContext wac = (WebAppContext)bean;
+// registerWebAppContext(wac);
+// }
+// }
+//
+// public void removeBean(Object bean)
+// {
+// if (bean instanceof ContextHandlerCollection)
+// {
+// ContextHandlerCollection chc = (ContextHandlerCollection)bean;
+// unregisterContextHandlerCollection(chc);
+// }
+// else if (bean instanceof WebAppContext)
+// {
+// WebAppContext wac = (WebAppContext)bean;
+// unregisterWebAppContext(wac);
+// }
+// }
+//
+// public void add(Relationship relationship)
+// {
+// //ignore event for now
+// }
+//
+// public void remove(Relationship relationship)
+// {
+// //ignore event for now
+// }
+//
+// private void startWebAppContext(WebAppContext webappContext)
+// {
+// try
+// {
+// Jetty6WebAppContext context = new Jetty6WebAppContext(webappContext);
+//
+// //
+// if (registration != null)
+// {
+// registration.registerWebApp(context);
+// }
+// }
+// catch (Exception e)
+// {
+// e.printStackTrace();
+// }
+//
+// }
+//
+// private void stopWebAppContext(WebAppContext webappContext)
+// {
+// try
+// {
+// if (registration != null)
+// {
+// registration.unregisterWebApp(webappContext.getContextPath());
+// }
+// }
+// catch (Exception e)
+// {
+// e.printStackTrace();
+// }
+// }
+//
+// private void registerWebAppContext(WebAppContext wac)
+// {
+// // using servletContext since its the standard object and not jetty specific
+// // (need standard object when using ServletContextListener).
+// if (!monitoredContexts.contains(wac.getServletContext().getServletContextName()))
+// {
+// wac.addLifeCycleListener(this);
+// if (wac.isStarted())
+// {
+// startWebAppContext(wac);
+// }
+//
+// monitoredContexts.add(wac.getContextPath());
+// }
+// }
+//
+// private void unregisterWebAppContext(WebAppContext wac)
+// {
+// System.out.println("UNREGISTERWEBAPPCONTEXT : " + wac);
+// if (monitoredContexts.contains(wac.getServletContext().getServletContextName()))
+// {
+// monitoredContexts.remove(wac.getServletContext().getServletContextName());
+//
+// //
+// if (wac.isStarted())
+// {
+// stopWebAppContext(wac);
+// }
+//
+// //TODO: remove event listener from the webappcontext
+// wac.removeLifeCycleListener(this);
+// }
+// }
+//
+// private void registerContextHandlerCollection(ContextHandlerCollection chc)
+// {
+// if (!monitoredContextHandlerCollection.contains(chc.toString()))
+// {
+// Handler[] children = chc.getChildHandlersByClass(WebAppContext.class);
+// for (int i = 0; i < children.length; i++)
+// {
+// WebAppContext webAppContext = (WebAppContext)children[i];
+// registerWebAppContext(webAppContext);
+// }
+// }
+//
+// monitoredContextHandlerCollection.add(chc.toString());
+// }
+//
+// private void unregisterContextHandlerCollection(ContextHandlerCollection chc)
+// {
+// if (monitoredContextHandlerCollection.contains(chc.toString()))
+// {
+// monitoredContextHandlerCollection.remove(chc.toString());
+//
+// Handler[] children = chc.getChildHandlersByClass(WebAppContext.class);
+// for (int i = 0; i < children.length; i++)
+// {
+// WebAppContext webAppContext = (WebAppContext)children[i];
+// unregisterWebAppContext(webAppContext);
+// }
+// }
+// }
+//
+// public void lifeCycleFailure(LifeCycle lifeCycle, Throwable t)
+// {
+// //ignore event
+// }
+//
+// public void lifeCycleStarted(LifeCycle lifeCycle)
+// {
+// startWebAppContext((WebAppContext)lifeCycle);
+// }
+//
+// public void lifeCycleStarting(LifeCycle lifeCycle)
+// {
+// //ignore event
+// }
+//
+// public void lifeCycleStopped(LifeCycle lifeCycle)
+// {
+// stopWebAppContext((WebAppContext)lifeCycle);
+// }
+//
+// public void lifeCycleStopping(LifeCycle lifeCycle)
+// {
+// //Ignore event
+// }
+//
+//}
+//
Copied: components/wci/trunk/jetty/src/main/java/org/gatein/wci/jetty/Jetty6WebAppContext.java (from rev 217, components/wci/trunk/wci/src/main/java/org/gatein/wci/impl/jetty/Jetty6WebAppContext.java)
===================================================================
--- components/wci/trunk/jetty/src/main/java/org/gatein/wci/jetty/Jetty6WebAppContext.java (rev 0)
+++ components/wci/trunk/jetty/src/main/java/org/gatein/wci/jetty/Jetty6WebAppContext.java 2009-10-01 03:58:59 UTC (rev 220)
@@ -0,0 +1,125 @@
+///******************************************************************************
+// * 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. *
+// ******************************************************************************/
+//package org.jboss.portal.web.impl.jetty;
+//
+//import org.w3c.dom.Document;
+//import org.jboss.portal.web.command.CommandServlet;
+//import org.jboss.portal.web.spi.WebAppContext;
+//import org.mortbay.jetty.handler.ContextHandlerCollection;
+//import org.mortbay.jetty.servlet.Context;
+//import org.mortbay.jetty.servlet.ServletHolder;
+//
+//import javax.servlet.ServletContext;
+//import java.io.InputStream;
+//import java.io.IOException;
+//
+//public class Jetty6WebAppContext implements WebAppContext
+//{
+//
+// /** The logger. */
+//// protected final Logger log = Logger.getLogger(getClass());
+//
+// /** . */
+// private Document descriptor;
+//
+// /** . */
+// private ServletContext servletContext;
+//
+// /** . */
+// private ClassLoader loader;
+//
+// /** . */
+// private String contextPath;
+//
+// /** . */
+// private final Context context;
+//
+// /** . */
+// private ServletHolder commandServlet;
+//
+// Jetty6WebAppContext(Context context) throws Exception
+// {
+// this.context = context;
+// //
+// servletContext = context.getServletContext();
+// loader = context.getClassLoader();
+// contextPath = context.getContextPath();
+// }
+//
+// public void start() throws Exception
+// {
+// try
+// {
+// commandServlet = new ServletHolder();
+// commandServlet.setName("JBossServlet");
+// commandServlet.setInitOrder(0);
+// commandServlet.setClassName(CommandServlet.class.getName());
+// context.addServlet(commandServlet, "/jbossportlet");
+// }
+// catch (Exception e)
+// {
+// cleanup();
+// throw e;
+// }
+// }
+//
+// public void stop()
+// {
+// cleanup();
+// }
+//
+// private void cleanup()
+// {
+// if (commandServlet != null)
+// {
+// try
+// {
+// commandServlet.getServletHandler();
+// commandServlet.stop();
+// }
+// catch (Exception e)
+// {
+// }
+// }
+// }
+//
+// public ServletContext getServletContext()
+// {
+// return servletContext;
+// }
+//
+// public ClassLoader getClassLoader()
+// {
+// return loader;
+// }
+//
+// public String getContextPath()
+// {
+// return contextPath;
+// }
+//
+// public boolean importFile(String parentDirRelativePath, String name, InputStream source, boolean overwrite) throws IOException
+// {
+// return false;
+// }
+//}
Modified: components/wci/trunk/pom.xml
===================================================================
--- components/wci/trunk/pom.xml 2009-10-01 03:25:02 UTC (rev 219)
+++ components/wci/trunk/pom.xml 2009-10-01 03:58:59 UTC (rev 220)
@@ -27,6 +27,10 @@
<modules>
<module>build</module>
<module>wci</module>
+ <module>exo</module>
+ <module>tomcat</module>
+ <module>jetty</module>
+ <module>test</module>
</modules>
<reporting>
Added: components/wci/trunk/test/.project
===================================================================
--- components/wci/trunk/test/.project (rev 0)
+++ components/wci/trunk/test/.project 2009-10-01 03:58:59 UTC (rev 220)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>wci-test</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+ </natures>
+</projectDescription>
Added: components/wci/trunk/test/pom.xml
===================================================================
--- components/wci/trunk/test/pom.xml (rev 0)
+++ components/wci/trunk/test/pom.xml 2009-10-01 03:58:59 UTC (rev 220)
@@ -0,0 +1,297 @@
+<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>module-parent</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ <relativePath>../build/pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>wci-test</artifactId>
+ <packaging>jar</packaging>
+ <name>GateIn - WCI test component</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.gatein.wci</groupId>
+ <artifactId>wci-wci</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.wci</groupId>
+ <artifactId>wci-tomcat</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>junit</artifactId>
+ <groupId>junit</groupId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.common</groupId>
+ <artifactId>common-common</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-core-uberjar</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>catalina</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>servlet-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>apache-log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </dependency>
+
+ <!-- SCOPE TEST -->
+ <dependency>
+ <groupId>concurrent</groupId>
+ <artifactId>concurrent</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.common</groupId>
+ <artifactId>common-mc</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.unit</groupId>
+ <artifactId>jboss-unit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.unit</groupId>
+ <artifactId>jboss-unit-remote</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.unit</groupId>
+ <artifactId>jboss-unit-mc</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.unit</groupId>
+ <artifactId>jboss-unit-tooling-ant</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.unit</groupId>
+ <artifactId>portal-test</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.unit</groupId>
+ <artifactId>portal-test-generic</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-common-logging-jdk</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-common-logging-log4j</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.remoting</groupId>
+ <artifactId>jboss-remoting</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-kernel</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-dependency</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-reflect</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-serialization</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>jaxen</groupId>
+ <artifactId>jaxen</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>saxpath</groupId>
+ <artifactId>saxpath</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>cargo</groupId>
+ <artifactId>cargo-manager</artifactId>
+ <type>war</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-jetty-deployer</artifactId>
+ <type>war</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-core-uberjar</artifactId>
+ <version>${version.cargo}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-ant</artifactId>
+ <version>${version.cargo}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>ant</groupId>
+ <artifactId>ant</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jvnet.maven-antrun-extended-plugin</groupId>
+ <artifactId>maven-antrun-extended-plugin</artifactId>
+ <version>1.13</version>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.unit</groupId>
+ <artifactId>jboss-unit-tooling-ant</artifactId>
+ <version>${version.jboss.unit}</version>
+ </dependency>
+
+ <!--stuff to run servers for tests-->
+ <dependency>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-ant</artifactId>
+ <version>${version.cargo}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>ant</groupId>
+ <artifactId>ant</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-core-uberjar</artifactId>
+ <version>${version.cargo}</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+ <executions>
+ <execution>
+ <id>test</id>
+ <phase>integration-test</phase>
+ <configuration>
+ <tasks>
+
+ <property name="compile_classpath" refid="maven.compile.classpath"/>
+ <property name="runtime_classpath" refid="maven.runtime.classpath"/>
+ <property name="test_classpath" refid="maven.test.classpath"/>
+ <property name="plugin_classpath" refid="maven.plugin.classpath"/>
+ <property name="project.version" value="${project.version}"/>
+
+ <!-- -->
+ <property name="dependency.log4j.jar" value="${maven.dependency.apache-log4j.log4j.jar.path}"/>
+ <property name="dependency.commons-logging.jar" value="${maven.dependency.commons-logging.commons-logging.jar.path}"/>
+ <property name="dependency.commons-httpclient.jar" value="${maven.dependency.commons-httpclient.commons-httpclient.jar.path}"/>
+ <property name="dependency.activation.jar" value="${maven.dependency.javax.activation.activation.jar.path}"/>
+ <property name="dependency.junit.jar" value="${maven.dependency.junit.junit.jar.path}"/>
+ <property name="dependency.cargo-manager.war" value="${maven.dependency.cargo.cargo-manager.war.path}"/>
+
+ <!-- GateIn -->
+ <property name="dependency.gatein-common-common.jar" value="${maven.dependency.org.gatein.common.common-common.jar.path}"/>
+ <property name="dependency.gatein-common-mc.jar" value="${maven.dependency.org.gatein.common.common-mc.jar.path}"/>
+ <property name="dependency.gatein-wci-core.jar" value="${maven.dependency.org.gatein.wci.wci-wci.jar.path}"/>
+ <property name="dependency.gatein-wci-tomcat.jar" value="${maven.dependency.org.gatein.wci.wci-tomcat.jar.path}"/>
+
+ <!-- JBoss Unit -->
+ <property name="dependency.jboss-unit.jar" value="${maven.dependency.org.jboss.unit.jboss-unit.jar.path}"/>
+ <property name="dependency.jboss-unit-mc.jar" value="${maven.dependency.org.jboss.unit.jboss-unit-mc.jar.path}"/>
+ <property name="dependency.jboss-unit-remote.jar" value="${maven.dependency.org.jboss.unit.jboss-unit-remote.jar.path}"/>
+ <property name="dependency.portal-test.jar" value="${maven.dependency.org.jboss.unit.portal-test.jar.path}"/>
+ <property name="dependency.portal-test-generic.jar" value="${maven.dependency.org.jboss.unit.portal-test-generic.jar.path}"/>
+ <property name="dependency.jboss-remoting.jar" value="${maven.dependency.org.jboss.remoting.jboss-remoting.jar.path}"/>
+
+ <!-- JBoss Microcontainer -->
+ <property name="dependency.concurrent.jar" value="${maven.dependency.concurrent.concurrent.jar.path}"/>
+ <property name="dependency.jboss-logging-spi.jar" value="${maven.dependency.jboss.jboss-common-logging-spi.jar.path}"/>
+ <property name="dependency.jboss-logging-jdk.jar" value="${maven.dependency.jboss.jboss-common-logging-jdk.jar.path}"/>
+ <property name="dependency.jboss-logging-log4j.jar" value="${maven.dependency.jboss.jboss-common-logging-log4j.jar.path}"/>
+ <property name="dependency.jboss-kernel.jar" value="${maven.dependency.org.jboss.microcontainer.jboss-kernel.jar.path}"/>
+ <property name="dependency.jboss-dependency.jar" value="${maven.dependency.org.jboss.microcontainer.jboss-dependency.jar.path}"/>
+ <property name="dependency.jboss-reflect.jar" value="${maven.dependency.org.jboss.jboss-reflect.jar.path}"/>
+ <property name="dependency.jboss-common-core.jar" value="${maven.dependency.org.jboss.jboss-common-core.jar.path}"/>
+ <property name="dependency.jaxb.jar" value="${maven.dependency.javax.xml.bind.jaxb-api.jar.path}"/>
+ <property name="dependency.jboss-mdr.jar" value="${maven.dependency.org.jboss.jboss-mdr.jar.path}"/>
+ <property name="dependency.resolver.jar" value="${maven.dependency.apache-xerces.resolver.jar.path}"/>
+ <property name="dependency.xercesImpl.jar" value="${maven.dependency.apache-xerces.xercesImpl.jar.path}"/>
+ <property name="dependency.xml-apis.jar" value="${maven.dependency.apache-xerces.xml-apis.jar.path}"/>
+ <property name="dependency.jbossxb.jar" value="${maven.dependency.org.jboss.jbossxb.jar.path}"/>
+ <property name="dependency.jboss-serialization.jar" value="${maven.dependency.jboss.jboss-serialization.jar.path}"/>
+
+ <!-- Cargo Jetty deployer -->
+ <property name="dependency.cargo.jetty-deployer" value="${maven.dependency.org.codehaus.cargo.cargo-jetty-deployer.war.path}"/>
+
+ <ant antfile="${basedir}/src/test/build.xml">
+ <target name="tests"/>
+ </ant>
+
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <properties>
+ </properties>
+</project>
Copied: components/wci/trunk/test/src/test/build.xml (from rev 217, components/wci/trunk/wci/src/test/build.xml)
===================================================================
--- components/wci/trunk/test/src/test/build.xml (rev 0)
+++ components/wci/trunk/test/src/test/build.xml 2009-10-01 03:58:59 UTC (rev 220)
@@ -0,0 +1,1155 @@
+<?xml version="1.0"?>
+<project name="identity-test">
+
+ <target name="tests" unless="maven.test.skip">
+ <antcall target="_tests"/>
+ </target>
+
+ <target name="_tests" depends="prepare_env, evaluate_properties" unless="maven.test.skip">
+
+ <echo message="compile classpath: ${compile_classpath}"/>
+ <echo message="runtime classpath: ${runtime_classpath}"/>
+ <echo message="test classpath: ${test_classpath}"/>
+ <echo message="plugin classpath: ${plugin_classpath}"/>
+ <echo message="To run tests only for containers specified with a HOME variable use -Dtest.specified.containers"/>
+
+ <!-- -->
+ <delete dir="${test.temp.dir}"/>
+ <antcall target="package-tests"/>
+
+ <!-- -->
+ <antcall target="tests.local"/>
+ <antcall target="tests.call.single"/>
+ <antcall target="tests.call.all"/>
+
+ </target>
+
+ <target name="tests.call.all" unless="tests">
+ <antcall target="tests.jboss5"/>
+ <antcall target="tests.jboss"/>
+ <antcall target="tests.tomcat"/>
+<!-- <antcall target="tests.jetty"/> -->
+ </target>
+
+ <target name="tests.call.single" if="tests">
+ <antcall target="tests.${tests}"/>
+ </target>
+
+ <!-- Aliases for easier test execution -->
+ <target name="tests.jboss">
+ <antcall target="tests.jboss-4.2"/>
+ </target>
+ <target name="tests.jboss5">
+ <antcall target="tests.jboss-5.1"/>
+ </target>
+ <target name="tests.tomcat">
+ <antcall target="tests.tomcat-6.0"/>
+ </target>
+ <target name="tests.jetty">
+ <antcall target="tests.jetty-6.1"/>
+ </target>
+
+ <target name="prepare_env">
+
+ <!--Relative path to target dir-->
+ <property name="target" value="${basedir}/target"/>
+ <property name="test.temp.dir" value="${target}/test/tmp"/>
+ <mkdir dir="${test.temp.dir}"/>
+ <mkdir dir="${target}/jboss-unit"/>
+
+ <property name="test.temp.lib" value="${test.temp.dir}/lib"/>
+ <property name="test.support" value="${test.temp.dir}/support"/>
+
+ </target>
+
+ <!--Lets make the check in one place so the build fail in the beggining instead of end-->
+ <target name="evaluate_properties">
+
+ <property environment="env"/>
+
+ <!--If properties are not in command line check if they are set in env-->
+ <condition property="JBOSS_4_2_3_HOME" value="${env.JBOSS_4_2_3_HOME}">
+ <and>
+ <isset property="env.JBOSS_4_2_3_HOME"/>
+ <not>
+ <isset property="JBOSS_4_2_3_HOME"/>
+ </not>
+ </and>
+ </condition>
+ <condition property="JBOSS_4_2_2_HOME" value="${env.JBOSS_4_2_2_HOME}">
+ <and>
+ <isset property="env.JBOSS_4_2_2_HOME"/>
+ <not>
+ <isset property="JBOSS_4_2_2_HOME"/>
+ </not>
+ </and>
+ </condition>
+ <condition property="JBOSS_4_2_1_HOME" value="${env.JBOSS_4_2_1_HOME}">
+ <and>
+ <isset property="env.JBOSS_4_2_1_HOME"/>
+ <not>
+ <isset property="JBOSS_4_2_1_HOME"/>
+ </not>
+ </and>
+ </condition>
+ <condition property="JBOSS_4_2_0_HOME" value="${env.JBOSS_4_2_0_HOME}">
+ <and>
+ <isset property="env.JBOSS_4_2_0_HOME"/>
+ <not>
+ <isset property="JBOSS_4_2_0_HOME"/>
+ </not>
+ </and>
+ </condition>
+ <condition property="JBOSS_5_1_0_HOME" value="${env.JBOSS_5_1_0_HOME}">
+ <and>
+ <isset property="env.JBOSS_5_1_0_HOME"/>
+ <not>
+ <isset property="JBOSS_5_1_0_HOME"/>
+ </not>
+ </and>
+ </condition>
+ <condition property="TOMCAT_6_0_HOME" value="${env.TOMCAT_6_0_HOME}">
+ <and>
+ <isset property="env.TOMCAT_6_0_HOME"/>
+ <not>
+ <isset property="TOMCAT_6_0_HOME"/>
+ </not>
+ </and>
+ </condition>
+ <condition property="JETTY_6_1_HOME" value="${env.JETTY_6_1_HOME}">
+ <and>
+ <isset property="env.JETTY_6_1_HOME"/>
+ <not>
+ <isset property="JETTY_6_1_HOME"/>
+ </not>
+ </and>
+ </condition>
+
+ <fail message="Please set the environment variable JBOSS_4_2_0_HOME or JBOSS_4_2_1_HOME or JBOSS_4_2_2_HOME or JBOSS_4_2_3_HOME or use -Dtest.specified.containers to only run tests for containers specified with a HOME variable">
+ <condition>
+ <and>
+ <not>
+ <isset property="test.specified.containers"/>
+ </not>
+ <not>
+ <isset property="JBOSS_4_2_0_HOME"/>
+ </not>
+ <not>
+ <isset property="JBOSS_4_2_1_HOME"/>
+ </not>
+ <not>
+ <isset property="JBOSS_4_2_2_HOME"/>
+ </not>
+ <not>
+ <isset property="JBOSS_4_2_3_HOME"/>
+ </not>
+ </and>
+ </condition>
+ </fail>
+
+ <fail message="Please set the environment variable JBOSS_5_1_0_HOME or use -Dtest.specified.containers to only run tests for containers specified with a HOME variable">
+ <condition>
+ <and>
+ <not>
+ <isset property="test.specified.containers"/>
+ </not>
+ <not>
+ <isset property="JBOSS_5_1_0_HOME"/>
+ </not>
+ </and>
+ </condition>
+ </fail>
+
+ <fail message="Please set the environment variable TOMCAT_6_0_HOME or use -Dtest.specified.containers to only run tests for containers specified with a HOME variable">
+ <condition>
+ <and>
+ <not>
+ <isset property="test.specified.containers"/>
+ </not>
+ <not>
+ <isset property="TOMCAT_6_0_HOME"/>
+ </not>
+ </and>
+ </condition>
+ </fail>
+
+<!-- <fail message="Please set the environment variable JETTY_6_1_HOME or use -Dtest.specified.containers to only run tests for containers specified with a HOME variable">
+ <condition>
+ <and>
+ <not>
+ <isset property="test.specified.containers"/>
+ </not>
+ <not>
+ <isset property="JETTY_6_1_HOME"/>
+ </not>
+ </and>
+ </condition>
+ </fail> -->
+
+
+ </target>
+
+ <target name="package-tests">
+
+ <copy todir="${test.support}">
+ <fileset dir="${target}/test-classes/support"/>
+ </copy>
+
+ <path id="jboss-logging">
+ <pathelement path="${dependency.jboss-logging-spi.jar}"/>
+ <pathelement path="${dependency.jboss-logging-jdk.jar}"/>
+ <pathelement path="${dependency.jboss-logging-log4j.jar}"/>
+ </path>
+
+ <path id="jboss-microcontainer">
+ <pathelement path="${dependency.jboss-kernel.jar}"/>
+ <pathelement path="${dependency.jboss-dependency.jar}"/>
+ <pathelement path="${dependency.jboss-reflect.jar}"/>
+ <pathelement path="${dependency.jboss-common-core.jar}"/>
+ <pathelement path="${dependency.jboss-mdr.jar}"/>
+ <pathelement path="${dependency.jaxb.jar}"/>
+ <pathelement path="${dependency.jbossxb.jar}"/>
+ </path>
+
+ <path id="gatein-common">
+ <pathelement path="${dependency.gatein-common-mc.jar}"/>
+ </path>
+
+ <path id="gatein-common-shared">
+ <pathelement path="${dependency.gatein-common-common.jar}"/>
+ </path>
+
+ <path id="jboss-unit">
+ <pathelement path="${dependency.jboss-unit.jar}"/>
+ <pathelement path="${dependency.jboss-unit-mc.jar}"/>
+ <pathelement path="${dependency.jboss-unit-remote.jar}"/>
+ <pathelement path="${dependency.portal-test-generic.jar}"/>
+ <pathelement path="${dependency.portal-test.jar}"/>
+ <pathelement path="${dependency.jboss-remoting.jar}"/>
+ </path>
+
+ <path id="jboss-4.2">
+ <path refid="gatein-common"/>
+ <path refid="jboss-unit"/>
+ <path refid="jboss-microcontainer"/>
+ </path>
+
+ <path id="jboss-4.2-shared">
+ <path refid="gatein-common-shared"/>
+ <path path="${dependency.gatein-wci-tomcat.jar}"/>
+ <path path="${dependency.gatein-wci-core.jar}"/>
+ </path>
+
+ <path id="jboss-5.1">
+ <path refid="gatein-common"/>
+ <path refid="jboss-unit"/>
+ <path refid="jboss-microcontainer"/>
+ </path>
+
+ <path id="jboss-5.1-shared">
+ <path refid="gatein-common-shared"/>
+ <path path="${dependency.gatein-wci-core.jar}"/>
+ <path path="${dependency.gatein-wci-tomcat.jar}"/>
+ </path>
+
+ <path id="tomcat-6.0">
+ <path refid="gatein-common"/>
+ <path refid="jboss-unit"/>
+ <path refid="jboss-microcontainer"/>
+ <pathelement path="${dependency.log4j.jar}"/>
+ <pathelement path="${dependency.xercesImpl.jar}"/>
+ <pathelement path="${dependency.resolver.jar}"/>
+ <pathelement path="${dependency.xml-apis.jar}"/>
+ <pathelement path="${dependency.concurrent.jar}"/>
+ </path>
+
+ <path id="tomcat-6.0-shared">
+ <path refid="jboss-logging"/>
+ <path refid="gatein-common-shared"/>
+ <path location="${dependency.log4j.jar}"/>
+ <path location="${dependency.activation.jar}"/>
+ <path location="${dependency.junit.jar}"/>
+ <path path="${dependency.gatein-wci-core.jar}"/>
+ <path path="${dependency.gatein-wci-tomcat.jar}"/>
+ <path location="${dependency.jboss-serialization.jar}"/>
+ </path>
+
+ <path id="jetty-6.1">
+ <path refid="gatein-common"/>
+ <path refid="jboss-unit"/>
+ <path refid="jboss-microcontainer"/>
+ </path>
+
+ <!-- SPI Test case-->
+
+ <mkdir dir="${test.temp.lib}"/>
+ <jar jarfile="${test.temp.lib}/portal-test-spi-lib.jar">
+ <fileset dir="${target}/test-classes/">
+ <include name="org/gatein/wci/spi/**"/>
+ <include name="org/gatein/wci/ServletTestCase.class"/>
+ <include name="org/gatein/wci/TestServlet.class"/>
+ <include name="org/gatein/wci/WebAppRegistry.class"/>
+ </fileset>
+ <fileset dir="${target}/test-classes//portal-test-spi-jar"/>
+ </jar>
+
+ <!-- **************************** -->
+ <!-- Tomcat 6.0 container servlet -->
+ <!-- **************************** -->
+
+ <copy todir="${test.support}/tomcat-6.0-container-servlet/server-war/WEB-INF/lib" flatten="true">
+ <path refid="tomcat-6.0"/>
+ </copy>
+ <mkdir dir="${test.temp.lib}/tomcat-6.0-container-servlet"/>
+ <war jarfile="${test.temp.lib}/tomcat-6.0-container-servlet/test-spi-server.war">
+ <fileset dir="${test.support}/tomcat-6.0-container-servlet/server-war"/>
+ <lib dir="${test.temp.lib}" includes="portal-test-spi-lib.jar"/>
+ </war>
+ <jar jarfile="${test.temp.lib}/tomcat-6.0-container-servlet/test-spi-app.war">
+ <fileset dir="${target}/test-classes/spi/app-war"/>
+ </jar>
+
+ <!-- **************************** -->
+ <!-- Tomcat 6.0 lifecyle listener -->
+ <!-- **************************** -->
+
+ <copy todir="${test.support}/tomcat-6.0-lifecycle-listener/server-war/WEB-INF/lib" flatten="true">
+ <path refid="tomcat-6.0"/>
+ </copy>
+ <mkdir dir="${test.temp.lib}/tomcat-6.0-lifecycle-listener"/>
+ <war jarfile="${test.temp.lib}/tomcat-6.0-lifecycle-listener/test-spi-server.war">
+ <fileset dir="${test.support}/tomcat-6.0-lifecycle-listener/server-war"/>
+ <lib dir="${test.temp.lib}" includes="portal-test-spi-lib.jar"/>
+ </war>
+ <jar jarfile="${test.temp.lib}/tomcat-6.0-lifecycle-listener/test-spi-app.war">
+ <fileset dir="${target}/test-classes/spi/app-war"/>
+ </jar>
+
+ <!-- ****************** -->
+ <!-- Tomcat 6.0 generic -->
+ <!-- ****************** -->
+
+ <!-- -->
+ <mkdir dir="${test.support}/tomcat-6.0-generic/server-war/WEB-INF/lib"/>
+ <copy todir="${test.support}/tomcat-6.0-generic/server-war/WEB-INF/lib" flatten="true">
+ <path refid="tomcat-6.0"/>
+ </copy>
+ <mkdir dir="${test.temp.lib}/tomcat-6.0-generic"/>
+ <war jarfile="${test.temp.lib}/tomcat-6.0-generic/test-spi-server.war">
+ <fileset dir="${test.support}/tomcat-6.0-generic/server-war"/>
+ <lib dir="${test.temp.lib}" includes="portal-test-spi-lib.jar"/>
+ </war>
+ <jar jarfile="${test.temp.lib}/tomcat-6.0-generic/test-spi-app.war">
+ <fileset dir="${target}/test-classes/spi/generic/app-war"/>
+ </jar>
+
+ <!-- **************************** -->
+ <!-- Jetty 6.1 handler -->
+ <!-- **************************** -->
+
+ <copy todir="${test.support}/jetty-6.1-handler/server-war/WEB-INF/lib" flatten="true">
+ <path refid="jetty-6.1"/>
+ </copy>
+ <mkdir dir="${test.temp.lib}/jetty-6.1-handler"/>
+ <war jarfile="${test.temp.lib}/jetty-6.1-handler/test-spi-server.war">
+ <fileset dir="${test.support}/jetty-6.1-handler/server-war"/>
+ <lib dir="${test.temp.lib}" includes="portal-test-spi-lib.jar"/>
+ </war>
+ <jar jarfile="${test.temp.lib}/jetty-6.1-handler/test-spi-app.war">
+ <fileset dir="${target}/test-classes/spi/app-war"/>
+ </jar>
+
+ <!-- ****************** -->
+ <!-- Jetty 6.1 generic -->
+ <!-- ****************** -->
+
+ <!-- -->
+ <mkdir dir="${test.support}/jetty-6.1-generic/server-war/WEB-INF/lib"/>
+ <copy todir="${test.support}/jetty-6.1-generic/server-war/WEB-INF/lib" flatten="true">
+ <path refid="jetty-6.1"/>
+ </copy>
+ <mkdir dir="${test.temp.lib}/jetty-6.1-generic"/>
+ <war jarfile="${test.temp.lib}/jetty-6.1-generic/test-spi-server.war">
+ <fileset dir="${test.support}/jetty-6.1-generic/server-war"/>
+ <lib dir="${test.temp.lib}" includes="portal-test-spi-lib.jar"/>
+ </war>
+ <jar jarfile="${test.temp.lib}/jetty-6.1-generic/test-spi-app.war">
+ <fileset dir="${target}/test-classes/spi/generic/app-war"/>
+ </jar>
+
+ <!-- *************************** -->
+ <!-- JBoss 4.2 container servlet -->
+ <!-- *************************** -->
+
+ <!-- -->
+ <copy todir="${test.support}/jboss-4.2-container-servlet/server-war/WEB-INF/lib" flatten="true">
+ <path refid="jboss-4.2"/>
+ </copy>
+ <mkdir dir="${test.temp.lib}/jboss-4.2-container-servlet"/>
+ <war jarfile="${test.temp.lib}/jboss-4.2-container-servlet/test-spi-server.war">
+ <fileset dir="${test.support}/jboss-4.2-container-servlet/server-war"/>
+ <lib dir="${test.temp.lib}" includes="portal-test-spi-lib.jar"/>
+ </war>
+ <jar jarfile="${test.temp.lib}/jboss-4.2-container-servlet/test-spi-app.war">
+ <fileset dir="${target}/test-classes/spi/app-war"/>
+ </jar>
+
+ <!-- ***************** -->
+ <!-- JBoss 4.2 generic -->
+ <!-- ***************** -->
+
+ <!-- -->
+ <copy todir="${test.support}/jboss-4.2-generic/server-war/WEB-INF/lib" flatten="true">
+ <path refid="jboss-4.2"/>
+ </copy>
+ <mkdir dir="${test.temp.lib}/jboss-4.2-generic"/>
+ <war jarfile="${test.temp.lib}/jboss-4.2-generic/test-spi-server.war">
+ <fileset dir="${test.support}/jboss-4.2-generic/server-war"/>
+ <lib dir="${test.temp.lib}" includes="portal-test-spi-lib.jar"/>
+ </war>
+ <jar jarfile="${test.temp.lib}/jboss-4.2-generic/test-spi-app.war">
+ <fileset dir="${target}/test-classes/spi/generic/app-war"/>
+ </jar>
+
+ <!--endpoint test case-->
+
+ <jar jarfile="${test.temp.lib}/portal-test-endpoint-lib.jar">
+ <fileset dir="${target}/test-classes/">
+ <include name="org/gatein/wci/endpoint/**"/>
+ <include name="org/gatein/wci/ServletTestCase.class"/>
+ <include name="org/gatein/wci/TestServlet.class"/>
+ <include name="org/gatein/wci/WebAppRegistry.class"/>
+ </fileset>
+ <fileset dir="${target}/test-classes/portal-test-endpoint-jar"/>
+ </jar>
+
+ <!-- *************************** -->
+ <!-- JBoss 5.1 container servlet -->
+ <!-- *************************** -->
+
+ <!-- -->
+ <copy todir="${test.support}/jboss-5.1-container-servlet/server-war/WEB-INF/lib" flatten="true">
+ <path refid="jboss-5.1"/>
+ </copy>
+ <mkdir dir="${test.temp.lib}/jboss-5.1-container-servlet"/>
+ <war jarfile="${test.temp.lib}/jboss-5.1-container-servlet/test-spi-server.war">
+ <fileset dir="${test.support}/jboss-5.1-container-servlet/server-war">
+ <exclude name="**/jboss-kernel*.jar"/>
+ </fileset>
+ <lib dir="${test.temp.lib}" includes="portal-test-spi-lib.jar"/>
+ </war>
+ <jar jarfile="${test.temp.lib}/jboss-5.1-container-servlet/test-spi-app.war">
+ <fileset dir="${target}/test-classes/spi/app-war"/>
+ </jar>
+
+ <!-- ***************** -->
+ <!-- JBoss 5.1 generic -->
+ <!-- ***************** -->
+
+ <copy todir="${test.support}/jboss-5.1-generic/server-war/WEB-INF/lib" flatten="true">
+ <path refid="jboss-5.1"/>
+ </copy>
+ <mkdir dir="${test.temp.lib}/jboss-5.1-generic"/>
+ <war jarfile="${test.temp.lib}/jboss-5.1-generic/test-spi-server.war">
+ <fileset dir="${test.support}/jboss-5.1-generic/server-war">
+ <exclude name="**/jboss-kernel*.jar"/>
+ </fileset>
+ <lib dir="${test.temp.lib}" includes="portal-test-spi-lib.jar"/>
+ </war>
+ <jar jarfile="${test.temp.lib}/jboss-5.1-generic/test-spi-app.war">
+ <fileset dir="${target}/test-classes/spi/generic/app-war">
+ <exclude name="**/jboss-kernel*.jar"/>
+ </fileset>
+ </jar>
+
+ <!--endpoint test case-->
+
+ <jar jarfile="${test.temp.lib}/portal-test-endpoint-lib.jar">
+ <fileset dir="${target}/test-classes/">
+ <include name="org/gatein/wci/endpoint/**"/>
+ <include name="org/gatein/wci/ServletTestCase.class"/>
+ <include name="org/gatein/wci/TestServlet.class"/>
+ <include name="org/gatein/wci/WebAppRegistry.class"/>
+ </fileset>
+ <fileset dir="${target}/test-classes/portal-test-endpoint-jar"/>
+ </jar>
+
+ <!-- ********** -->
+ <!-- Tomcat 6.0 -->
+ <!-- ********** -->
+
+ <mkdir dir="${test.temp.lib}/tomcat-6.0"/>
+
+ <copy todir="${test.support}/tomcat-6.0-endpoint/default-servlet-mapping-war/WEB-INF/lib" flatten="true">
+ <path refid="tomcat-6.0"/>
+ </copy>
+ <war jarfile="${test.temp.lib}/tomcat-6.0/default-servlet-mapping.war">
+ <fileset dir="${test.support}/tomcat-6.0-endpoint/default-servlet-mapping-war"/>
+ <lib dir="${test.temp.lib}" includes="portal-test-endpoint-lib.jar"/>
+ </war>
+
+ <copy todir="${test.support}/tomcat-6.0-endpoint/path-mapping-war/WEB-INF/lib" flatten="true">
+ <path refid="tomcat-6.0"/>
+ </copy>
+ <war jarfile="${test.temp.lib}/tomcat-6.0/path-mapping.war">
+ <fileset dir="${test.support}/tomcat-6.0-endpoint/path-mapping-war"/>
+ <lib dir="${test.temp.lib}" includes="portal-test-endpoint-lib.jar"/>
+ </war>
+
+ <copy todir="${test.support}/tomcat-6.0-endpoint/root-path-mapping-war/WEB-INF/lib" flatten="true">
+ <path refid="tomcat-6.0"/>
+ </copy>
+ <war jarfile="${test.temp.lib}/tomcat-6.0/root-path-mapping.war">
+ <fileset dir="${test.support}/tomcat-6.0-endpoint/root-path-mapping-war"/>
+ <lib dir="${test.temp.lib}" includes="portal-test-endpoint-lib.jar"/>
+ </war>
+
+ <!-- ********* -->
+ <!-- JETTY 6.1 -->
+ <!-- ********* -->
+ <mkdir dir="${test.temp.lib}/jetty-6.1"/>
+
+ <copy todir="${test.support}/jetty-6.1-endpoint/default-servlet-mapping-war/WEB-INF/lib" flatten="true">
+ <path refid="jetty-6.1"/>
+ </copy>
+ <war jarfile="${test.temp.lib}/jetty-6.1/default-servlet-mapping.war">
+ <fileset dir="${test.support}/jetty-6.1-endpoint/default-servlet-mapping-war"/>
+ <lib dir="${test.temp.lib}" includes="portal-test-endpoint-lib.jar"/>
+ </war>
+
+ <copy todir="${test.support}/jetty-6.1-endpoint/path-mapping-war/WEB-INF/lib" flatten="true">
+ <path refid="jetty-6.1"/>
+ </copy>
+ <war jarfile="${test.temp.lib}/jetty-6.1/path-mapping.war">
+ <fileset dir="${test.support}/jetty-6.1-endpoint/path-mapping-war"/>
+ <lib dir="${test.temp.lib}" includes="portal-test-endpoint-lib.jar"/>
+ </war>
+
+ <copy todir="${test.support}/jetty-6.1-endpoint/root-path-mapping-war/WEB-INF/lib" flatten="true">
+ <path refid="jetty-6.1"/>
+ </copy>
+ <war jarfile="${test.temp.lib}/jetty-6.1/root-path-mapping.war">
+ <fileset dir="${test.support}/jetty-6.1-endpoint/root-path-mapping-war"/>
+ <lib dir="${test.temp.lib}" includes="portal-test-endpoint-lib.jar"/>
+ </war>
+
+ <!-- ********* -->
+ <!-- JBoss 4.2 -->
+ <!-- ********* -->
+
+ <mkdir dir="${test.temp.lib}/jboss-4.2"/>
+
+ <copy todir="${test.support}/jboss-4.2-endpoint/default-servlet-mapping-war/WEB-INF/lib" flatten="true">
+ <path refid="jboss-4.2"/>
+ </copy>
+ <war jarfile="${test.temp.lib}/jboss-4.2/default-servlet-mapping.war">
+ <fileset dir="${test.support}/jboss-4.2-endpoint/default-servlet-mapping-war"/>
+ <lib dir="${test.temp.lib}" includes="portal-test-endpoint-lib.jar"/>
+ </war>
+
+ <copy todir="${test.support}/jboss-4.2-endpoint/path-mapping-war/WEB-INF/lib" flatten="true">
+ <path refid="jboss-4.2"/>
+ </copy>
+ <war jarfile="${test.temp.lib}/jboss-4.2/path-mapping.war">
+ <fileset dir="${test.support}/jboss-4.2-endpoint/path-mapping-war"/>
+ <lib dir="${test.temp.lib}" includes="portal-test-endpoint-lib.jar"/>
+ </war>
+
+ <copy todir="${test.support}/jboss-4.2-endpoint/root-path-mapping-war/WEB-INF/lib" flatten="true">
+ <path refid="jboss-4.2"/>
+ </copy>
+ <war jarfile="${test.temp.lib}/jboss-4.2/root-path-mapping.war">
+ <fileset dir="${test.support}/jboss-4.2-endpoint/root-path-mapping-war"/>
+ <lib dir="${test.temp.lib}" includes="portal-test-endpoint-lib.jar"/>
+ </war>
+
+ <!-- ********* -->
+ <!-- JBoss 5.1 -->
+ <!-- ********* -->
+
+ <mkdir dir="${test.temp.lib}/jboss-5.1"/>
+
+ <copy todir="${test.support}/jboss-5.1-endpoint/default-servlet-mapping-war/WEB-INF/lib" flatten="true">
+ <path refid="jboss-5.1"/>
+ </copy>
+ <war jarfile="${test.temp.lib}/jboss-5.1/default-servlet-mapping.war">
+ <fileset dir="${test.support}/jboss-5.1-endpoint/default-servlet-mapping-war">
+ <exclude name="**/jboss-kernel*.jar"/>
+ </fileset>
+ <lib dir="${test.temp.lib}" includes="portal-test-endpoint-lib.jar"/>
+ </war>
+
+ <copy todir="${test.support}/jboss-5.1-endpoint/path-mapping-war/WEB-INF/lib" flatten="true">
+ <path refid="jboss-5.1"/>
+ </copy>
+ <war jarfile="${test.temp.lib}/jboss-5.1/path-mapping.war">
+ <fileset dir="${test.support}/jboss-5.1-endpoint/path-mapping-war">
+ <exclude name="**/jboss-kernel*.jar"/>
+ </fileset>
+ <lib dir="${test.temp.lib}" includes="portal-test-endpoint-lib.jar"/>
+ </war>
+
+ <copy todir="${test.support}/jboss-5.1-endpoint/root-path-mapping-war/WEB-INF/lib" flatten="true">
+ <path refid="jboss-5.1"/>
+ </copy>
+ <war jarfile="${test.temp.lib}/jboss-5.1/root-path-mapping.war">
+ <fileset dir="${test.support}/jboss-5.1-endpoint/root-path-mapping-war">
+ <exclude name="**/jboss-kernel*.jar"/>
+ </fileset>
+ <lib dir="${test.temp.lib}" includes="portal-test-endpoint-lib.jar"/>
+ </war>
+
+ <!--Strip cargo manager war filename-->
+ <copy file="${dependency.cargo-manager.war}" tofile="${test.temp.lib}/manager.war"/>
+ <!-- unjar the war -->
+ <unzip src="${test.temp.lib}/manager.war" dest="${test.temp.lib}/manager"/>
+
+ </target>
+
+ <target name="cargo.setup">
+ <property name="cargo.log.dir" value="${target}/test/cargo"/>
+ <mkdir dir="${cargo.log.dir}"/>
+ <taskdef resource="cargo.tasks">
+ <classpath>
+ <pathelement path="${plugin_classpath}"/>
+ </classpath>
+ </taskdef>
+ </target>
+
+
+ <target name="cargo.jboss-4.2.start" depends="cargo.setup">
+ <!-- The lib portal-test-lib.jar must be loaded at the shared level rather than in the war file
+ otherwise it is somehow inspected and produce a NoClassDefFoundError in the web service integration
+ layer on the class org/jboss/portal/test/framework/driver/remote/RemoteTestDriver for some unknown
+ reason, the class initiating the loading of the RemoteTestDriver class is
+ org.jboss.ws.integration.jboss42.DeployerInterceptorJSE.isWebserviceDeployment(DeployerInterceptorJSE.java:84)
+ -->
+
+ <cargo
+ containerId="jboss42x"
+ home="${test.jboss-4.2.home}"
+ log="${cargo.log.dir}/cargo.${test.id}.startup.log"
+ output="${cargo.log.dir}/cargo.${test.id}.server.log"
+ action="start"
+ wait="${cargo.wait}">
+ <sharedClasspath>
+
+ <path refid="jboss-4.2-shared"/>
+
+ </sharedClasspath>
+ <configuration home="${target}/cargo">
+ <property name="cargo.rmi.port" value="1299"/>
+ <property name="cargo.servlet.port" value="8080"/>
+ <property name="cargo.logging" value="high"/>
+ <deployable type="war" file="${cargo.war}"/>
+<!-- <property name="cargo.jvmargs" value="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8222"/> -->
+ </configuration>
+ </cargo>
+ </target>
+
+ <target name="cargo.jboss-4.2.stop" depends="cargo.setup">
+ <cargo
+ containerId="jboss42x"
+ home="${test.jboss-4.2.home}"
+ log="${cargo.log.dir}/cargo.${test.id}.shutdown.log"
+ action="stop">
+ <configuration home="${target}/cargo">
+ <property name="cargo.rmi.port" value="1299"/>
+ </configuration>
+ </cargo>
+ </target>
+
+ <target name="tests.jboss-4.2.execute" unless="tests.jboss-4.2.execute.skip">
+ <echo message="Starting JBoss 4.2 ${test.jboss-4.2.name} with ${test.jboss-4.2.home} to execute ${test.id} tests"/>
+ <antcall target="cargo.jboss-4.2.start">
+ <param name="cargo.wait" value="false"/>
+ <param name="cargo.war" value="${test.war}"/>
+ </antcall>
+ <antcall target="tests.remote">
+ <param name="test.remote.server.name" value="${test.jboss-4.2.name}"/>
+ <param name="test.remote.archive.path" value="${test.archive.path}"/>
+ </antcall>
+ <antcall target="cargo.jboss-4.2.stop">
+ </antcall>
+ </target>
+
+ <target name="tests.jboss-4.2.spi">
+ <condition property="tests.jboss-4.2.execute.skip">
+ <not>
+ <available file="${test.jboss-4.2.home}" type="dir"/>
+ </not>
+ </condition>
+ <antcall target="tests.jboss-4.2.execute">
+ <param name="test.id" value="${test.jboss-4.2.name}-spi-container-servlet"/>
+ <param name="test.war" value="${test.temp.lib}/jboss-4.2-container-servlet/test-spi-server.war"/>
+ <param name="test.archive.path" value="jboss-4.2-container-servlet"/>
+ </antcall>
+ <antcall target="tests.jboss-4.2.execute">
+ <param name="test.id" value="${test.jboss-4.2.name}-spi-generic"/>
+ <param name="test.war" value="${test.temp.lib}/jboss-4.2-generic/test-spi-server.war"/>
+ <param name="test.archive.path" value="jboss-4.2-generic"/>
+ </antcall>
+ </target>
+
+ <target name="tests.jboss-4.2.endpoint">
+ <condition property="tests.jboss-4.2.execute.skip">
+ <not>
+ <available file="${test.jboss-4.2.home}" type="dir"/>
+ </not>
+ </condition>
+ <antcall target="tests.jboss-4.2.execute">
+ <param name="test.id" value="${test.jboss-4.2.name}-endpoint-default-servlet-mapping"/>
+ <param name="test.war" value="${test.temp.lib}/jboss-4.2/default-servlet-mapping.war"/>
+ <param name="test.archive.path" value=""/>
+ </antcall>
+ <antcall target="tests.jboss-4.2.execute">
+ <param name="test.id" value="${test.jboss-4.2.name}-endpoint-path-mapping"/>
+ <param name="test.war" value="${test.temp.lib}/jboss-4.2/path-mapping.war"/>
+ <param name="test.archive.path" value=""/>
+ </antcall>
+ <antcall target="tests.jboss-4.2.execute">
+ <param name="test.id" value="${test.jboss-4.2.name}-endpoint-root-path-mapping"/>
+ <param name="test.war" value="${test.temp.lib}/jboss-4.2/root-path-mapping.war"/>
+ <param name="test.archive.path" value=""/>
+ </antcall>
+ </target>
+
+ <target name="tests.jboss-4.2">
+
+ <!-- spi tests -->
+
+ <antcall target="tests.jboss-4.2.spi">
+ <param name="test.jboss-4.2.name" value="RemoteJBoss_4_2_0"/>
+ <param name="test.jboss-4.2.home" value="${JBOSS_4_2_0_HOME}"/>
+ </antcall>
+ <antcall target="tests.jboss-4.2.spi">
+ <param name="test.jboss-4.2.name" value="RemoteJBoss_4_2_1"/>
+ <param name="test.jboss-4.2.home" value="${JBOSS_4_2_1_HOME}"/>
+ </antcall>
+ <antcall target="tests.jboss-4.2.spi">
+ <param name="test.jboss-4.2.name" value="RemoteJBoss_4_2_2"/>
+ <param name="test.jboss-4.2.home" value="${JBOSS_4_2_2_HOME}"/>
+ </antcall>
+ <antcall target="tests.jboss-4.2.spi">
+ <param name="test.jboss-4.2.name" value="RemoteJBoss_4_2_3"/>
+ <param name="test.jboss-4.2.home" value="${JBOSS_4_2_3_HOME}"/>
+ </antcall>
+
+ <!-- endpoint tests -->
+
+ <antcall target="tests.jboss-4.2.endpoint">
+ <param name="test.jboss-4.2.name" value="RemoteJBoss_4_2_0"/>
+ <param name="test.jboss-4.2.home" value="${JBOSS_4_2_0_HOME}"/>
+ </antcall>
+ <antcall target="tests.jboss-4.2.endpoint">
+ <param name="test.jboss-4.2.name" value="RemoteJBoss_4_2_1"/>
+ <param name="test.jboss-4.2.home" value="${JBOSS_4_2_1_HOME}"/>
+ </antcall>
+ <antcall target="tests.jboss-4.2.endpoint">
+ <param name="test.jboss-4.2.name" value="RemoteJBoss_4_2_2"/>
+ <param name="test.jboss-4.2.home" value="${JBOSS_4_2_2_HOME}"/>
+ </antcall>
+ <antcall target="tests.jboss-4.2.endpoint">
+ <param name="test.jboss-4.2.name" value="RemoteJBoss_4_2_3"/>
+ <param name="test.jboss-4.2.home" value="${JBOSS_4_2_3_HOME}"/>
+ </antcall>
+ </target>
+
+ <target name="cargo.jboss-5.1.start" depends="cargo.setup">
+ <!-- The lib portal-test-lib.jar must be loaded at the shared level rather than in the war file
+ otherwise it is somehow inspected and produce a NoClassDefFoundError in the web service integration
+ layer on the class org/jboss/portal/test/framework/driver/remote/RemoteTestDriver for some unknown
+ reason, the class initiating the loading of the RemoteTestDriver class is
+ org.jboss.ws.integration.jboss42.DeployerInterceptorJSE.isWebserviceDeployment(DeployerInterceptorJSE.java:84)
+ -->
+
+ <cargo
+ containerId="jboss51x"
+ home="${test.jboss-5.1.home}"
+ log="${cargo.log.dir}/cargo.${test.id}.startup.log"
+ output="${cargo.log.dir}/cargo.${test.id}.server.log"
+ action="start"
+ wait="false">
+ <sharedClasspath>
+
+ <path refid="jboss-5.1-shared"/>
+
+ </sharedClasspath>
+ <configuration home="${target}/cargo">
+ <property name="cargo.rmi.port" value="1099"/>
+ <property name="cargo.servlet.port" value="8080"/>
+ <property name="cargo.logging" value="high"/>
+ <deployable type="war" file="${cargo.war}"/>
+<!-- <property name="cargo.jvmargs" value="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8222"/> -->
+ </configuration>
+ </cargo>
+ </target>
+
+ <target name="cargo.jboss-5.1.stop" depends="cargo.setup">
+ <cargo
+ containerId="jboss51x"
+ home="${test.jboss-5.1.home}"
+ log="${cargo.log.dir}/cargo.${test.id}.shutdown.log"
+ action="stop">
+ <configuration home="${target}/cargo">
+ <property name="cargo.rmi.port" value="1099"/>
+ </configuration>
+ </cargo>
+ </target>
+
+ <target name="tests.jboss-5.1.execute" unless="tests.jboss-5.1.execute.skip">
+ <echo message="Starting JBoss 5.1 ${test.jboss-5.1.name} with ${test.jboss-5.1.home} to execute ${test.id} tests"/>
+ <antcall target="cargo.jboss-5.1.start">
+ <param name="cargo.wait" value="false"/>
+ <param name="cargo.war" value="${test.war}"/>
+ </antcall>
+ <antcall target="tests.remote">
+ <param name="test.remote.server.name" value="${test.jboss-5.1.name}"/>
+ <param name="test.remote.archive.path" value="${test.archive.path}"/>
+ </antcall>
+ <antcall target="cargo.jboss-5.1.stop">
+ </antcall>
+ </target>
+
+ <target name="tests.jboss-5.1.spi">
+ <condition property="tests.jboss-5.1.execute.skip">
+ <not>
+ <available file="${test.jboss-5.1.home}" type="dir"/>
+ </not>
+ </condition>
+ <antcall target="tests.jboss-5.1.execute">
+ <param name="test.id" value="${test.jboss-5.1.name}-spi-container-servlet"/>
+ <param name="test.war" value="${test.temp.lib}/jboss-5.1-container-servlet/test-spi-server.war"/>
+ <param name="test.archive.path" value="jboss-5.1-container-servlet"/>
+
+ </antcall>
+ <antcall target="tests.jboss-5.1.execute">
+ <param name="test.id" value="${test.jboss-5.1.name}-spi-generic"/>
+ <param name="test.war" value="${test.temp.lib}/jboss-5.1-generic/test-spi-server.war"/>
+ <param name="test.archive.path" value="jboss-5.1-generic"/>
+ </antcall>
+ </target>
+
+ <target name="tests.jboss-5.1.endpoint">
+ <condition property="tests.jboss-5.1.execute.skip">
+ <not>
+ <available file="${test.jboss-5.1.home}" type="dir"/>
+ </not>
+ </condition>
+ <antcall target="tests.jboss-5.1.execute">
+ <param name="test.id" value="${test.jboss-5.1.name}-endpoint-default-servlet-mapping"/>
+ <param name="test.war" value="${test.temp.lib}/jboss-5.1/default-servlet-mapping.war"/>
+ <param name="test.archive.path" value=""/>
+ </antcall>
+ <antcall target="tests.jboss-5.1.execute">
+ <param name="test.id" value="${test.jboss-5.1.name}-endpoint-path-mapping"/>
+ <param name="test.war" value="${test.temp.lib}/jboss-5.1/path-mapping.war"/>
+ <param name="test.archive.path" value=""/>
+ </antcall>
+ <antcall target="tests.jboss-5.1.execute">
+ <param name="test.id" value="${test.jboss-5.1.name}-endpoint-root-path-mapping"/>
+ <param name="test.war" value="${test.temp.lib}/jboss-5.1/root-path-mapping.war"/>
+ <param name="test.archive.path" value=""/>
+ </antcall>
+ </target>
+
+ <target name="tests.jboss-5.1">
+
+ <!-- spi tests -->
+ <antcall target="tests.jboss-5.1.spi">
+ <param name="test.jboss-5.1.name" value="RemoteJBoss_5_1"/>
+ <param name="test.jboss-5.1.home" value="${JBOSS_5_1_0_HOME}"/>
+ </antcall>
+
+ <!-- endpoint tests -->
+ <antcall target="tests.jboss-5.1.endpoint">
+ <param name="test.jboss-5.1.name" value="RemoteJBoss_5_1"/>
+ <param name="test.jboss-5.1.home" value="${JBOSS_5_1_0_HOME}"/>
+ </antcall>
+ </target>
+
+ <target name="cargo.tomcat-6.0.start" depends="cargo.setup">
+
+ <cargo
+ containerId="tomcat6x"
+ home="${test.tomcat-6.0.home}"
+ output="${cargo.log.dir}/cargo.${test.id}.server.log"
+ log="${cargo.log.dir}/cargo.${test.id}.start.log"
+ action="start"
+ wait="${cargo.wait}">
+ <sharedClasspath>
+
+ <path refid="tomcat-6.0-shared"/>
+
+ </sharedClasspath>
+ <configuration home="${target}/cargo">
+ <property name="cargo.servlet.port" value="8080"/>
+ <property name="cargo.logging" value="high"/>
+ <!--<property name="cargo.jvmargs" value="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000"/>-->
+
+ <deployable type="war" file="${test.temp.lib}/manager.war"/>
+ <file file="${test.temp.lib}/manager" todir="webapps/manager"/>
+ <deployable type="war" file="${cargo.war}"/>
+ </configuration>
+ </cargo>
+ </target>
+
+ <target name="cargo.tomcat-6.0.stop" depends="cargo.setup">
+ <cargo
+ containerId="tomcat6x"
+ home="${test.tomcat-6.0.home}"
+ log="${cargo.log.dir}/cargo.${test.id}.shutdown.log"
+ action="stop">
+ <configuration home="${target}/cargo">
+ </configuration>
+ </cargo>
+ </target>
+
+ <target name="tests.tomcat-6.0.execute" unless="tests.tomcat-6.0.execute.skip">
+ <echo message="Starting Tomcat 6.0 ${test.tomcat-6.0.name} with ${test.tomcat-6.0.home} to execute ${test.id} tests"/>
+ <antcall target="cargo.tomcat-6.0.start">
+ <param name="cargo.wait" value="false"/>
+ <param name="cargo.war" value="${test.war}"/>
+ </antcall>
+ <antcall target="tests.remote">
+ <param name="test.remote.server.name" value="${test.tomcat-6.0.name}"/>
+ <param name="test.remote.archive.path" value="${test.archive.path}"/>
+ </antcall>
+ <antcall target="cargo.tomcat-6.0.stop">
+ </antcall>
+ </target>
+
+ <target name="tests.tomcat-6.0.spi">
+ <condition property="tests.tomcat-6.0.execute.skip">
+ <not>
+ <available file="${test.tomcat-6.0.home}" type="dir"/>
+ </not>
+ </condition>
+ <antcall target="tests.tomcat-6.0.execute">
+ <param name="test.id" value="${test.tomcat-6.0.name}-spi-container-servlet"/>
+ <param name="test.war" value="${test.temp.lib}/tomcat-6.0-container-servlet/test-spi-server.war"/>
+ <param name="test.archive.path" value="tomcat-6.0-container-servlet"/>
+ </antcall>
+ <antcall target="tests.tomcat-6.0.execute">
+ <param name="test.id" value="${test.tomcat-6.0.name}-spi-generic"/>
+ <param name="test.war" value="${test.temp.lib}/tomcat-6.0-generic/test-spi-server.war"/>
+ <param name="test.archive.path" value="tomcat-6.0-generic"/>
+ </antcall>
+ </target>
+
+ <target name="tests.tomcat-6.0.endpoint">
+ <condition property="tests.tomcat-6.0.execute.skip">
+ <not>
+ <available file="${test.tomcat-6.0.home}" type="dir"/>
+ </not>
+ </condition>
+ <antcall target="tests.tomcat-6.0.execute">
+ <param name="test.id" value="${test.tomcat-6.0.name}-endpoint-default-servlet-mapping"/>
+ <param name="test.war" value="${test.temp.lib}/tomcat-6.0/default-servlet-mapping.war"/>
+ <param name="test.archive.path" value=""/>
+ </antcall>
+ <antcall target="tests.tomcat-6.0.execute">
+ <param name="test.id" value="${test.tomcat-6.0.name}-endpoint-root-path-mapping"/>
+ <param name="test.war" value="${test.temp.lib}/tomcat-6.0/root-path-mapping.war"/>
+ <param name="test.archive.path" value=""/>
+ </antcall>
+ <antcall target="tests.tomcat-6.0.execute">
+ <param name="test.id" value="${test.tomcat-6.0.name}-endpoint-path-mapping"/>
+ <param name="test.war" value="${test.temp.lib}/tomcat-6.0/path-mapping.war"/>
+ <param name="test.archive.path" value=""/>
+ </antcall>
+ </target>
+
+ <target name="tests.tomcat-6.0">
+ <!-- spi tests -->
+ <antcall target="tests.tomcat-6.0.spi">
+ <param name="test.tomcat-6.0.name" value="RemoteTomcat_6_0"/>
+ <param name="test.tomcat-6.0.home" value="${TOMCAT_6_0_HOME}"/>
+ </antcall>
+
+ <!-- endpoint tests -->
+
+ <antcall target="tests.tomcat-6.0.endpoint">
+ <param name="test.tomcat-6.0.name" value="RemoteTomcat_6_0"/>
+ <param name="test.tomcat-6.0.home" value="${TOMCAT_6_0_HOME}"/>
+ </antcall>
+
+ </target>
+
+ <target name="cargo.jetty-6.1.start" depends="cargo.setup">
+ <cargo
+ containerId="jetty6x"
+ home="${test.jetty-6.1.home}"
+ output="${cargo.log.dir}/cargo.${test.id}.server.log"
+ log="${cargo.log.dir}/cargo.${test.id}.start.log"
+ action="start"
+ wait="${cargo.wait}">
+ <extraClasspath>
+ <path location="${dependency.gatein-common-common.jar}"/>
+ <path location="${dependency.jboss-unit.jar}"/>
+ <path location="${dependency.jboss-unit-remote.jar}"/>
+ <path location="${target}/wci-wci-${project.version}.jar"/>
+
+ <path location="${dependency.log4j.jar}"/>
+ <path location="${dependency.concurrent.jar}"/>
+ <path location="${dependency.gatein-common.jar}"/>
+ <path location="${dependency.activation.jar}"/>
+ <path location="${dependency.junit.jar}"/>
+ <path location="${dependency.jboss-logging-spi.jar}"/>
+
+ <path location="${target}/wci-wci-${project.version}.jar"/>
+
+ </extraClasspath>
+ <configuration home="${target}/cargo">
+ <property name="cargo.servlet.port" value="8080"/>
+ <property name="cargo.logging" value="high"/>
+ <property name="cargo.jvmargs" value="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8222"/>
+ <!-- overwrite these files to give jetty the propery security setup -->
+ <configfile file="${basedir}/src/test/resources/config/jetty/jetty.xml" todir="etc"/>
+ <configfile file="${basedir}/src/test/resources/config/jetty/realm.properties" todir="etc"/>
+ <deployable type="war" file="${cargo.war}"/>
+ <deployable type="war" file="${dependency.cargo.jetty-deployer}">
+ <property name="context" value="cargo-jetty-deployer"/>
+ </deployable>
+ </configuration>
+ </cargo>
+ </target>
+
+ <target name="cargo.jetty-6.1.stop" depends="cargo.setup">
+ <cargo
+ containerId="jetty6x"
+ home="${test.jetty-6.1.home}"
+ log="${cargo.log.dir}/cargo.${test.id}.shutdown.log"
+ action="stop">
+ <configuration home="${target}/cargo">
+ </configuration>
+ </cargo>
+ </target>
+
+ <target name="tests.jetty-6.1.execute" unless="tests.jetty-6.1.execute.skip">
+ <echo message="Starting Jetty 6.1 ${test.jetty-6.1.name} with ${test.jetty-6.1.home} to execute ${test.id} tests"/>
+ <antcall target="cargo.jetty-6.1.start">
+ <param name="cargo.wait" value="false"/>
+ <param name="cargo.war" value="${test.war}"/>
+ </antcall>
+ <antcall target="tests.remote">
+ <param name="test.remote.server.name" value="${test.jetty-6.1.name}"/>
+ <param name="test.remote.archive.path" value="${test.archive.path}"/>
+ </antcall>
+ <antcall target="cargo.jetty-6.1.stop">
+ </antcall>
+ </target>
+
+ <target name="tests.jetty-6.1.spi">
+ <condition property="tests.jetty-6.1.execute.skip">
+ <not>
+ <available file="${test.jetty-6.1.home}" type="dir"/>
+ </not>
+ </condition>
+ <antcall target="tests.jetty-6.1.execute">
+ <param name="test.id" value="${test.jetty-6.1.name}-spi-handler"/>
+ <param name="test.war" value="${test.temp.lib}/jetty-6.1-handler/test-spi-server.war"/>
+ <param name="test.archive.path" value="jetty-6.1-handler"/>
+ </antcall>
+ <antcall target="tests.jetty-6.1.execute">
+ <param name="test.id" value="${test.jetty-6.1.name}-spi-generic"/>
+ <param name="test.war" value="${test.temp.lib}/jetty-6.1-generic/test-spi-server.war"/>
+ <param name="test.archive.path" value="jetty-6.1-generic"/>
+ </antcall>
+ </target>
+
+ <target name="tests.jetty-6.1.endpoint">
+ <condition property="tests.jetty-6.1.execute.skip">
+ <not>
+ <available file="${test.jetty-6.1.home}" type="dir"/>
+ </not>
+ </condition>
+ <antcall target="tests.jetty-6.1.execute">
+ <param name="test.id" value="${test.jetty-6.1.name}-endpoint-default-servlet-mapping"/>
+ <param name="test.war" value="${test.temp.lib}/jetty-6.1/default-servlet-mapping.war"/>
+ <param name="test.archive.path" value=""/>
+ </antcall>
+ <antcall target="tests.jetty-6.1.execute">
+ <param name="test.id" value="${test.jetty-6.1.name}-endpoint-root-path-mapping"/>
+ <param name="test.war" value="${test.temp.lib}/jetty-6.1/root-path-mapping.war"/>
+ <param name="test.archive.path" value=""/>
+ </antcall>
+ <antcall target="tests.jetty-6.1.execute">
+ <param name="test.id" value="${test.jetty-6.1.name}-endpoint-path-mapping"/>
+ <param name="test.war" value="${test.temp.lib}/jetty-6.1/path-mapping.war"/>
+ <param name="test.archive.path" value=""/>
+ </antcall>
+ </target>
+
+ <target name="tests.jetty-6.1">
+ <!-- spi tests -->
+ <antcall target="tests.jetty-6.1.spi">
+ <param name="test.jetty-6.1.name" value="RemoteJetty_6_1"/>
+ <param name="test.jetty-6.1.home" value="${JETTY_6_1_HOME}"/>
+ </antcall>
+
+ <!-- endpoint tests -->
+ <antcall target="tests.jetty-6.1.endpoint">
+ <param name="test.jetty-6.1.name" value="RemoteJetty_6_1"/>
+ <param name="test.jetty-6.1.home" value="${JETTY_6_1_HOME}"/>
+ </antcall>
+ </target>
+
+ <target name="tests.local">
+
+ <taskdef name="jboss-unit" classname="org.jboss.unit.tooling.ant.JBossUnitTask" classpath="${plugin_classpath}"/>
+
+ <jboss-unit>
+
+ <tests config="${target}/test-classes/local-jboss-unit.xml">
+ </tests>
+
+ <reports>
+ <xml toDir="${target}/test/reports/local/xml/local"/>
+ <html toDir="${target}/test/reports/local/html/local"/>
+ </reports>
+
+ <classpath>
+ <pathelement location="${target}/test-classes/config"/>
+ <pathelement location="${target}/test-classes"/>
+
+ <pathelement path="${test_classpath}"/>
+ </classpath>
+
+ </jboss-unit>
+
+ </target>
+
+
+ <target name="tests.remote">
+
+ <echo message="test.temp.lib : ${test.temp.lib}"/>
+ <echo message="test.remote.archive.path : ${test.remote.archive.path}"/>
+
+ <taskdef name="jboss-unit" classname="org.jboss.unit.tooling.ant.JBossUnitTask" classpath="${plugin_classpath}"/>
+
+ <jboss-unit>
+
+ <tests config="${target}/test-classes/remote-jboss-unit.xml">
+ <property name="archivePath" value="${test.temp.lib}/${test.remote.archive.path}"/>
+ <property name="serverName" value="${test.remote.server.name}"/>
+ </tests>
+
+ <reports>
+ <xml toDir="${target}/test/reports/${test.id}/xml/local"/>
+ <html toDir="${target}/test/reports/${test.id}/html/local"/>
+ </reports>
+
+ <classpath>
+ <pathelement location="${target}/test-classes/config"/>
+ <pathelement location="${target}/classes"/>
+ <pathelement location="${target}/test-classes"/>
+
+ <pathelement path="${test_classpath}"/>
+ </classpath>
+
+ </jboss-unit>
+
+ </target>
+
+</project>
Copied: components/wci/trunk/test/src/test/java (from rev 217, components/wci/trunk/wci/src/test/java)
Copied: components/wci/trunk/test/src/test/resources (from rev 217, components/wci/trunk/wci/src/test/resources)
Added: components/wci/trunk/tomcat/pom.xml
===================================================================
--- components/wci/trunk/tomcat/pom.xml (rev 0)
+++ components/wci/trunk/tomcat/pom.xml 2009-10-01 03:58:59 UTC (rev 220)
@@ -0,0 +1,25 @@
+<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>module-parent</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ <relativePath>../build/pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>wci-tomcat</artifactId>
+ <packaging>jar</packaging>
+ <name>GateIn - WCI Tomcat compatibility component</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.gatein.wci</groupId>
+ <artifactId>wci-wci</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+ <properties>
+ </properties>
+
+</project>
Copied: components/wci/trunk/tomcat/src/main/java/org/gatein/wci/tomcat/TC6ContainerServlet.java (from rev 217, components/wci/trunk/wci/src/main/java/org/gatein/wci/impl/tomcat/TC6ContainerServlet.java)
===================================================================
--- components/wci/trunk/tomcat/src/main/java/org/gatein/wci/tomcat/TC6ContainerServlet.java (rev 0)
+++ components/wci/trunk/tomcat/src/main/java/org/gatein/wci/tomcat/TC6ContainerServlet.java 2009-10-01 03:58:59 UTC (rev 220)
@@ -0,0 +1,127 @@
+/******************************************************************************
+ * 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. *
+ ******************************************************************************/
+package org.gatein.wci.tomcat;
+
+import org.apache.catalina.ContainerServlet;
+import org.apache.catalina.Wrapper;
+import org.apache.catalina.Container;
+import org.apache.catalina.Engine;
+
+import javax.servlet.http.HttpServlet;
+import javax.servlet.ServletException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class TC6ContainerServlet extends HttpServlet implements ContainerServlet
+{
+
+ /** . */
+ private Wrapper wrapper;
+
+ /** . */
+ private TC6ServletContainerContext containerContext;
+
+ /** . */
+ private boolean started;
+
+ public Wrapper getWrapper()
+ {
+ return wrapper;
+ }
+
+ public void setWrapper(Wrapper wrapper)
+ {
+ this.wrapper = wrapper;
+
+ //
+ if (wrapper != null)
+ {
+ attemptStart();
+ }
+ else
+ {
+ attemptStop();
+ }
+ }
+
+ public void init() throws ServletException
+ {
+ started = true;
+
+ //
+ attemptStart();
+ }
+
+ public void destroy()
+ {
+ started = false;
+
+ //
+ attemptStop();
+ }
+
+ private void attemptStart()
+ {
+ if (started && wrapper != null)
+ {
+ start();
+ }
+ }
+
+ private void attemptStop()
+ {
+ if (!started || wrapper == null)
+ {
+ stop();
+ }
+ }
+
+ private void start()
+ {
+ Container container = wrapper;
+ while (container.getParent() != null)
+ {
+ container = container.getParent();
+ if (container instanceof Engine)
+ {
+ Engine engine = (Engine)container;
+ containerContext = new TC6ServletContainerContext(engine);
+ containerContext.start();
+ break;
+ }
+ }
+ }
+
+ private void stop()
+ {
+ if (containerContext != null)
+ {
+ containerContext.stop();
+
+ //
+ containerContext = null;
+ }
+ }
+}
Copied: components/wci/trunk/tomcat/src/main/java/org/gatein/wci/tomcat/TC6LifecycleListener.java (from rev 217, components/wci/trunk/wci/src/main/java/org/gatein/wci/impl/tomcat/TC6LifecycleListener.java)
===================================================================
--- components/wci/trunk/tomcat/src/main/java/org/gatein/wci/tomcat/TC6LifecycleListener.java (rev 0)
+++ components/wci/trunk/tomcat/src/main/java/org/gatein/wci/tomcat/TC6LifecycleListener.java 2009-10-01 03:58:59 UTC (rev 220)
@@ -0,0 +1,97 @@
+/******************************************************************************
+ * 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. *
+ ******************************************************************************/
+package org.gatein.wci.tomcat;
+
+import org.apache.catalina.LifecycleListener;
+import org.apache.catalina.LifecycleEvent;
+import org.apache.catalina.Lifecycle;
+import org.apache.catalina.Server;
+import org.apache.catalina.Service;
+import org.apache.catalina.Container;
+import org.apache.catalina.Engine;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class TC6LifecycleListener implements LifecycleListener
+{
+
+ /** . */
+ private TC6ServletContainerContext containerContext;
+
+ public synchronized void lifecycleEvent(LifecycleEvent event)
+ {
+ Lifecycle lifecycle = event.getLifecycle();
+
+ //
+ if (lifecycle instanceof Server)
+ {
+ Server server = (Server)lifecycle;
+
+ //
+ Engine engine = getEngine(server);
+
+ //
+ if (engine != null)
+ {
+ if (Lifecycle.START_EVENT.equals(event.getType()))
+ {
+ containerContext = new TC6ServletContainerContext(engine);
+ containerContext.start();
+ }
+ else if (Lifecycle.STOP_EVENT.equals(event.getType()))
+ {
+ if (containerContext != null)
+ {
+ containerContext.stop();
+ }
+ }
+ }
+ }
+ }
+
+ private Engine getEngine(Server server)
+ {
+ Service[] services = server.findServices();
+ for (int i = 0; i < services.length; i++)
+ {
+ Service service = services[i];
+ Engine engine = getEngine(service.getContainer());
+ if (engine != null)
+ {
+ return engine;
+ }
+ }
+ return null;
+ }
+
+ private Engine getEngine(Container container)
+ {
+ if (container instanceof Engine)
+ {
+ return (Engine)container;
+ }
+ return null;
+ }
+}
Copied: components/wci/trunk/tomcat/src/main/java/org/gatein/wci/tomcat/TC6ServletContainerContext.java (from rev 217, components/wci/trunk/wci/src/main/java/org/gatein/wci/impl/tomcat/TC6ServletContainerContext.java)
===================================================================
--- components/wci/trunk/tomcat/src/main/java/org/gatein/wci/tomcat/TC6ServletContainerContext.java (rev 0)
+++ components/wci/trunk/tomcat/src/main/java/org/gatein/wci/tomcat/TC6ServletContainerContext.java 2009-10-01 03:58:59 UTC (rev 220)
@@ -0,0 +1,305 @@
+/******************************************************************************
+ * 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. *
+ ******************************************************************************/
+package org.gatein.wci.tomcat;
+
+import org.apache.catalina.Container;
+import org.apache.catalina.ContainerEvent;
+import org.apache.catalina.ContainerListener;
+import org.apache.catalina.Context;
+import org.apache.catalina.Engine;
+import org.apache.catalina.Host;
+import org.apache.catalina.Lifecycle;
+import org.apache.catalina.LifecycleEvent;
+import org.apache.catalina.LifecycleListener;
+import org.gatein.wci.RequestDispatchCallback;
+import org.gatein.wci.command.CommandDispatcher;
+import org.gatein.wci.impl.DefaultServletContainerFactory;
+import org.gatein.wci.spi.ServletContainerContext;
+import org.apache.catalina.core.StandardContext;
+import org.apache.log4j.Logger;
+
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * An implementation of the <code>ServletContainerContext</code> for Tomcat.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class TC6ServletContainerContext implements ServletContainerContext, ContainerListener, LifecycleListener
+{
+ private final static Logger log = Logger.getLogger(TC6ServletContainerContext.class);
+
+ /** . */
+ private final CommandDispatcher dispatcher = new CommandDispatcher("/tomcatgateinservlet");
+
+ /** The monitored hosts. */
+ private final Set<String> monitoredHosts = new HashSet<String>();
+
+ /** The monitored contexts. */
+ private final Set<String> monitoredContexts = new HashSet<String>();
+
+ /** . */
+ private final Engine engine;
+
+ /** . */
+ private Registration registration;
+
+ public TC6ServletContainerContext(Engine engine)
+ {
+ this.engine = engine;
+ }
+
+ public Object include(
+ ServletContext targetServletContext,
+ HttpServletRequest request,
+ HttpServletResponse response,
+ RequestDispatchCallback callback,
+ Object handback) throws ServletException, IOException
+ {
+ return dispatcher.include(targetServletContext, request, response, callback, handback);
+ }
+
+ public void setCallback(Registration registration)
+ {
+ this.registration = registration;
+ }
+
+ public void unsetCallback(Registration registration)
+ {
+ this.registration = null;
+ }
+
+ public synchronized void containerEvent(ContainerEvent event)
+ {
+ if (event.getData() instanceof Host)
+ {
+ Host host = (Host)event.getData();
+
+ //
+ if (Container.ADD_CHILD_EVENT.equals(event.getType()))
+ {
+ registerHost(host);
+ }
+ else if (Container.REMOVE_CHILD_EVENT.equals(event.getType()))
+ {
+ unregisterHost(host);
+ }
+ }
+ else if (event.getData() instanceof StandardContext)
+ {
+ StandardContext context = (StandardContext)event.getData();
+
+ //
+ if (Container.ADD_CHILD_EVENT.equals(event.getType()))
+ {
+ registerContext(context);
+ }
+ else if (Container.REMOVE_CHILD_EVENT.equals(event.getType()))
+ {
+ unregisterContext(context);
+ }
+ }
+ }
+
+ public void lifecycleEvent(LifecycleEvent event)
+ {
+ if (event.getSource() instanceof Context)
+ {
+ Context context = (Context)event.getSource();
+
+ //
+ if (Lifecycle.AFTER_START_EVENT.equals(event.getType()))
+ {
+ start(context);
+ }
+ else if (Lifecycle.BEFORE_STOP_EVENT.equals(event.getType()))
+ {
+ stop(context);
+ }
+ }
+ }
+
+ void start()
+ {
+ DefaultServletContainerFactory.registerContext(this);
+
+ //
+ Container[] childrenContainers = engine.findChildren();
+ for (Container childContainer : childrenContainers)
+ {
+ if (childContainer instanceof Host)
+ {
+ Host host = (Host)childContainer;
+ registerHost(host);
+ }
+ }
+
+ //
+ engine.addContainerListener(this);
+ }
+
+ void stop()
+ {
+ engine.removeContainerListener(this);
+
+ //
+ Container[] childrenContainers = engine.findChildren();
+ for (Container childContainer : childrenContainers)
+ {
+ if (childContainer instanceof Host)
+ {
+ Host host = (Host)childContainer;
+ unregisterHost(host);
+ }
+ }
+
+ //
+ registration.cancel();
+ registration = null;
+ }
+
+ /**
+ * Register an host for registration which means that we fire events for all the contexts it contains and we
+ * subscribe for its life cycle events. If the host is already monitored nothing is done.
+ *
+ * @param host the host to register for monitoring
+ */
+ private void registerHost(Host host)
+ {
+ if (!monitoredHosts.contains(host.getName()))
+ {
+ Container[] childrenContainers = host.findChildren();
+ for (Container childContainer : childrenContainers)
+ {
+ if (childContainer instanceof StandardContext)
+ {
+ StandardContext context = (StandardContext)childContainer;
+ registerContext(context);
+ }
+ }
+
+ //
+ host.addContainerListener(this);
+
+ //
+ monitoredHosts.add(host.getName());
+ }
+ }
+
+ private void unregisterHost(Host host)
+ {
+ if (monitoredHosts.contains(host.getName()))
+ {
+ monitoredHosts.remove(host.getName());
+
+ //
+ host.removeContainerListener(this);
+
+ //
+ Container[] childrenContainers = host.findChildren();
+ for (Container childContainer : childrenContainers)
+ {
+ if (childContainer instanceof StandardContext)
+ {
+ StandardContext context = (StandardContext)childContainer;
+ unregisterContext(context);
+ }
+ }
+ }
+ }
+
+ private void registerContext(StandardContext context)
+ {
+ if (!monitoredContexts.contains(context.getName()))
+ {
+ context.addLifecycleListener(this);
+
+ //
+ if (context.getState() == 1)
+ {
+ start(context);
+ }
+
+ //
+ monitoredContexts.add(context.getName());
+ }
+ }
+
+ private void unregisterContext(StandardContext context)
+ {
+ if (monitoredContexts.contains(context.getName()))
+ {
+ monitoredContexts.remove(context.getName());
+
+ //
+ if (context.getState() == 1)
+ {
+ stop(context);
+ }
+
+ //
+ context.removeLifecycleListener(this);
+ }
+ }
+
+ private void start(Context context)
+ {
+ try
+ {
+ log.debug("Context added " + context.getPath());
+ TC6WebAppContext webAppContext = new TC6WebAppContext(context);
+
+ //
+ if (registration != null)
+ {
+ registration.registerWebApp(webAppContext);
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ private void stop(Context context)
+ {
+ try
+ {
+ if (registration != null)
+ {
+ registration.unregisterWebApp(context.getPath());
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+}
Copied: components/wci/trunk/tomcat/src/main/java/org/gatein/wci/tomcat/TC6WebAppContext.java (from rev 217, components/wci/trunk/wci/src/main/java/org/gatein/wci/impl/tomcat/TC6WebAppContext.java)
===================================================================
--- components/wci/trunk/tomcat/src/main/java/org/gatein/wci/tomcat/TC6WebAppContext.java (rev 0)
+++ components/wci/trunk/tomcat/src/main/java/org/gatein/wci/tomcat/TC6WebAppContext.java 2009-10-01 03:58:59 UTC (rev 220)
@@ -0,0 +1,130 @@
+/******************************************************************************
+ * 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. *
+ ******************************************************************************/
+package org.gatein.wci.tomcat;
+
+import org.w3c.dom.Document;
+import org.apache.catalina.Context;
+import org.apache.catalina.Wrapper;
+import org.gatein.wci.command.CommandServlet;
+import org.gatein.wci.spi.WebAppContext;
+
+import javax.servlet.ServletContext;
+import java.io.InputStream;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class TC6WebAppContext implements WebAppContext
+{
+
+ /** The logger. */
+// protected final Logger log = Logger.getLogger(getClass());
+
+ /** . */
+ private Document descriptor;
+
+ /** . */
+ private ServletContext servletContext;
+
+ /** . */
+ private ClassLoader loader;
+
+ /** . */
+ private String contextPath;
+
+ /** . */
+ private final Context context;
+
+ /** . */
+ private Wrapper commandServlet;
+
+ TC6WebAppContext(Context context) throws Exception
+ {
+ this.context = context;
+
+ //
+ servletContext = context.getServletContext();
+ loader = context.getLoader().getClassLoader();
+ contextPath = context.getPath();
+ }
+
+ public void start() throws Exception
+ {
+ try
+ {
+ commandServlet = context.createWrapper();
+ commandServlet.setName("TomcatGateInServlet");
+ commandServlet.setLoadOnStartup(0);
+ commandServlet.setServletClass(CommandServlet.class.getName());
+ context.addChild(commandServlet);
+ context.addServletMapping("/tomcatgateinservlet", "TomcatGateInServlet");
+ }
+ catch (Exception e)
+ {
+ cleanup();
+ throw e;
+ }
+ }
+
+ public void stop()
+ {
+ cleanup();
+ }
+
+ private void cleanup()
+ {
+ if (commandServlet != null)
+ {
+ try
+ {
+ context.removeServletMapping("tomcatgateinservlet");
+ context.removeChild(commandServlet);
+ }
+ catch (Exception e)
+ {
+ }
+ }
+ }
+
+ public ServletContext getServletContext()
+ {
+ return servletContext;
+ }
+
+ public ClassLoader getClassLoader()
+ {
+ return loader;
+ }
+
+ public String getContextPath()
+ {
+ return contextPath;
+ }
+
+ public boolean importFile(String parentDirRelativePath, String name, InputStream source, boolean overwrite) throws IOException
+ {
+ return false;
+ }
+}
Modified: components/wci/trunk/wci/pom.xml
===================================================================
--- components/wci/trunk/wci/pom.xml 2009-10-01 03:25:02 UTC (rev 219)
+++ components/wci/trunk/wci/pom.xml 2009-10-01 03:58:59 UTC (rev 220)
@@ -179,107 +179,6 @@
</dependency>
</dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.jvnet.maven-antrun-extended-plugin</groupId>
- <artifactId>maven-antrun-extended-plugin</artifactId>
- <version>1.13</version>
-
- <dependencies>
- <dependency>
- <groupId>org.jboss.unit</groupId>
- <artifactId>jboss-unit-tooling-ant</artifactId>
- <version>${version.jboss.unit}</version>
- </dependency>
-
- <!--stuff to run servers for tests-->
- <dependency>
- <groupId>org.codehaus.cargo</groupId>
- <artifactId>cargo-ant</artifactId>
- <version>${version.cargo}</version>
- <exclusions>
- <exclusion>
- <groupId>ant</groupId>
- <artifactId>ant</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.codehaus.cargo</groupId>
- <artifactId>cargo-core-uberjar</artifactId>
- <version>${version.cargo}</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
- <executions>
- <execution>
- <id>test</id>
- <phase>integration-test</phase>
- <configuration>
- <tasks>
-
- <property name="compile_classpath" refid="maven.compile.classpath"/>
- <property name="runtime_classpath" refid="maven.runtime.classpath"/>
- <property name="test_classpath" refid="maven.test.classpath"/>
- <property name="plugin_classpath" refid="maven.plugin.classpath"/>
- <property name="project.version" value="${project.version}"/>
-
- <!-- -->
- <property name="dependency.log4j.jar" value="${maven.dependency.apache-log4j.log4j.jar.path}"/>
- <property name="dependency.commons-logging.jar" value="${maven.dependency.commons-logging.commons-logging.jar.path}"/>
- <property name="dependency.commons-httpclient.jar" value="${maven.dependency.commons-httpclient.commons-httpclient.jar.path}"/>
- <property name="dependency.activation.jar" value="${maven.dependency.javax.activation.activation.jar.path}"/>
- <property name="dependency.junit.jar" value="${maven.dependency.junit.junit.jar.path}"/>
- <property name="dependency.cargo-manager.war" value="${maven.dependency.cargo.cargo-manager.war.path}"/>
-
- <!-- GateIn -->
- <property name="dependency.gatein-common-common.jar" value="${maven.dependency.org.gatein.common.common-common.jar.path}"/>
- <property name="dependency.gatein-common-mc.jar" value="${maven.dependency.org.gatein.common.common-mc.jar.path}"/>
-
- <!-- JBoss Unit -->
- <property name="dependency.jboss-unit.jar" value="${maven.dependency.org.jboss.unit.jboss-unit.jar.path}"/>
- <property name="dependency.jboss-unit-mc.jar" value="${maven.dependency.org.jboss.unit.jboss-unit-mc.jar.path}"/>
- <property name="dependency.jboss-unit-remote.jar" value="${maven.dependency.org.jboss.unit.jboss-unit-remote.jar.path}"/>
- <property name="dependency.portal-test.jar" value="${maven.dependency.org.jboss.unit.portal-test.jar.path}"/>
- <property name="dependency.portal-test-generic.jar" value="${maven.dependency.org.jboss.unit.portal-test-generic.jar.path}"/>
- <property name="dependency.jboss-remoting.jar" value="${maven.dependency.org.jboss.remoting.jboss-remoting.jar.path}"/>
-
- <!-- JBoss Microcontainer -->
- <property name="dependency.concurrent.jar" value="${maven.dependency.concurrent.concurrent.jar.path}"/>
- <property name="dependency.jboss-logging-spi.jar" value="${maven.dependency.jboss.jboss-common-logging-spi.jar.path}"/>
- <property name="dependency.jboss-logging-jdk.jar" value="${maven.dependency.jboss.jboss-common-logging-jdk.jar.path}"/>
- <property name="dependency.jboss-logging-log4j.jar" value="${maven.dependency.jboss.jboss-common-logging-log4j.jar.path}"/>
- <property name="dependency.jboss-kernel.jar" value="${maven.dependency.org.jboss.microcontainer.jboss-kernel.jar.path}"/>
- <property name="dependency.jboss-dependency.jar" value="${maven.dependency.org.jboss.microcontainer.jboss-dependency.jar.path}"/>
- <property name="dependency.jboss-reflect.jar" value="${maven.dependency.org.jboss.jboss-reflect.jar.path}"/>
- <property name="dependency.jboss-common-core.jar" value="${maven.dependency.org.jboss.jboss-common-core.jar.path}"/>
- <property name="dependency.jaxb.jar" value="${maven.dependency.javax.xml.bind.jaxb-api.jar.path}"/>
- <property name="dependency.jboss-mdr.jar" value="${maven.dependency.org.jboss.jboss-mdr.jar.path}"/>
- <property name="dependency.resolver.jar" value="${maven.dependency.apache-xerces.resolver.jar.path}"/>
- <property name="dependency.xercesImpl.jar" value="${maven.dependency.apache-xerces.xercesImpl.jar.path}"/>
- <property name="dependency.xml-apis.jar" value="${maven.dependency.apache-xerces.xml-apis.jar.path}"/>
- <property name="dependency.jbossxb.jar" value="${maven.dependency.org.jboss.jbossxb.jar.path}"/>
- <property name="dependency.jboss-serialization.jar" value="${maven.dependency.jboss.jboss-serialization.jar.path}"/>
-
- <!-- Cargo Jetty deployer -->
- <property name="dependency.cargo.jetty-deployer" value="${maven.dependency.org.codehaus.cargo.cargo-jetty-deployer.war.path}"/>
-
- <ant antfile="${basedir}/src/test/build.xml">
- <target name="tests"/>
- </ant>
-
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
<properties>
</properties>
</project>
Modified: components/wci/trunk/wci/src/main/java/org/gatein/wci/api/GateInServlet.java
===================================================================
--- components/wci/trunk/wci/src/main/java/org/gatein/wci/api/GateInServlet.java 2009-10-01 03:25:02 UTC (rev 219)
+++ components/wci/trunk/wci/src/main/java/org/gatein/wci/api/GateInServlet.java 2009-10-01 03:58:59 UTC (rev 220)
@@ -39,6 +39,8 @@
/** . */
private String contextPath;
+
+ private ServletContext servletContext;
public void init() throws ServletException
{
@@ -53,8 +55,9 @@
GenericWebAppContext webAppContext = new GenericWebAppContext(servletContext, contextPath, classLoader);
//
- GenericServletContainerContext.register(webAppContext);
+ GenericServletContainerContext.register(webAppContext, "/gateinservlet");
this.contextPath = contextPath;
+ this.servletContext = servletContext;
}
catch (Exception e)
{
@@ -66,7 +69,8 @@
{
if (contextPath != null)
{
- GenericServletContainerContext.unregister(contextPath);
+ //GenericServletContainerContext.unregister(contextPath);
+ GenericServletContainerContext.unregister(servletContext);
}
}
}
\ No newline at end of file
Added: components/wci/trunk/wci/src/main/java/org/gatein/wci/api/GateInServletListener.java
===================================================================
--- components/wci/trunk/wci/src/main/java/org/gatein/wci/api/GateInServletListener.java (rev 0)
+++ components/wci/trunk/wci/src/main/java/org/gatein/wci/api/GateInServletListener.java 2009-10-01 03:58:59 UTC (rev 220)
@@ -0,0 +1,57 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, 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 javax.servlet.ServletContext;
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+import org.gatein.wci.impl.generic.GenericServletContainerContext;
+import org.gatein.wci.impl.generic.GenericWebAppContext;
+
+/**
+ * @author <a href="mailto:mwringe@redhat.com">Matt Wringe</a>
+ * @version $Revision$
+ */
+public class GateInServletListener implements ServletContextListener
+{
+
+ public void contextInitialized(ServletContextEvent event)
+ {
+ ServletContext servletContext = event.getServletContext();
+
+ String contextPath = servletContext.getContextPath();
+ ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+
+ GenericWebAppContext webAppContext = new GenericWebAppContext(servletContext, contextPath, classLoader);
+
+ GenericServletContainerContext.register(webAppContext, "/PortletWrapper");
+ }
+
+ public void contextDestroyed(ServletContextEvent event)
+ {
+ ServletContext servletContext = event.getServletContext();
+ GenericServletContainerContext.unregister(servletContext);
+ }
+
+}
Modified: components/wci/trunk/wci/src/main/java/org/gatein/wci/impl/generic/GenericServletContainerContext.java
===================================================================
--- components/wci/trunk/wci/src/main/java/org/gatein/wci/impl/generic/GenericServletContainerContext.java 2009-10-01 03:25:02 UTC (rev 219)
+++ components/wci/trunk/wci/src/main/java/org/gatein/wci/impl/generic/GenericServletContainerContext.java 2009-10-01 03:58:59 UTC (rev 220)
@@ -51,6 +51,8 @@
/** . */
private static GenericServletContainerContext instance;
+ private static HashMap<ServletContext, String> requestDispatchMap = new HashMap<ServletContext, String>();
+
public static GenericServletContainerContext getInstance()
{
return instance;
@@ -63,8 +65,9 @@
{
}
- public static void register(GenericWebAppContext webAppContext)
+ public static void register(GenericWebAppContext webAppContext, String dispatcherPath)
{
+ requestDispatchMap.put(webAppContext.getServletContext(), dispatcherPath);
if (instance != null && instance.registration != null)
{
instance.registration.registerWebApp(webAppContext);
@@ -75,8 +78,12 @@
}
}
- public static void unregister(String contextPath)
+ public static void unregister(ServletContext servletContext)
{
+ requestDispatchMap.remove(servletContext);
+
+ String contextPath = servletContext.getContextPath();
+
if (instance != null && instance.registration != null)
{
instance.registration.unregisterWebApp(contextPath);
@@ -90,7 +97,7 @@
}
/** . */
- private final CommandDispatcher dispatcher = new CommandDispatcher("/gateinservlet");
+ //private final CommandDispatcher dispatcher = new CommandDispatcher("/gateinservlet");
public Object include(
ServletContext targetServletContext,
@@ -99,6 +106,9 @@
RequestDispatchCallback callback,
Object handback) throws ServletException, IOException
{
+ String dispatcherPath = requestDispatchMap.get(targetServletContext);
+ CommandDispatcher dispatcher = new CommandDispatcher(dispatcherPath);
+
return dispatcher.include(targetServletContext, request, response, callback, handback);
}
Deleted: components/wci/trunk/wci/src/test/build.xml
===================================================================
--- components/wci/trunk/wci/src/test/build.xml 2009-10-01 03:25:02 UTC (rev 219)
+++ components/wci/trunk/wci/src/test/build.xml 2009-10-01 03:58:59 UTC (rev 220)
@@ -1,1152 +0,0 @@
-<?xml version="1.0"?>
-<project name="identity-test">
-
- <target name="tests" unless="maven.test.skip">
- <antcall target="_tests"/>
- </target>
-
- <target name="_tests" depends="prepare_env, evaluate_properties" unless="maven.test.skip">
-
- <echo message="compile classpath: ${compile_classpath}"/>
- <echo message="runtime classpath: ${runtime_classpath}"/>
- <echo message="test classpath: ${test_classpath}"/>
- <echo message="plugin classpath: ${plugin_classpath}"/>
- <echo message="To run tests only for containers specified with a HOME variable use -Dtest.specified.containers"/>
-
- <!-- -->
- <delete dir="${test.temp.dir}"/>
- <antcall target="package-tests"/>
-
- <!-- -->
- <antcall target="tests.local"/>
- <antcall target="tests.call.single"/>
- <antcall target="tests.call.all"/>
-
- </target>
-
- <target name="tests.call.all" unless="tests">
- <antcall target="tests.jboss5"/>
- <antcall target="tests.jboss"/>
- <antcall target="tests.tomcat"/>
-<!-- <antcall target="tests.jetty"/> -->
- </target>
-
- <target name="tests.call.single" if="tests">
- <antcall target="tests.${tests}"/>
- </target>
-
- <!-- Aliases for easier test execution -->
- <target name="tests.jboss">
- <antcall target="tests.jboss-4.2"/>
- </target>
- <target name="tests.jboss5">
- <antcall target="tests.jboss-5.1"/>
- </target>
- <target name="tests.tomcat">
- <antcall target="tests.tomcat-6.0"/>
- </target>
- <target name="tests.jetty">
- <antcall target="tests.jetty-6.1"/>
- </target>
-
- <target name="prepare_env">
-
- <!--Relative path to target dir-->
- <property name="target" value="${basedir}/target"/>
- <property name="test.temp.dir" value="${target}/test/tmp"/>
- <mkdir dir="${test.temp.dir}"/>
- <mkdir dir="${target}/jboss-unit"/>
-
- <property name="test.temp.lib" value="${test.temp.dir}/lib"/>
- <property name="test.support" value="${test.temp.dir}/support"/>
-
- </target>
-
- <!--Lets make the check in one place so the build fail in the beggining instead of end-->
- <target name="evaluate_properties">
-
- <property environment="env"/>
-
- <!--If properties are not in command line check if they are set in env-->
- <condition property="JBOSS_4_2_3_HOME" value="${env.JBOSS_4_2_3_HOME}">
- <and>
- <isset property="env.JBOSS_4_2_3_HOME"/>
- <not>
- <isset property="JBOSS_4_2_3_HOME"/>
- </not>
- </and>
- </condition>
- <condition property="JBOSS_4_2_2_HOME" value="${env.JBOSS_4_2_2_HOME}">
- <and>
- <isset property="env.JBOSS_4_2_2_HOME"/>
- <not>
- <isset property="JBOSS_4_2_2_HOME"/>
- </not>
- </and>
- </condition>
- <condition property="JBOSS_4_2_1_HOME" value="${env.JBOSS_4_2_1_HOME}">
- <and>
- <isset property="env.JBOSS_4_2_1_HOME"/>
- <not>
- <isset property="JBOSS_4_2_1_HOME"/>
- </not>
- </and>
- </condition>
- <condition property="JBOSS_4_2_0_HOME" value="${env.JBOSS_4_2_0_HOME}">
- <and>
- <isset property="env.JBOSS_4_2_0_HOME"/>
- <not>
- <isset property="JBOSS_4_2_0_HOME"/>
- </not>
- </and>
- </condition>
- <condition property="JBOSS_5_1_0_HOME" value="${env.JBOSS_5_1_0_HOME}">
- <and>
- <isset property="env.JBOSS_5_1_0_HOME"/>
- <not>
- <isset property="JBOSS_5_1_0_HOME"/>
- </not>
- </and>
- </condition>
- <condition property="TOMCAT_6_0_HOME" value="${env.TOMCAT_6_0_HOME}">
- <and>
- <isset property="env.TOMCAT_6_0_HOME"/>
- <not>
- <isset property="TOMCAT_6_0_HOME"/>
- </not>
- </and>
- </condition>
- <condition property="JETTY_6_1_HOME" value="${env.JETTY_6_1_HOME}">
- <and>
- <isset property="env.JETTY_6_1_HOME"/>
- <not>
- <isset property="JETTY_6_1_HOME"/>
- </not>
- </and>
- </condition>
-
- <fail message="Please set the environment variable JBOSS_4_2_0_HOME or JBOSS_4_2_1_HOME or JBOSS_4_2_2_HOME or JBOSS_4_2_3_HOME or use -Dtest.specified.containers to only run tests for containers specified with a HOME variable">
- <condition>
- <and>
- <not>
- <isset property="test.specified.containers"/>
- </not>
- <not>
- <isset property="JBOSS_4_2_0_HOME"/>
- </not>
- <not>
- <isset property="JBOSS_4_2_1_HOME"/>
- </not>
- <not>
- <isset property="JBOSS_4_2_2_HOME"/>
- </not>
- <not>
- <isset property="JBOSS_4_2_3_HOME"/>
- </not>
- </and>
- </condition>
- </fail>
-
- <fail message="Please set the environment variable JBOSS_5_1_0_HOME or use -Dtest.specified.containers to only run tests for containers specified with a HOME variable">
- <condition>
- <and>
- <not>
- <isset property="test.specified.containers"/>
- </not>
- <not>
- <isset property="JBOSS_5_1_0_HOME"/>
- </not>
- </and>
- </condition>
- </fail>
-
- <fail message="Please set the environment variable TOMCAT_6_0_HOME or use -Dtest.specified.containers to only run tests for containers specified with a HOME variable">
- <condition>
- <and>
- <not>
- <isset property="test.specified.containers"/>
- </not>
- <not>
- <isset property="TOMCAT_6_0_HOME"/>
- </not>
- </and>
- </condition>
- </fail>
-
-<!-- <fail message="Please set the environment variable JETTY_6_1_HOME or use -Dtest.specified.containers to only run tests for containers specified with a HOME variable">
- <condition>
- <and>
- <not>
- <isset property="test.specified.containers"/>
- </not>
- <not>
- <isset property="JETTY_6_1_HOME"/>
- </not>
- </and>
- </condition>
- </fail> -->
-
-
- </target>
-
- <target name="package-tests">
-
- <copy todir="${test.support}">
- <fileset dir="${target}/test-classes/support"/>
- </copy>
-
- <path id="jboss-logging">
- <pathelement path="${dependency.jboss-logging-spi.jar}"/>
- <pathelement path="${dependency.jboss-logging-jdk.jar}"/>
- <pathelement path="${dependency.jboss-logging-log4j.jar}"/>
- </path>
-
- <path id="jboss-microcontainer">
- <pathelement path="${dependency.jboss-kernel.jar}"/>
- <pathelement path="${dependency.jboss-dependency.jar}"/>
- <pathelement path="${dependency.jboss-reflect.jar}"/>
- <pathelement path="${dependency.jboss-common-core.jar}"/>
- <pathelement path="${dependency.jboss-mdr.jar}"/>
- <pathelement path="${dependency.jaxb.jar}"/>
- <pathelement path="${dependency.jbossxb.jar}"/>
- </path>
-
- <path id="gatein-common">
- <pathelement path="${dependency.gatein-common-mc.jar}"/>
- </path>
-
- <path id="gatein-common-shared">
- <pathelement path="${dependency.gatein-common-common.jar}"/>
- </path>
-
- <path id="jboss-unit">
- <pathelement path="${dependency.jboss-unit.jar}"/>
- <pathelement path="${dependency.jboss-unit-mc.jar}"/>
- <pathelement path="${dependency.jboss-unit-remote.jar}"/>
- <pathelement path="${dependency.portal-test-generic.jar}"/>
- <pathelement path="${dependency.portal-test.jar}"/>
- <pathelement path="${dependency.jboss-remoting.jar}"/>
- </path>
-
- <path id="jboss-4.2">
- <path refid="gatein-common"/>
- <path refid="jboss-unit"/>
- <path refid="jboss-microcontainer"/>
- </path>
-
- <path id="jboss-4.2-shared">
- <path refid="gatein-common-shared"/>
- <path location="${target}/wci-wci-${project.version}.jar"/>
- </path>
-
- <path id="jboss-5.1">
- <path refid="gatein-common"/>
- <path refid="jboss-unit"/>
- <path refid="jboss-microcontainer"/>
- </path>
-
- <path id="jboss-5.1-shared">
- <path refid="gatein-common-shared"/>
- <path location="${target}/wci-wci-${project.version}.jar"/>
- </path>
-
- <path id="tomcat-6.0">
- <path refid="gatein-common"/>
- <path refid="jboss-unit"/>
- <path refid="jboss-microcontainer"/>
- <pathelement path="${dependency.log4j.jar}"/>
- <pathelement path="${dependency.xercesImpl.jar}"/>
- <pathelement path="${dependency.resolver.jar}"/>
- <pathelement path="${dependency.xml-apis.jar}"/>
- <pathelement path="${dependency.concurrent.jar}"/>
- </path>
-
- <path id="tomcat-6.0-shared">
- <path refid="jboss-logging"/>
- <path refid="gatein-common-shared"/>
- <path location="${dependency.log4j.jar}"/>
- <path location="${dependency.activation.jar}"/>
- <path location="${dependency.junit.jar}"/>
- <path location="${target}/wci-wci-${project.version}.jar"/>
- <path location="${dependency.jboss-serialization.jar}"/>
- </path>
-
- <path id="jetty-6.1">
- <path refid="gatein-common"/>
- <path refid="jboss-unit"/>
- <path refid="jboss-microcontainer"/>
- </path>
-
- <!-- SPI Test case-->
-
- <mkdir dir="${test.temp.lib}"/>
- <jar jarfile="${test.temp.lib}/portal-test-spi-lib.jar">
- <fileset dir="${target}/test-classes/">
- <include name="org/gatein/wci/spi/**"/>
- <include name="org/gatein/wci/ServletTestCase.class"/>
- <include name="org/gatein/wci/TestServlet.class"/>
- <include name="org/gatein/wci/WebAppRegistry.class"/>
- </fileset>
- <fileset dir="${target}/test-classes//portal-test-spi-jar"/>
- </jar>
-
- <!-- **************************** -->
- <!-- Tomcat 6.0 container servlet -->
- <!-- **************************** -->
-
- <copy todir="${test.support}/tomcat-6.0-container-servlet/server-war/WEB-INF/lib" flatten="true">
- <path refid="tomcat-6.0"/>
- </copy>
- <mkdir dir="${test.temp.lib}/tomcat-6.0-container-servlet"/>
- <war jarfile="${test.temp.lib}/tomcat-6.0-container-servlet/test-spi-server.war">
- <fileset dir="${test.support}/tomcat-6.0-container-servlet/server-war"/>
- <lib dir="${test.temp.lib}" includes="portal-test-spi-lib.jar"/>
- </war>
- <jar jarfile="${test.temp.lib}/tomcat-6.0-container-servlet/test-spi-app.war">
- <fileset dir="${target}/test-classes/spi/app-war"/>
- </jar>
-
- <!-- **************************** -->
- <!-- Tomcat 6.0 lifecyle listener -->
- <!-- **************************** -->
-
- <copy todir="${test.support}/tomcat-6.0-lifecycle-listener/server-war/WEB-INF/lib" flatten="true">
- <path refid="tomcat-6.0"/>
- </copy>
- <mkdir dir="${test.temp.lib}/tomcat-6.0-lifecycle-listener"/>
- <war jarfile="${test.temp.lib}/tomcat-6.0-lifecycle-listener/test-spi-server.war">
- <fileset dir="${test.support}/tomcat-6.0-lifecycle-listener/server-war"/>
- <lib dir="${test.temp.lib}" includes="portal-test-spi-lib.jar"/>
- </war>
- <jar jarfile="${test.temp.lib}/tomcat-6.0-lifecycle-listener/test-spi-app.war">
- <fileset dir="${target}/test-classes/spi/app-war"/>
- </jar>
-
- <!-- ****************** -->
- <!-- Tomcat 6.0 generic -->
- <!-- ****************** -->
-
- <!-- -->
- <mkdir dir="${test.support}/tomcat-6.0-generic/server-war/WEB-INF/lib"/>
- <copy todir="${test.support}/tomcat-6.0-generic/server-war/WEB-INF/lib" flatten="true">
- <path refid="tomcat-6.0"/>
- </copy>
- <mkdir dir="${test.temp.lib}/tomcat-6.0-generic"/>
- <war jarfile="${test.temp.lib}/tomcat-6.0-generic/test-spi-server.war">
- <fileset dir="${test.support}/tomcat-6.0-generic/server-war"/>
- <lib dir="${test.temp.lib}" includes="portal-test-spi-lib.jar"/>
- </war>
- <jar jarfile="${test.temp.lib}/tomcat-6.0-generic/test-spi-app.war">
- <fileset dir="${target}/test-classes/spi/generic/app-war"/>
- </jar>
-
- <!-- **************************** -->
- <!-- Jetty 6.1 handler -->
- <!-- **************************** -->
-
- <copy todir="${test.support}/jetty-6.1-handler/server-war/WEB-INF/lib" flatten="true">
- <path refid="jetty-6.1"/>
- </copy>
- <mkdir dir="${test.temp.lib}/jetty-6.1-handler"/>
- <war jarfile="${test.temp.lib}/jetty-6.1-handler/test-spi-server.war">
- <fileset dir="${test.support}/jetty-6.1-handler/server-war"/>
- <lib dir="${test.temp.lib}" includes="portal-test-spi-lib.jar"/>
- </war>
- <jar jarfile="${test.temp.lib}/jetty-6.1-handler/test-spi-app.war">
- <fileset dir="${target}/test-classes/spi/app-war"/>
- </jar>
-
- <!-- ****************** -->
- <!-- Jetty 6.1 generic -->
- <!-- ****************** -->
-
- <!-- -->
- <mkdir dir="${test.support}/jetty-6.1-generic/server-war/WEB-INF/lib"/>
- <copy todir="${test.support}/jetty-6.1-generic/server-war/WEB-INF/lib" flatten="true">
- <path refid="jetty-6.1"/>
- </copy>
- <mkdir dir="${test.temp.lib}/jetty-6.1-generic"/>
- <war jarfile="${test.temp.lib}/jetty-6.1-generic/test-spi-server.war">
- <fileset dir="${test.support}/jetty-6.1-generic/server-war"/>
- <lib dir="${test.temp.lib}" includes="portal-test-spi-lib.jar"/>
- </war>
- <jar jarfile="${test.temp.lib}/jetty-6.1-generic/test-spi-app.war">
- <fileset dir="${target}/test-classes/spi/generic/app-war"/>
- </jar>
-
- <!-- *************************** -->
- <!-- JBoss 4.2 container servlet -->
- <!-- *************************** -->
-
- <!-- -->
- <copy todir="${test.support}/jboss-4.2-container-servlet/server-war/WEB-INF/lib" flatten="true">
- <path refid="jboss-4.2"/>
- </copy>
- <mkdir dir="${test.temp.lib}/jboss-4.2-container-servlet"/>
- <war jarfile="${test.temp.lib}/jboss-4.2-container-servlet/test-spi-server.war">
- <fileset dir="${test.support}/jboss-4.2-container-servlet/server-war"/>
- <lib dir="${test.temp.lib}" includes="portal-test-spi-lib.jar"/>
- </war>
- <jar jarfile="${test.temp.lib}/jboss-4.2-container-servlet/test-spi-app.war">
- <fileset dir="${target}/test-classes/spi/app-war"/>
- </jar>
-
- <!-- ***************** -->
- <!-- JBoss 4.2 generic -->
- <!-- ***************** -->
-
- <!-- -->
- <copy todir="${test.support}/jboss-4.2-generic/server-war/WEB-INF/lib" flatten="true">
- <path refid="jboss-4.2"/>
- </copy>
- <mkdir dir="${test.temp.lib}/jboss-4.2-generic"/>
- <war jarfile="${test.temp.lib}/jboss-4.2-generic/test-spi-server.war">
- <fileset dir="${test.support}/jboss-4.2-generic/server-war"/>
- <lib dir="${test.temp.lib}" includes="portal-test-spi-lib.jar"/>
- </war>
- <jar jarfile="${test.temp.lib}/jboss-4.2-generic/test-spi-app.war">
- <fileset dir="${target}/test-classes/spi/generic/app-war"/>
- </jar>
-
- <!--endpoint test case-->
-
- <jar jarfile="${test.temp.lib}/portal-test-endpoint-lib.jar">
- <fileset dir="${target}/test-classes/">
- <include name="org/gatein/wci/endpoint/**"/>
- <include name="org/gatein/wci/ServletTestCase.class"/>
- <include name="org/gatein/wci/TestServlet.class"/>
- <include name="org/gatein/wci/WebAppRegistry.class"/>
- </fileset>
- <fileset dir="${target}/test-classes/portal-test-endpoint-jar"/>
- </jar>
-
- <!-- *************************** -->
- <!-- JBoss 5.1 container servlet -->
- <!-- *************************** -->
-
- <!-- -->
- <copy todir="${test.support}/jboss-5.1-container-servlet/server-war/WEB-INF/lib" flatten="true">
- <path refid="jboss-5.1"/>
- </copy>
- <mkdir dir="${test.temp.lib}/jboss-5.1-container-servlet"/>
- <war jarfile="${test.temp.lib}/jboss-5.1-container-servlet/test-spi-server.war">
- <fileset dir="${test.support}/jboss-5.1-container-servlet/server-war">
- <exclude name="**/jboss-kernel*.jar"/>
- </fileset>
- <lib dir="${test.temp.lib}" includes="portal-test-spi-lib.jar"/>
- </war>
- <jar jarfile="${test.temp.lib}/jboss-5.1-container-servlet/test-spi-app.war">
- <fileset dir="${target}/test-classes/spi/app-war"/>
- </jar>
-
- <!-- ***************** -->
- <!-- JBoss 5.1 generic -->
- <!-- ***************** -->
-
- <copy todir="${test.support}/jboss-5.1-generic/server-war/WEB-INF/lib" flatten="true">
- <path refid="jboss-5.1"/>
- </copy>
- <mkdir dir="${test.temp.lib}/jboss-5.1-generic"/>
- <war jarfile="${test.temp.lib}/jboss-5.1-generic/test-spi-server.war">
- <fileset dir="${test.support}/jboss-5.1-generic/server-war">
- <exclude name="**/jboss-kernel*.jar"/>
- </fileset>
- <lib dir="${test.temp.lib}" includes="portal-test-spi-lib.jar"/>
- </war>
- <jar jarfile="${test.temp.lib}/jboss-5.1-generic/test-spi-app.war">
- <fileset dir="${target}/test-classes/spi/generic/app-war">
- <exclude name="**/jboss-kernel*.jar"/>
- </fileset>
- </jar>
-
- <!--endpoint test case-->
-
- <jar jarfile="${test.temp.lib}/portal-test-endpoint-lib.jar">
- <fileset dir="${target}/test-classes/">
- <include name="org/gatein/wci/endpoint/**"/>
- <include name="org/gatein/wci/ServletTestCase.class"/>
- <include name="org/gatein/wci/TestServlet.class"/>
- <include name="org/gatein/wci/WebAppRegistry.class"/>
- </fileset>
- <fileset dir="${target}/test-classes/portal-test-endpoint-jar"/>
- </jar>
-
- <!-- ********** -->
- <!-- Tomcat 6.0 -->
- <!-- ********** -->
-
- <mkdir dir="${test.temp.lib}/tomcat-6.0"/>
-
- <copy todir="${test.support}/tomcat-6.0-endpoint/default-servlet-mapping-war/WEB-INF/lib" flatten="true">
- <path refid="tomcat-6.0"/>
- </copy>
- <war jarfile="${test.temp.lib}/tomcat-6.0/default-servlet-mapping.war">
- <fileset dir="${test.support}/tomcat-6.0-endpoint/default-servlet-mapping-war"/>
- <lib dir="${test.temp.lib}" includes="portal-test-endpoint-lib.jar"/>
- </war>
-
- <copy todir="${test.support}/tomcat-6.0-endpoint/path-mapping-war/WEB-INF/lib" flatten="true">
- <path refid="tomcat-6.0"/>
- </copy>
- <war jarfile="${test.temp.lib}/tomcat-6.0/path-mapping.war">
- <fileset dir="${test.support}/tomcat-6.0-endpoint/path-mapping-war"/>
- <lib dir="${test.temp.lib}" includes="portal-test-endpoint-lib.jar"/>
- </war>
-
- <copy todir="${test.support}/tomcat-6.0-endpoint/root-path-mapping-war/WEB-INF/lib" flatten="true">
- <path refid="tomcat-6.0"/>
- </copy>
- <war jarfile="${test.temp.lib}/tomcat-6.0/root-path-mapping.war">
- <fileset dir="${test.support}/tomcat-6.0-endpoint/root-path-mapping-war"/>
- <lib dir="${test.temp.lib}" includes="portal-test-endpoint-lib.jar"/>
- </war>
-
- <!-- ********* -->
- <!-- JETTY 6.1 -->
- <!-- ********* -->
- <mkdir dir="${test.temp.lib}/jetty-6.1"/>
-
- <copy todir="${test.support}/jetty-6.1-endpoint/default-servlet-mapping-war/WEB-INF/lib" flatten="true">
- <path refid="jetty-6.1"/>
- </copy>
- <war jarfile="${test.temp.lib}/jetty-6.1/default-servlet-mapping.war">
- <fileset dir="${test.support}/jetty-6.1-endpoint/default-servlet-mapping-war"/>
- <lib dir="${test.temp.lib}" includes="portal-test-endpoint-lib.jar"/>
- </war>
-
- <copy todir="${test.support}/jetty-6.1-endpoint/path-mapping-war/WEB-INF/lib" flatten="true">
- <path refid="jetty-6.1"/>
- </copy>
- <war jarfile="${test.temp.lib}/jetty-6.1/path-mapping.war">
- <fileset dir="${test.support}/jetty-6.1-endpoint/path-mapping-war"/>
- <lib dir="${test.temp.lib}" includes="portal-test-endpoint-lib.jar"/>
- </war>
-
- <copy todir="${test.support}/jetty-6.1-endpoint/root-path-mapping-war/WEB-INF/lib" flatten="true">
- <path refid="jetty-6.1"/>
- </copy>
- <war jarfile="${test.temp.lib}/jetty-6.1/root-path-mapping.war">
- <fileset dir="${test.support}/jetty-6.1-endpoint/root-path-mapping-war"/>
- <lib dir="${test.temp.lib}" includes="portal-test-endpoint-lib.jar"/>
- </war>
-
- <!-- ********* -->
- <!-- JBoss 4.2 -->
- <!-- ********* -->
-
- <mkdir dir="${test.temp.lib}/jboss-4.2"/>
-
- <copy todir="${test.support}/jboss-4.2-endpoint/default-servlet-mapping-war/WEB-INF/lib" flatten="true">
- <path refid="jboss-4.2"/>
- </copy>
- <war jarfile="${test.temp.lib}/jboss-4.2/default-servlet-mapping.war">
- <fileset dir="${test.support}/jboss-4.2-endpoint/default-servlet-mapping-war"/>
- <lib dir="${test.temp.lib}" includes="portal-test-endpoint-lib.jar"/>
- </war>
-
- <copy todir="${test.support}/jboss-4.2-endpoint/path-mapping-war/WEB-INF/lib" flatten="true">
- <path refid="jboss-4.2"/>
- </copy>
- <war jarfile="${test.temp.lib}/jboss-4.2/path-mapping.war">
- <fileset dir="${test.support}/jboss-4.2-endpoint/path-mapping-war"/>
- <lib dir="${test.temp.lib}" includes="portal-test-endpoint-lib.jar"/>
- </war>
-
- <copy todir="${test.support}/jboss-4.2-endpoint/root-path-mapping-war/WEB-INF/lib" flatten="true">
- <path refid="jboss-4.2"/>
- </copy>
- <war jarfile="${test.temp.lib}/jboss-4.2/root-path-mapping.war">
- <fileset dir="${test.support}/jboss-4.2-endpoint/root-path-mapping-war"/>
- <lib dir="${test.temp.lib}" includes="portal-test-endpoint-lib.jar"/>
- </war>
-
- <!-- ********* -->
- <!-- JBoss 5.1 -->
- <!-- ********* -->
-
- <mkdir dir="${test.temp.lib}/jboss-5.1"/>
-
- <copy todir="${test.support}/jboss-5.1-endpoint/default-servlet-mapping-war/WEB-INF/lib" flatten="true">
- <path refid="jboss-5.1"/>
- </copy>
- <war jarfile="${test.temp.lib}/jboss-5.1/default-servlet-mapping.war">
- <fileset dir="${test.support}/jboss-5.1-endpoint/default-servlet-mapping-war">
- <exclude name="**/jboss-kernel*.jar"/>
- </fileset>
- <lib dir="${test.temp.lib}" includes="portal-test-endpoint-lib.jar"/>
- </war>
-
- <copy todir="${test.support}/jboss-5.1-endpoint/path-mapping-war/WEB-INF/lib" flatten="true">
- <path refid="jboss-5.1"/>
- </copy>
- <war jarfile="${test.temp.lib}/jboss-5.1/path-mapping.war">
- <fileset dir="${test.support}/jboss-5.1-endpoint/path-mapping-war">
- <exclude name="**/jboss-kernel*.jar"/>
- </fileset>
- <lib dir="${test.temp.lib}" includes="portal-test-endpoint-lib.jar"/>
- </war>
-
- <copy todir="${test.support}/jboss-5.1-endpoint/root-path-mapping-war/WEB-INF/lib" flatten="true">
- <path refid="jboss-5.1"/>
- </copy>
- <war jarfile="${test.temp.lib}/jboss-5.1/root-path-mapping.war">
- <fileset dir="${test.support}/jboss-5.1-endpoint/root-path-mapping-war">
- <exclude name="**/jboss-kernel*.jar"/>
- </fileset>
- <lib dir="${test.temp.lib}" includes="portal-test-endpoint-lib.jar"/>
- </war>
-
- <!--Strip cargo manager war filename-->
- <copy file="${dependency.cargo-manager.war}" tofile="${test.temp.lib}/manager.war"/>
- <!-- unjar the war -->
- <unzip src="${test.temp.lib}/manager.war" dest="${test.temp.lib}/manager"/>
-
- </target>
-
- <target name="cargo.setup">
- <property name="cargo.log.dir" value="${target}/test/cargo"/>
- <mkdir dir="${cargo.log.dir}"/>
- <taskdef resource="cargo.tasks">
- <classpath>
- <pathelement path="${plugin_classpath}"/>
- </classpath>
- </taskdef>
- </target>
-
-
- <target name="cargo.jboss-4.2.start" depends="cargo.setup">
- <!-- The lib portal-test-lib.jar must be loaded at the shared level rather than in the war file
- otherwise it is somehow inspected and produce a NoClassDefFoundError in the web service integration
- layer on the class org/jboss/portal/test/framework/driver/remote/RemoteTestDriver for some unknown
- reason, the class initiating the loading of the RemoteTestDriver class is
- org.jboss.ws.integration.jboss42.DeployerInterceptorJSE.isWebserviceDeployment(DeployerInterceptorJSE.java:84)
- -->
-
- <cargo
- containerId="jboss42x"
- home="${test.jboss-4.2.home}"
- log="${cargo.log.dir}/cargo.${test.id}.startup.log"
- output="${cargo.log.dir}/cargo.${test.id}.server.log"
- action="start"
- wait="${cargo.wait}">
- <sharedClasspath>
-
- <path refid="jboss-4.2-shared"/>
-
- </sharedClasspath>
- <configuration home="${target}/cargo">
- <property name="cargo.rmi.port" value="1299"/>
- <property name="cargo.servlet.port" value="8080"/>
- <property name="cargo.logging" value="high"/>
- <deployable type="war" file="${cargo.war}"/>
-<!-- <property name="cargo.jvmargs" value="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8222"/> -->
- </configuration>
- </cargo>
- </target>
-
- <target name="cargo.jboss-4.2.stop" depends="cargo.setup">
- <cargo
- containerId="jboss42x"
- home="${test.jboss-4.2.home}"
- log="${cargo.log.dir}/cargo.${test.id}.shutdown.log"
- action="stop">
- <configuration home="${target}/cargo">
- <property name="cargo.rmi.port" value="1299"/>
- </configuration>
- </cargo>
- </target>
-
- <target name="tests.jboss-4.2.execute" unless="tests.jboss-4.2.execute.skip">
- <echo message="Starting JBoss 4.2 ${test.jboss-4.2.name} with ${test.jboss-4.2.home} to execute ${test.id} tests"/>
- <antcall target="cargo.jboss-4.2.start">
- <param name="cargo.wait" value="false"/>
- <param name="cargo.war" value="${test.war}"/>
- </antcall>
- <antcall target="tests.remote">
- <param name="test.remote.server.name" value="${test.jboss-4.2.name}"/>
- <param name="test.remote.archive.path" value="${test.archive.path}"/>
- </antcall>
- <antcall target="cargo.jboss-4.2.stop">
- </antcall>
- </target>
-
- <target name="tests.jboss-4.2.spi">
- <condition property="tests.jboss-4.2.execute.skip">
- <not>
- <available file="${test.jboss-4.2.home}" type="dir"/>
- </not>
- </condition>
- <antcall target="tests.jboss-4.2.execute">
- <param name="test.id" value="${test.jboss-4.2.name}-spi-container-servlet"/>
- <param name="test.war" value="${test.temp.lib}/jboss-4.2-container-servlet/test-spi-server.war"/>
- <param name="test.archive.path" value="jboss-4.2-container-servlet"/>
- </antcall>
- <antcall target="tests.jboss-4.2.execute">
- <param name="test.id" value="${test.jboss-4.2.name}-spi-generic"/>
- <param name="test.war" value="${test.temp.lib}/jboss-4.2-generic/test-spi-server.war"/>
- <param name="test.archive.path" value="jboss-4.2-generic"/>
- </antcall>
- </target>
-
- <target name="tests.jboss-4.2.endpoint">
- <condition property="tests.jboss-4.2.execute.skip">
- <not>
- <available file="${test.jboss-4.2.home}" type="dir"/>
- </not>
- </condition>
- <antcall target="tests.jboss-4.2.execute">
- <param name="test.id" value="${test.jboss-4.2.name}-endpoint-default-servlet-mapping"/>
- <param name="test.war" value="${test.temp.lib}/jboss-4.2/default-servlet-mapping.war"/>
- <param name="test.archive.path" value=""/>
- </antcall>
- <antcall target="tests.jboss-4.2.execute">
- <param name="test.id" value="${test.jboss-4.2.name}-endpoint-path-mapping"/>
- <param name="test.war" value="${test.temp.lib}/jboss-4.2/path-mapping.war"/>
- <param name="test.archive.path" value=""/>
- </antcall>
- <antcall target="tests.jboss-4.2.execute">
- <param name="test.id" value="${test.jboss-4.2.name}-endpoint-root-path-mapping"/>
- <param name="test.war" value="${test.temp.lib}/jboss-4.2/root-path-mapping.war"/>
- <param name="test.archive.path" value=""/>
- </antcall>
- </target>
-
- <target name="tests.jboss-4.2">
-
- <!-- spi tests -->
-
- <antcall target="tests.jboss-4.2.spi">
- <param name="test.jboss-4.2.name" value="RemoteJBoss_4_2_0"/>
- <param name="test.jboss-4.2.home" value="${JBOSS_4_2_0_HOME}"/>
- </antcall>
- <antcall target="tests.jboss-4.2.spi">
- <param name="test.jboss-4.2.name" value="RemoteJBoss_4_2_1"/>
- <param name="test.jboss-4.2.home" value="${JBOSS_4_2_1_HOME}"/>
- </antcall>
- <antcall target="tests.jboss-4.2.spi">
- <param name="test.jboss-4.2.name" value="RemoteJBoss_4_2_2"/>
- <param name="test.jboss-4.2.home" value="${JBOSS_4_2_2_HOME}"/>
- </antcall>
- <antcall target="tests.jboss-4.2.spi">
- <param name="test.jboss-4.2.name" value="RemoteJBoss_4_2_3"/>
- <param name="test.jboss-4.2.home" value="${JBOSS_4_2_3_HOME}"/>
- </antcall>
-
- <!-- endpoint tests -->
-
- <antcall target="tests.jboss-4.2.endpoint">
- <param name="test.jboss-4.2.name" value="RemoteJBoss_4_2_0"/>
- <param name="test.jboss-4.2.home" value="${JBOSS_4_2_0_HOME}"/>
- </antcall>
- <antcall target="tests.jboss-4.2.endpoint">
- <param name="test.jboss-4.2.name" value="RemoteJBoss_4_2_1"/>
- <param name="test.jboss-4.2.home" value="${JBOSS_4_2_1_HOME}"/>
- </antcall>
- <antcall target="tests.jboss-4.2.endpoint">
- <param name="test.jboss-4.2.name" value="RemoteJBoss_4_2_2"/>
- <param name="test.jboss-4.2.home" value="${JBOSS_4_2_2_HOME}"/>
- </antcall>
- <antcall target="tests.jboss-4.2.endpoint">
- <param name="test.jboss-4.2.name" value="RemoteJBoss_4_2_3"/>
- <param name="test.jboss-4.2.home" value="${JBOSS_4_2_3_HOME}"/>
- </antcall>
- </target>
-
- <target name="cargo.jboss-5.1.start" depends="cargo.setup">
- <!-- The lib portal-test-lib.jar must be loaded at the shared level rather than in the war file
- otherwise it is somehow inspected and produce a NoClassDefFoundError in the web service integration
- layer on the class org/jboss/portal/test/framework/driver/remote/RemoteTestDriver for some unknown
- reason, the class initiating the loading of the RemoteTestDriver class is
- org.jboss.ws.integration.jboss42.DeployerInterceptorJSE.isWebserviceDeployment(DeployerInterceptorJSE.java:84)
- -->
-
- <cargo
- containerId="jboss51x"
- home="${test.jboss-5.1.home}"
- log="${cargo.log.dir}/cargo.${test.id}.startup.log"
- output="${cargo.log.dir}/cargo.${test.id}.server.log"
- action="start"
- wait="false">
- <sharedClasspath>
-
- <path refid="jboss-5.1-shared"/>
-
- </sharedClasspath>
- <configuration home="${target}/cargo">
- <property name="cargo.rmi.port" value="1099"/>
- <property name="cargo.servlet.port" value="8080"/>
- <property name="cargo.logging" value="high"/>
- <deployable type="war" file="${cargo.war}"/>
-<!-- <property name="cargo.jvmargs" value="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8222"/> -->
- </configuration>
- </cargo>
- </target>
-
- <target name="cargo.jboss-5.1.stop" depends="cargo.setup">
- <cargo
- containerId="jboss51x"
- home="${test.jboss-5.1.home}"
- log="${cargo.log.dir}/cargo.${test.id}.shutdown.log"
- action="stop">
- <configuration home="${target}/cargo">
- <property name="cargo.rmi.port" value="1099"/>
- </configuration>
- </cargo>
- </target>
-
- <target name="tests.jboss-5.1.execute" unless="tests.jboss-5.1.execute.skip">
- <echo message="Starting JBoss 5.1 ${test.jboss-5.1.name} with ${test.jboss-5.1.home} to execute ${test.id} tests"/>
- <antcall target="cargo.jboss-5.1.start">
- <param name="cargo.wait" value="false"/>
- <param name="cargo.war" value="${test.war}"/>
- </antcall>
- <antcall target="tests.remote">
- <param name="test.remote.server.name" value="${test.jboss-5.1.name}"/>
- <param name="test.remote.archive.path" value="${test.archive.path}"/>
- </antcall>
- <antcall target="cargo.jboss-5.1.stop">
- </antcall>
- </target>
-
- <target name="tests.jboss-5.1.spi">
- <condition property="tests.jboss-5.1.execute.skip">
- <not>
- <available file="${test.jboss-5.1.home}" type="dir"/>
- </not>
- </condition>
- <antcall target="tests.jboss-5.1.execute">
- <param name="test.id" value="${test.jboss-5.1.name}-spi-container-servlet"/>
- <param name="test.war" value="${test.temp.lib}/jboss-5.1-container-servlet/test-spi-server.war"/>
- <param name="test.archive.path" value="jboss-5.1-container-servlet"/>
-
- </antcall>
- <antcall target="tests.jboss-5.1.execute">
- <param name="test.id" value="${test.jboss-5.1.name}-spi-generic"/>
- <param name="test.war" value="${test.temp.lib}/jboss-5.1-generic/test-spi-server.war"/>
- <param name="test.archive.path" value="jboss-5.1-generic"/>
- </antcall>
- </target>
-
- <target name="tests.jboss-5.1.endpoint">
- <condition property="tests.jboss-5.1.execute.skip">
- <not>
- <available file="${test.jboss-5.1.home}" type="dir"/>
- </not>
- </condition>
- <antcall target="tests.jboss-5.1.execute">
- <param name="test.id" value="${test.jboss-5.1.name}-endpoint-default-servlet-mapping"/>
- <param name="test.war" value="${test.temp.lib}/jboss-5.1/default-servlet-mapping.war"/>
- <param name="test.archive.path" value=""/>
- </antcall>
- <antcall target="tests.jboss-5.1.execute">
- <param name="test.id" value="${test.jboss-5.1.name}-endpoint-path-mapping"/>
- <param name="test.war" value="${test.temp.lib}/jboss-5.1/path-mapping.war"/>
- <param name="test.archive.path" value=""/>
- </antcall>
- <antcall target="tests.jboss-5.1.execute">
- <param name="test.id" value="${test.jboss-5.1.name}-endpoint-root-path-mapping"/>
- <param name="test.war" value="${test.temp.lib}/jboss-5.1/root-path-mapping.war"/>
- <param name="test.archive.path" value=""/>
- </antcall>
- </target>
-
- <target name="tests.jboss-5.1">
-
- <!-- spi tests -->
- <antcall target="tests.jboss-5.1.spi">
- <param name="test.jboss-5.1.name" value="RemoteJBoss_5_1"/>
- <param name="test.jboss-5.1.home" value="${JBOSS_5_1_0_HOME}"/>
- </antcall>
-
- <!-- endpoint tests -->
- <antcall target="tests.jboss-5.1.endpoint">
- <param name="test.jboss-5.1.name" value="RemoteJBoss_5_1"/>
- <param name="test.jboss-5.1.home" value="${JBOSS_5_1_0_HOME}"/>
- </antcall>
- </target>
-
- <target name="cargo.tomcat-6.0.start" depends="cargo.setup">
-
- <cargo
- containerId="tomcat6x"
- home="${test.tomcat-6.0.home}"
- output="${cargo.log.dir}/cargo.${test.id}.server.log"
- log="${cargo.log.dir}/cargo.${test.id}.start.log"
- action="start"
- wait="${cargo.wait}">
- <sharedClasspath>
-
- <path refid="tomcat-6.0-shared"/>
-
- </sharedClasspath>
- <configuration home="${target}/cargo">
- <property name="cargo.servlet.port" value="8080"/>
- <property name="cargo.logging" value="high"/>
- <!--<property name="cargo.jvmargs" value="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000"/>-->
-
- <deployable type="war" file="${test.temp.lib}/manager.war"/>
- <file file="${test.temp.lib}/manager" todir="webapps/manager"/>
- <deployable type="war" file="${cargo.war}"/>
- </configuration>
- </cargo>
- </target>
-
- <target name="cargo.tomcat-6.0.stop" depends="cargo.setup">
- <cargo
- containerId="tomcat6x"
- home="${test.tomcat-6.0.home}"
- log="${cargo.log.dir}/cargo.${test.id}.shutdown.log"
- action="stop">
- <configuration home="${target}/cargo">
- </configuration>
- </cargo>
- </target>
-
- <target name="tests.tomcat-6.0.execute" unless="tests.tomcat-6.0.execute.skip">
- <echo message="Starting Tomcat 6.0 ${test.tomcat-6.0.name} with ${test.tomcat-6.0.home} to execute ${test.id} tests"/>
- <antcall target="cargo.tomcat-6.0.start">
- <param name="cargo.wait" value="false"/>
- <param name="cargo.war" value="${test.war}"/>
- </antcall>
- <antcall target="tests.remote">
- <param name="test.remote.server.name" value="${test.tomcat-6.0.name}"/>
- <param name="test.remote.archive.path" value="${test.archive.path}"/>
- </antcall>
- <antcall target="cargo.tomcat-6.0.stop">
- </antcall>
- </target>
-
- <target name="tests.tomcat-6.0.spi">
- <condition property="tests.tomcat-6.0.execute.skip">
- <not>
- <available file="${test.tomcat-6.0.home}" type="dir"/>
- </not>
- </condition>
- <antcall target="tests.tomcat-6.0.execute">
- <param name="test.id" value="${test.tomcat-6.0.name}-spi-container-servlet"/>
- <param name="test.war" value="${test.temp.lib}/tomcat-6.0-container-servlet/test-spi-server.war"/>
- <param name="test.archive.path" value="tomcat-6.0-container-servlet"/>
- </antcall>
- <antcall target="tests.tomcat-6.0.execute">
- <param name="test.id" value="${test.tomcat-6.0.name}-spi-generic"/>
- <param name="test.war" value="${test.temp.lib}/tomcat-6.0-generic/test-spi-server.war"/>
- <param name="test.archive.path" value="tomcat-6.0-generic"/>
- </antcall>
- </target>
-
- <target name="tests.tomcat-6.0.endpoint">
- <condition property="tests.tomcat-6.0.execute.skip">
- <not>
- <available file="${test.tomcat-6.0.home}" type="dir"/>
- </not>
- </condition>
- <antcall target="tests.tomcat-6.0.execute">
- <param name="test.id" value="${test.tomcat-6.0.name}-endpoint-default-servlet-mapping"/>
- <param name="test.war" value="${test.temp.lib}/tomcat-6.0/default-servlet-mapping.war"/>
- <param name="test.archive.path" value=""/>
- </antcall>
- <antcall target="tests.tomcat-6.0.execute">
- <param name="test.id" value="${test.tomcat-6.0.name}-endpoint-root-path-mapping"/>
- <param name="test.war" value="${test.temp.lib}/tomcat-6.0/root-path-mapping.war"/>
- <param name="test.archive.path" value=""/>
- </antcall>
- <antcall target="tests.tomcat-6.0.execute">
- <param name="test.id" value="${test.tomcat-6.0.name}-endpoint-path-mapping"/>
- <param name="test.war" value="${test.temp.lib}/tomcat-6.0/path-mapping.war"/>
- <param name="test.archive.path" value=""/>
- </antcall>
- </target>
-
- <target name="tests.tomcat-6.0">
- <!-- spi tests -->
- <antcall target="tests.tomcat-6.0.spi">
- <param name="test.tomcat-6.0.name" value="RemoteTomcat_6_0"/>
- <param name="test.tomcat-6.0.home" value="${TOMCAT_6_0_HOME}"/>
- </antcall>
-
- <!-- endpoint tests -->
-
- <antcall target="tests.tomcat-6.0.endpoint">
- <param name="test.tomcat-6.0.name" value="RemoteTomcat_6_0"/>
- <param name="test.tomcat-6.0.home" value="${TOMCAT_6_0_HOME}"/>
- </antcall>
-
- </target>
-
- <target name="cargo.jetty-6.1.start" depends="cargo.setup">
- <cargo
- containerId="jetty6x"
- home="${test.jetty-6.1.home}"
- output="${cargo.log.dir}/cargo.${test.id}.server.log"
- log="${cargo.log.dir}/cargo.${test.id}.start.log"
- action="start"
- wait="${cargo.wait}">
- <extraClasspath>
- <path location="${dependency.gatein-common-common.jar}"/>
- <path location="${dependency.jboss-unit.jar}"/>
- <path location="${dependency.jboss-unit-remote.jar}"/>
- <path location="${target}/wci-wci-${project.version}.jar"/>
-
- <path location="${dependency.log4j.jar}"/>
- <path location="${dependency.concurrent.jar}"/>
- <path location="${dependency.gatein-common.jar}"/>
- <path location="${dependency.activation.jar}"/>
- <path location="${dependency.junit.jar}"/>
- <path location="${dependency.jboss-logging-spi.jar}"/>
-
- <path location="${target}/wci-wci-${project.version}.jar"/>
-
- </extraClasspath>
- <configuration home="${target}/cargo">
- <property name="cargo.servlet.port" value="8080"/>
- <property name="cargo.logging" value="high"/>
- <property name="cargo.jvmargs" value="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8222"/>
- <!-- overwrite these files to give jetty the propery security setup -->
- <configfile file="${basedir}/src/test/resources/config/jetty/jetty.xml" todir="etc"/>
- <configfile file="${basedir}/src/test/resources/config/jetty/realm.properties" todir="etc"/>
- <deployable type="war" file="${cargo.war}"/>
- <deployable type="war" file="${dependency.cargo.jetty-deployer}">
- <property name="context" value="cargo-jetty-deployer"/>
- </deployable>
- </configuration>
- </cargo>
- </target>
-
- <target name="cargo.jetty-6.1.stop" depends="cargo.setup">
- <cargo
- containerId="jetty6x"
- home="${test.jetty-6.1.home}"
- log="${cargo.log.dir}/cargo.${test.id}.shutdown.log"
- action="stop">
- <configuration home="${target}/cargo">
- </configuration>
- </cargo>
- </target>
-
- <target name="tests.jetty-6.1.execute" unless="tests.jetty-6.1.execute.skip">
- <echo message="Starting Jetty 6.1 ${test.jetty-6.1.name} with ${test.jetty-6.1.home} to execute ${test.id} tests"/>
- <antcall target="cargo.jetty-6.1.start">
- <param name="cargo.wait" value="false"/>
- <param name="cargo.war" value="${test.war}"/>
- </antcall>
- <antcall target="tests.remote">
- <param name="test.remote.server.name" value="${test.jetty-6.1.name}"/>
- <param name="test.remote.archive.path" value="${test.archive.path}"/>
- </antcall>
- <antcall target="cargo.jetty-6.1.stop">
- </antcall>
- </target>
-
- <target name="tests.jetty-6.1.spi">
- <condition property="tests.jetty-6.1.execute.skip">
- <not>
- <available file="${test.jetty-6.1.home}" type="dir"/>
- </not>
- </condition>
- <antcall target="tests.jetty-6.1.execute">
- <param name="test.id" value="${test.jetty-6.1.name}-spi-handler"/>
- <param name="test.war" value="${test.temp.lib}/jetty-6.1-handler/test-spi-server.war"/>
- <param name="test.archive.path" value="jetty-6.1-handler"/>
- </antcall>
- <antcall target="tests.jetty-6.1.execute">
- <param name="test.id" value="${test.jetty-6.1.name}-spi-generic"/>
- <param name="test.war" value="${test.temp.lib}/jetty-6.1-generic/test-spi-server.war"/>
- <param name="test.archive.path" value="jetty-6.1-generic"/>
- </antcall>
- </target>
-
- <target name="tests.jetty-6.1.endpoint">
- <condition property="tests.jetty-6.1.execute.skip">
- <not>
- <available file="${test.jetty-6.1.home}" type="dir"/>
- </not>
- </condition>
- <antcall target="tests.jetty-6.1.execute">
- <param name="test.id" value="${test.jetty-6.1.name}-endpoint-default-servlet-mapping"/>
- <param name="test.war" value="${test.temp.lib}/jetty-6.1/default-servlet-mapping.war"/>
- <param name="test.archive.path" value=""/>
- </antcall>
- <antcall target="tests.jetty-6.1.execute">
- <param name="test.id" value="${test.jetty-6.1.name}-endpoint-root-path-mapping"/>
- <param name="test.war" value="${test.temp.lib}/jetty-6.1/root-path-mapping.war"/>
- <param name="test.archive.path" value=""/>
- </antcall>
- <antcall target="tests.jetty-6.1.execute">
- <param name="test.id" value="${test.jetty-6.1.name}-endpoint-path-mapping"/>
- <param name="test.war" value="${test.temp.lib}/jetty-6.1/path-mapping.war"/>
- <param name="test.archive.path" value=""/>
- </antcall>
- </target>
-
- <target name="tests.jetty-6.1">
- <!-- spi tests -->
- <antcall target="tests.jetty-6.1.spi">
- <param name="test.jetty-6.1.name" value="RemoteJetty_6_1"/>
- <param name="test.jetty-6.1.home" value="${JETTY_6_1_HOME}"/>
- </antcall>
-
- <!-- endpoint tests -->
- <antcall target="tests.jetty-6.1.endpoint">
- <param name="test.jetty-6.1.name" value="RemoteJetty_6_1"/>
- <param name="test.jetty-6.1.home" value="${JETTY_6_1_HOME}"/>
- </antcall>
- </target>
-
- <target name="tests.local">
-
- <taskdef name="jboss-unit" classname="org.jboss.unit.tooling.ant.JBossUnitTask" classpath="${plugin_classpath}"/>
-
- <jboss-unit>
-
- <tests config="${target}/test-classes/local-jboss-unit.xml">
- </tests>
-
- <reports>
- <xml toDir="${target}/test/reports/local/xml/local"/>
- <html toDir="${target}/test/reports/local/html/local"/>
- </reports>
-
- <classpath>
- <pathelement location="${target}/test-classes/config"/>
- <pathelement location="${target}/test-classes"/>
-
- <pathelement path="${test_classpath}"/>
- </classpath>
-
- </jboss-unit>
-
- </target>
-
-
- <target name="tests.remote">
-
- <echo message="test.temp.lib : ${test.temp.lib}"/>
- <echo message="test.remote.archive.path : ${test.remote.archive.path}"/>
-
- <taskdef name="jboss-unit" classname="org.jboss.unit.tooling.ant.JBossUnitTask" classpath="${plugin_classpath}"/>
-
- <jboss-unit>
-
- <tests config="${target}/test-classes/remote-jboss-unit.xml">
- <property name="archivePath" value="${test.temp.lib}/${test.remote.archive.path}"/>
- <property name="serverName" value="${test.remote.server.name}"/>
- </tests>
-
- <reports>
- <xml toDir="${target}/test/reports/${test.id}/xml/local"/>
- <html toDir="${target}/test/reports/${test.id}/html/local"/>
- </reports>
-
- <classpath>
- <pathelement location="${target}/test-classes/config"/>
- <pathelement location="${target}/classes"/>
- <pathelement location="${target}/test-classes"/>
-
- <pathelement path="${test_classpath}"/>
- </classpath>
-
- </jboss-unit>
-
- </target>
-
-</project>
15 years, 2 months
gatein SVN: r219 - in components/wsrp/trunk: admin-gui/src/main/webapp/WEB-INF and 8 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-09-30 23:25:02 -0400 (Wed, 30 Sep 2009)
New Revision: 219
Added:
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/AbstractConsumerRegistry.java
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/ConsumerRegistry.java
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/hibernate/
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/hibernate/HibernateConsumerRegistry.java
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/xml/
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/xml/XMLConsumerRegistry.java
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/xml/XMLWSRPConsumerFactory.java
components/wsrp/trunk/consumer/src/main/resources/
components/wsrp/trunk/consumer/src/main/resources/conf/
components/wsrp/trunk/consumer/src/main/resources/conf/wsrp-consumers-config.xml
Removed:
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/ConsumerRegistry.java
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/ConsumerRegistryService.java
Modified:
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ConsumerBean.java
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ConsumerManagerBean.java
components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/faces-config.xml
components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/jboss-portlet.xml
components/wsrp/trunk/consumer/pom.xml
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/ProducerInfo.java
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/WSRPConsumerImpl.java
Log:
- Moved ConsumerRegistry to new registry package.
- Re-factored ConsumerRegistryService (now renamed AbstractConsumerRegistry) to support multiple implementations.
- Re-added loading of consumers from XML as a read-only, XML-backed implementation of ConsumerRegistry.
- Hibernate-backed implementation of ConsumerRegistry is lacking configuration and will probably be either removed or extracted in a different module.
Modified: components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ConsumerBean.java
===================================================================
--- components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ConsumerBean.java 2009-09-30 19:51:35 UTC (rev 218)
+++ components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ConsumerBean.java 2009-10-01 03:25:02 UTC (rev 219)
@@ -24,11 +24,11 @@
package org.gatein.wsrp.admin.ui;
import org.gatein.wsrp.WSRPConsumer;
-import org.gatein.wsrp.consumer.ConsumerRegistry;
import org.gatein.wsrp.consumer.EndpointConfigurationInfo;
import org.gatein.wsrp.consumer.ProducerInfo;
import org.gatein.wsrp.consumer.RegistrationInfo;
import org.gatein.wsrp.consumer.RegistrationProperty;
+import org.gatein.wsrp.consumer.registry.ConsumerRegistry;
import javax.faces.context.FacesContext;
import javax.faces.event.ValueChangeEvent;
Modified: components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ConsumerManagerBean.java
===================================================================
--- components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ConsumerManagerBean.java 2009-09-30 19:51:35 UTC (rev 218)
+++ components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ConsumerManagerBean.java 2009-10-01 03:25:02 UTC (rev 219)
@@ -24,11 +24,11 @@
package org.gatein.wsrp.admin.ui;
import org.gatein.common.util.ParameterValidation;
+import org.gatein.pc.api.PortletInvokerException;
import org.gatein.wsrp.WSRPConsumer;
-import org.gatein.wsrp.consumer.ConsumerRegistry;
import org.gatein.wsrp.consumer.RefreshResult;
import org.gatein.wsrp.consumer.RegistrationInfo;
-import org.gatein.pc.api.PortletInvokerException;
+import org.gatein.wsrp.consumer.registry.ConsumerRegistry;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
Modified: components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/faces-config.xml 2009-09-30 19:51:35 UTC (rev 218)
+++ components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/faces-config.xml 2009-10-01 03:25:02 UTC (rev 219)
@@ -63,7 +63,7 @@
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>registry</property-name>
- <property-class>org.gatein.wsrp.consumer.ConsumerRegistry</property-class>
+ <property-class>org.gatein.wsrp.consumer.registry.ConsumerRegistry</property-class>
<value>#{applicationScope.ConsumerRegistry}</value>
</managed-property>
<managed-property>
@@ -83,7 +83,7 @@
</managed-property>
<managed-property>
<property-name>registry</property-name>
- <property-class>org.gatein.wsrp.consumer.ConsumerRegistry</property-class>
+ <property-class>org.gatein.wsrp.consumer.registry.ConsumerRegistry</property-class>
<value>#{applicationScope.ConsumerRegistry}</value>
</managed-property>
<managed-property>
Modified: components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/jboss-portlet.xml
===================================================================
--- components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/jboss-portlet.xml 2009-09-30 19:51:35 UTC (rev 218)
+++ components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/jboss-portlet.xml 2009-10-01 03:25:02 UTC (rev 219)
@@ -34,7 +34,7 @@
</portlet>
<service>
<service-name>ConsumerRegistry</service-name>
- <service-class>org.gatein.wsrp.consumer.ConsumerRegistry</service-class>
+ <service-class>org.gatein.wsrp.consumer.registry.ConsumerRegistry</service-class>
<service-ref>portal.wsrp:service=ConsumerRegistry</service-ref>
</service>
<service>
Modified: components/wsrp/trunk/consumer/pom.xml
===================================================================
--- components/wsrp/trunk/consumer/pom.xml 2009-09-30 19:51:35 UTC (rev 218)
+++ components/wsrp/trunk/consumer/pom.xml 2009-10-01 03:25:02 UTC (rev 219)
@@ -107,8 +107,6 @@
</dependencies>
<build>
- <finalName>wsrp-consumer</finalName>
-
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
Deleted: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/ConsumerRegistry.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/ConsumerRegistry.java 2009-09-30 19:51:35 UTC (rev 218)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/ConsumerRegistry.java 2009-10-01 03:25:02 UTC (rev 219)
@@ -1,66 +0,0 @@
-/*
- * JBoss, a division of Red Hat
- * Copyright 2009, 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.wsrp.consumer;
-
-import org.gatein.pc.federation.FederatingPortletInvoker;
-import org.gatein.wsrp.WSRPConsumer;
-
-import java.util.List;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
- * @version $Revision: 12693 $
- * @since 2.6
- */
-public interface ConsumerRegistry
-{
- List<WSRPConsumer> getConfiguredConsumers();
-
- WSRPConsumer getConsumer(String id);
-
- FederatingPortletInvoker getFederatingPortletInvoker();
-
- WSRPConsumer createConsumer(String id, Integer expirationCacheSeconds) throws ConsumerException;
-
- void persistConsumer(WSRPConsumer consumer) throws ConsumerException;
-
- /**
- * Activates the consumer associated with the specified identifier if and only if access to the remote producer is
- * properly setup (i.e. the associated service factory MUST be available).
- *
- * @param id the identifier of the consumer to be activated
- * @throws ConsumerException
- */
- void activateConsumerWith(String id) throws ConsumerException;
-
- void updateProducerInfo(ProducerInfo producerInfo) throws ConsumerException;
-
- void deactivateConsumerWith(String id) throws ConsumerException;
-
- void registerOrDeregisterConsumerWith(String id, boolean register) throws ConsumerException;
-
- void destroyConsumer(String id) throws ConsumerException;
-
- void reloadConsumers();
-}
\ No newline at end of file
Deleted: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/ConsumerRegistryService.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/ConsumerRegistryService.java 2009-09-30 19:51:35 UTC (rev 218)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/ConsumerRegistryService.java 2009-10-01 03:25:02 UTC (rev 219)
@@ -1,434 +0,0 @@
-/*
- * JBoss, a division of Red Hat
- * Copyright 2009, 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.wsrp.consumer;
-
-import org.hibernate.HibernateException;
-import org.hibernate.Session;
-import org.hibernate.SessionFactory;
-import org.gatein.common.util.ParameterValidation;
-import org.gatein.pc.api.PortletInvoker;
-import org.gatein.pc.api.PortletInvokerException;
-import org.gatein.pc.federation.FederatedPortletInvoker;
-import org.gatein.pc.federation.FederatingPortletInvoker;
-import org.gatein.wsrp.WSRPConsumer;
-import org.gatein.wsrp.api.SessionEventBroadcaster;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.naming.InitialContext;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.SortedMap;
-import java.util.TreeMap;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
- * @version $Revision: 12693 $
- * @since 2.6
- */
-public class ConsumerRegistryService implements ConsumerRegistry
-{
- /** Gives access to the Portal's portlet invokers */
- private FederatingPortletInvoker federatingPortletInvoker;
-
- private SortedMap<String, WSRPConsumer> consumers;
-
- private SessionFactory sessionFactory;
-
- private String sessionFactoryJNDIName;
-
- private SessionEventBroadcaster sessionEventBroadcaster;
-
- private static final String CONSUMER_WITH_ID = "Consumer with id '";
- private static final String RELEASE_SESSIONS_LISTENER = "release_sessions_listener_";
-
- private static final Logger log = LoggerFactory.getLogger(ConsumerRegistryService.class);
-
- public FederatingPortletInvoker getFederatingPortletInvoker()
- {
- return federatingPortletInvoker;
- }
-
- public void setSessionEventBroadcaster(SessionEventBroadcaster sessionEventBroadcaster)
- {
- this.sessionEventBroadcaster = sessionEventBroadcaster;
- }
-
- public WSRPConsumer createConsumer(String id, Integer expirationCacheSeconds)
- {
- ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(id, "Consumer identifier", "Creating a Consumer");
-
- if (getConsumer(id) != null)
- {
- throw new ConsumerException(CONSUMER_WITH_ID + id + "' already exists!");
- }
-
-
- ProducerInfo info = new ProducerInfo();
- info.setId(id);
- info.setRegistry(this);
- info.setExpirationCacheSeconds(expirationCacheSeconds);
-
- try
- {
- Session session = sessionFactory.getCurrentSession();
-
- session.persist(info);
- }
- catch (HibernateException e)
- {
- throw new ConsumerException("Couldn't create Consumer '" + id + "'", e);
- }
-
- log.info(CONSUMER_WITH_ID + id + "' created");
- return createConsumerFrom(info);
- }
-
- public void destroyConsumer(String id)
- {
- ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(id, "Consumer identifier", "Destroying a Consumer");
-
- WSRPConsumer consumer = getConsumer(id);
- if (consumer != null)
- {
- ProducerInfo info = consumer.getProducerInfo();
-
- try
- {
- consumer.releaseSessions();
- }
- catch (PortletInvokerException e)
- {
- log.debug("releaseSessions failed when attempting to destroy " + CONSUMER_WITH_ID + id + "'");
- }
-
- // if the consumer is registered, deregister it
- if (info.isRegistered())
- {
- registerOrDeregisterConsumerWith(id, false);
- }
-
- deactivateConsumerWith(id);
- consumers.remove(id);
-
- Session session = sessionFactory.getCurrentSession();
-
- session.delete(info);
- }
- else
- {
- throw new ConsumerException(CONSUMER_WITH_ID + id + "' doesn't exist!");
- }
-
- log.info(CONSUMER_WITH_ID + id + "' destroyed");
- }
-
- public void persistConsumer(WSRPConsumer consumer)
- {
- ParameterValidation.throwIllegalArgExceptionIfNull(consumer, "Consumer");
-
- ProducerInfo info = consumer.getProducerInfo();
-
- try
- {
- Session session = sessionFactory.getCurrentSession();
- session.persist(info);
- }
- catch (HibernateException e)
- {
- throw new ConsumerException(CONSUMER_WITH_ID + info.getId() + "' couldn't be persisted!");
- }
-
- createConsumerFrom(info);
- }
-
- public void setFederatingPortletInvoker(FederatingPortletInvoker federatingPortletInvoker)
- {
- this.federatingPortletInvoker = federatingPortletInvoker;
- }
-
- public String getSessionFactoryJNDIName()
- {
- return sessionFactoryJNDIName;
- }
-
- public void setSessionFactoryJNDIName(String sessionFactoryJNDIName)
- {
- this.sessionFactoryJNDIName = sessionFactoryJNDIName;
- }
-
- private WSRPConsumer createConsumerFrom(ProducerInfo producerInfo)
- {
- WSRPConsumer consumer = new WSRPConsumerImpl(producerInfo);
- consumers.put(producerInfo.getId(), consumer);
-
- return consumer;
- }
-
- public void activateConsumerWith(String id) throws ConsumerException
- {
- ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(id, "Consumer identifier", "Activating a Consumer");
-
- // if the consumer associated with the given id is already registered, don't do anything
- if (federatingPortletInvoker.getFederatedInvoker(id) == null)
- {
- startOrStopConsumer(id, true);
- }
- else
- {
- // todo: fix-me federated portlet invoker gets desynchronized...
- WSRPConsumer consumer = getConsumer(id);
- if (consumer != null && !consumer.isActive())
- {
- federatingPortletInvoker.unregisterInvoker(id);
- startOrStopConsumer(id, true);
- }
- }
- }
-
- public void deactivateConsumerWith(String id) throws ConsumerException
- {
- ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(id, "Consumer identifier", "Deactivating a Consumer");
-
- // only process if there is a registered Consumer with the specified id
- if (federatingPortletInvoker.getFederatedInvoker(id) != null)
- {
- startOrStopConsumer(id, false);
- }
- else
- {
- // todo: fix-me federated portlet invoker gets desynchronized...
- WSRPConsumer consumer = getConsumer(id);
- if (consumer != null && consumer.isActive())
- {
- federatingPortletInvoker.registerInvoker(id, consumer);
- startOrStopConsumer(id, false);
- }
- }
- }
-
- public void updateProducerInfo(ProducerInfo producerInfo)
- {
- ParameterValidation.throwIllegalArgExceptionIfNull(producerInfo, "ProducerInfo");
-
- Session session = sessionFactory.getCurrentSession();
- try
- {
-
- // Retrieve the previous id of the given ProducerInfo to update local consumers map if needed
- String oldId = (String)session.createQuery("select pi.persistentId from ProducerInfo pi where pi.id = :key")
- .setParameter("key", producerInfo.getKey()).uniqueResult();
- if (producerInfo.getId().equals(oldId))
- {
- oldId = null; // reset oldId as the ProducerInfo's id hasn't been modified
- }
-
- // merge old producer info with new data
- session.update(producerInfo);
-
- // if we updated and oldId is not null, we need to update the local consumers map
- if (oldId != null)
- {
- WSRPConsumer consumer = consumers.remove(oldId);
- consumers.put(producerInfo.getId(), consumer);
- }
- }
- catch (HibernateException e)
- {
- throw new ConsumerException("Couldn't update ProducerInfo for Consumer '" + producerInfo.getId() + "'", e);
- }
- }
-
- protected void startService() throws Exception
- {
- InitialContext initialContext = new InitialContext();
- sessionFactory = (SessionFactory)initialContext.lookup(sessionFactoryJNDIName);
- reloadConsumers();
- }
-
- public void reloadConsumers()
- {
- // load the configured consumers
- consumers = new TreeMap<String, WSRPConsumer>();
-
- Session session = sessionFactory.getCurrentSession();
-
- Iterator producerInfos = session.createQuery("from ProducerInfo pi order by pi.persistentId").iterate();
-
- // load the configured producers
- ProducerInfo producerInfo;
- while (producerInfos.hasNext())
- {
- producerInfo = (ProducerInfo)producerInfos.next();
-
- // need to set the registry after loading from DB since registry is not persisted.
- producerInfo.setRegistry(this);
-
- createConsumerFrom(producerInfo);
-
- try
- {
- // if the producer is marked as active, activate it fo' real! :)
- if (producerInfo.isActive())
- {
- activateConsumerWith(producerInfo.getId());
- }
- }
- catch (Exception e)
- {
- producerInfo.setActive(false);
- updateProducerInfo(producerInfo);
- }
-
- }
- }
-
- protected void stopService() throws Exception
- {
- sessionFactory = null;
-
- for (WSRPConsumer consumer : consumers.values())
- {
- // if producer is not active, it shouldn't be registered with the federating portlet invoker, hence do not
- // unregister it.
- if (consumer.getProducerInfo().isActive())
- {
- federatingPortletInvoker.unregisterInvoker(consumer.getProducerId());
- }
-
- try
- {
- consumer.stop();
- }
- catch (Exception e)
- {
- // ignore and continue
- }
- }
-
- consumers.clear();
- consumers = null;
- }
-
- public List<WSRPConsumer> getConfiguredConsumers()
- {
- return new ArrayList<WSRPConsumer>(consumers.values());
- }
-
- public WSRPConsumer getConsumer(String id)
- {
- ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(id, "consumer id", null);
- return consumers.get(id);
- }
-
- public void registerOrDeregisterConsumerWith(String id, boolean register)
- {
- ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(id, "Consumer identifier", "Registering or deregistering a Consumer");
-
- WSRPConsumer consumer = getConsumer(id);
-
- if (consumer == null)
- {
- throw new ConsumerException(CONSUMER_WITH_ID + id + "' doesn't exist!");
- }
-
- try
- {
- if (register)
- {
- consumer.getProducerInfo().register();
- }
- else
- {
- consumer.getProducerInfo().deregister();
- }
- }
- catch (Exception e)
- {
- // unexpected exception: deactivate the consumer
- deactivateConsumerWith(id);
- Throwable cause = e.getCause();
- throw new ConsumerException("Couldn't " + (register ? "register" : "deregister") + CONSUMER_WITH_ID + id + "'",
- cause != null ? cause : e);
- }
- }
-
- private void startOrStopConsumer(String id, boolean start)
- {
- WSRPConsumer consumer;
-
- try
- {
- if (start)
- {
- consumer = getConsumer(id);
-
- if (consumer == null)
- {
- throw new IllegalArgumentException(CONSUMER_WITH_ID + id + "' doesn't exist!");
- }
-
- consumer.activate();
- federatingPortletInvoker.registerInvoker(id, consumer);
- sessionEventBroadcaster.registerListener(getListenerIdFrom(id), consumer);
- }
- else
- {
- FederatedPortletInvoker fedInvoker = federatingPortletInvoker.getFederatedInvoker(id);
- if (fedInvoker != null)
- {
- PortletInvoker invoker = fedInvoker.getPortletInvoker();
- if (invoker instanceof WSRPConsumer)
- {
- consumer = (WSRPConsumer)invoker;
- consumer.deactivate();
- federatingPortletInvoker.unregisterInvoker(id);
- sessionEventBroadcaster.unregisterListener(getListenerIdFrom(id));
- }
- else
- {
- throw new IllegalArgumentException("PortletInvoker with id '" + id + "' is not a WSRPConsumer!");
- }
- }
- else
- {
- throw new IllegalArgumentException("There is no registered PortletInvoker with id '" + id + "'");
- }
- }
- }
- catch (Exception e)
- {
- throw new ConsumerException("Couldn't " + (start ? "start" : "stop") + " Consumer service '" + id + "'", e);
- }
-
- // update ProducerInfo
- updateProducerInfo(consumer.getProducerInfo());
- }
-
- private String getListenerIdFrom(String id)
- {
- return RELEASE_SESSIONS_LISTENER + id;
- }
-}
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/ProducerInfo.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/ProducerInfo.java 2009-09-30 19:51:35 UTC (rev 218)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/ProducerInfo.java 2009-10-01 03:25:02 UTC (rev 219)
@@ -34,6 +34,7 @@
import org.gatein.wsrp.WSRPUtils;
import org.gatein.wsrp.consumer.portlet.WSRPPortlet;
import org.gatein.wsrp.consumer.portlet.info.WSRPPortletInfo;
+import org.gatein.wsrp.consumer.registry.ConsumerRegistry;
import org.gatein.wsrp.servlet.UserAccess;
import org.oasis.wsrp.v1.CookieProtocol;
import org.oasis.wsrp.v1.Extension;
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/WSRPConsumerImpl.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/WSRPConsumerImpl.java 2009-09-30 19:51:35 UTC (rev 218)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/WSRPConsumerImpl.java 2009-10-01 03:25:02 UTC (rev 219)
@@ -31,9 +31,9 @@
import org.gatein.pc.api.PortletInvokerException;
import org.gatein.pc.api.PortletStateType;
import org.gatein.pc.api.invocation.ActionInvocation;
+import org.gatein.pc.api.invocation.InvocationException;
import org.gatein.pc.api.invocation.PortletInvocation;
import org.gatein.pc.api.invocation.RenderInvocation;
-import org.gatein.pc.api.invocation.InvocationException;
import org.gatein.pc.api.invocation.response.PortletInvocationResponse;
import org.gatein.pc.api.spi.UserContext;
import org.gatein.pc.api.state.DestroyCloneFailure;
@@ -121,7 +121,7 @@
this(new ProducerInfo());
}
- WSRPConsumerImpl(ProducerInfo info)
+ public WSRPConsumerImpl(ProducerInfo info)
{
ParameterValidation.throwIllegalArgExceptionIfNull(info, "ProducerInfo");
@@ -196,7 +196,7 @@
{
ParameterValidation.throwIllegalArgExceptionIfNull(portletContext, "PortletContext");
- if(!PortletStateType.OPAQUE.equals(stateType))
+ if (!PortletStateType.OPAQUE.equals(stateType))
{
throw new IllegalArgumentException("This PortletInvoker cannot deal with PortletStateTypes other than PortletStateType.OPAQUE. Given: " + stateType);
}
Copied: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/AbstractConsumerRegistry.java (from rev 212, components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/ConsumerRegistryService.java)
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/AbstractConsumerRegistry.java (rev 0)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/AbstractConsumerRegistry.java 2009-10-01 03:25:02 UTC (rev 219)
@@ -0,0 +1,384 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2009, 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.wsrp.consumer.registry;
+
+import org.gatein.common.util.ParameterValidation;
+import org.gatein.pc.api.PortletInvoker;
+import org.gatein.pc.api.PortletInvokerException;
+import org.gatein.pc.federation.FederatedPortletInvoker;
+import org.gatein.pc.federation.FederatingPortletInvoker;
+import org.gatein.wsrp.WSRPConsumer;
+import org.gatein.wsrp.api.SessionEventBroadcaster;
+import org.gatein.wsrp.consumer.ConsumerException;
+import org.gatein.wsrp.consumer.ProducerInfo;
+import org.gatein.wsrp.consumer.WSRPConsumerImpl;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.SortedMap;
+import java.util.TreeMap;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision: 12693 $
+ * @since 2.6
+ */
+public abstract class AbstractConsumerRegistry implements ConsumerRegistry
+{
+ /** Gives access to the Portal's portlet invokers */
+ private FederatingPortletInvoker federatingPortletInvoker;
+
+ protected SortedMap<String, WSRPConsumer> consumers;
+
+ private SessionEventBroadcaster sessionEventBroadcaster;
+
+ private static final String CONSUMER_WITH_ID = "Consumer with id '";
+ private static final String RELEASE_SESSIONS_LISTENER = "release_sessions_listener_";
+
+ private static final Logger log = LoggerFactory.getLogger(AbstractConsumerRegistry.class);
+
+ public FederatingPortletInvoker getFederatingPortletInvoker()
+ {
+ return federatingPortletInvoker;
+ }
+
+ public void setSessionEventBroadcaster(SessionEventBroadcaster sessionEventBroadcaster)
+ {
+ this.sessionEventBroadcaster = sessionEventBroadcaster;
+ }
+
+ public WSRPConsumer createConsumer(String id, Integer expirationCacheSeconds)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(id, "Consumer identifier", "Creating a Consumer");
+
+ if (getConsumer(id) != null)
+ {
+ throw new ConsumerException(CONSUMER_WITH_ID + id + "' already exists!");
+ }
+
+
+ ProducerInfo info = new ProducerInfo();
+ info.setId(id);
+ info.setRegistry(this);
+ info.setExpirationCacheSeconds(expirationCacheSeconds);
+
+ save(info, "Couldn't create Consumer '" + id + "'");
+
+ log.info(CONSUMER_WITH_ID + id + "' created");
+ return createConsumerFrom(info);
+ }
+
+ public void destroyConsumer(String id)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(id, "Consumer identifier", "Destroying a Consumer");
+
+ WSRPConsumer consumer = getConsumer(id);
+ if (consumer != null)
+ {
+ ProducerInfo info = consumer.getProducerInfo();
+
+ try
+ {
+ consumer.releaseSessions();
+ }
+ catch (PortletInvokerException e)
+ {
+ log.debug("releaseSessions failed when attempting to destroy " + CONSUMER_WITH_ID + id + "'");
+ }
+
+ // if the consumer is registered, deregister it
+ if (info.isRegistered())
+ {
+ registerOrDeregisterConsumerWith(id, false);
+ }
+
+ deactivateConsumerWith(id);
+ consumers.remove(id);
+
+ delete(info);
+ }
+ else
+ {
+ throw new ConsumerException(CONSUMER_WITH_ID + id + "' doesn't exist!");
+ }
+
+ log.info(CONSUMER_WITH_ID + id + "' destroyed");
+ }
+
+ public void persistConsumer(WSRPConsumer consumer)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNull(consumer, "Consumer");
+
+ ProducerInfo info = consumer.getProducerInfo();
+
+ save(info, CONSUMER_WITH_ID + info.getId() + "' couldn't be persisted!");
+
+ createConsumerFrom(info);
+ }
+
+ public void setFederatingPortletInvoker(FederatingPortletInvoker federatingPortletInvoker)
+ {
+ this.federatingPortletInvoker = federatingPortletInvoker;
+ }
+
+ private WSRPConsumer createConsumerFrom(ProducerInfo producerInfo)
+ {
+ WSRPConsumer consumer = new WSRPConsumerImpl(producerInfo);
+ consumers.put(producerInfo.getId(), consumer);
+
+ return consumer;
+ }
+
+ public void activateConsumerWith(String id) throws ConsumerException
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(id, "Consumer identifier", "Activating a Consumer");
+
+ // if the consumer associated with the given id is already registered, don't do anything
+ if (federatingPortletInvoker.getFederatedInvoker(id) == null)
+ {
+ startOrStopConsumer(id, true);
+ }
+ else
+ {
+ // todo: fix-me federated portlet invoker gets desynchronized...
+ WSRPConsumer consumer = getConsumer(id);
+ if (consumer != null && !consumer.isActive())
+ {
+ federatingPortletInvoker.unregisterInvoker(id);
+ startOrStopConsumer(id, true);
+ }
+ }
+ }
+
+ public void deactivateConsumerWith(String id) throws ConsumerException
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(id, "Consumer identifier", "Deactivating a Consumer");
+
+ // only process if there is a registered Consumer with the specified id
+ if (federatingPortletInvoker.getFederatedInvoker(id) != null)
+ {
+ startOrStopConsumer(id, false);
+ }
+ else
+ {
+ // todo: fix-me federated portlet invoker gets desynchronized...
+ WSRPConsumer consumer = getConsumer(id);
+ if (consumer != null && consumer.isActive())
+ {
+ federatingPortletInvoker.registerInvoker(id, consumer);
+ startOrStopConsumer(id, false);
+ }
+ }
+ }
+
+ public void updateProducerInfo(ProducerInfo producerInfo)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNull(producerInfo, "ProducerInfo");
+
+ String oldId = update(producerInfo);
+
+ // if we updated and oldId is not null, we need to update the local consumers map
+ if (oldId != null)
+ {
+ WSRPConsumer consumer = consumers.remove(oldId);
+ consumers.put(producerInfo.getId(), consumer);
+ }
+ }
+
+ public void start() throws Exception
+ {
+ reloadConsumers();
+ }
+
+ public void reloadConsumers()
+ {
+ // load the configured consumers
+ consumers = new TreeMap<String, WSRPConsumer>();
+
+ Iterator producerInfos = getAllProducerInfos();
+
+ // load the configured producers
+ ProducerInfo producerInfo;
+ while (producerInfos.hasNext())
+ {
+ producerInfo = (ProducerInfo)producerInfos.next();
+
+ // need to set the registry after loading from DB since registry is not persisted.
+ producerInfo.setRegistry(this);
+
+ createConsumerFrom(producerInfo);
+
+ try
+ {
+ // if the producer is marked as active, activate it fo' real! :)
+ if (producerInfo.isActive())
+ {
+ activateConsumerWith(producerInfo.getId());
+ }
+ }
+ catch (Exception e)
+ {
+ producerInfo.setActive(false);
+ updateProducerInfo(producerInfo);
+ }
+
+ }
+ }
+
+ public void stop() throws Exception
+ {
+ for (WSRPConsumer consumer : consumers.values())
+ {
+ // if producer is not active, it shouldn't be registered with the federating portlet invoker, hence do not
+ // unregister it.
+ if (consumer.getProducerInfo().isActive())
+ {
+ federatingPortletInvoker.unregisterInvoker(consumer.getProducerId());
+ }
+
+ try
+ {
+ consumer.stop();
+ }
+ catch (Exception e)
+ {
+ // ignore and continue
+ }
+ }
+
+ consumers.clear();
+ consumers = null;
+ }
+
+ public List<WSRPConsumer> getConfiguredConsumers()
+ {
+ return new ArrayList<WSRPConsumer>(consumers.values());
+ }
+
+ public WSRPConsumer getConsumer(String id)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(id, "consumer id", null);
+ return consumers.get(id);
+ }
+
+ public void registerOrDeregisterConsumerWith(String id, boolean register)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(id, "Consumer identifier", "Registering or deregistering a Consumer");
+
+ WSRPConsumer consumer = getConsumer(id);
+
+ if (consumer == null)
+ {
+ throw new ConsumerException(CONSUMER_WITH_ID + id + "' doesn't exist!");
+ }
+
+ try
+ {
+ if (register)
+ {
+ consumer.getProducerInfo().register();
+ }
+ else
+ {
+ consumer.getProducerInfo().deregister();
+ }
+ }
+ catch (Exception e)
+ {
+ // unexpected exception: deactivate the consumer
+ deactivateConsumerWith(id);
+ Throwable cause = e.getCause();
+ throw new ConsumerException("Couldn't " + (register ? "register" : "deregister") + CONSUMER_WITH_ID + id + "'",
+ cause != null ? cause : e);
+ }
+ }
+
+ private void startOrStopConsumer(String id, boolean start)
+ {
+ WSRPConsumer consumer;
+
+ try
+ {
+ if (start)
+ {
+ consumer = getConsumer(id);
+
+ if (consumer == null)
+ {
+ throw new IllegalArgumentException(CONSUMER_WITH_ID + id + "' doesn't exist!");
+ }
+
+ consumer.activate();
+ federatingPortletInvoker.registerInvoker(id, consumer);
+ sessionEventBroadcaster.registerListener(getListenerIdFrom(id), consumer);
+ }
+ else
+ {
+ FederatedPortletInvoker fedInvoker = federatingPortletInvoker.getFederatedInvoker(id);
+ if (fedInvoker != null)
+ {
+ PortletInvoker invoker = fedInvoker.getPortletInvoker();
+ if (invoker instanceof WSRPConsumer)
+ {
+ consumer = (WSRPConsumer)invoker;
+ consumer.deactivate();
+ federatingPortletInvoker.unregisterInvoker(id);
+ sessionEventBroadcaster.unregisterListener(getListenerIdFrom(id));
+ }
+ else
+ {
+ throw new IllegalArgumentException("PortletInvoker with id '" + id + "' is not a WSRPConsumer!");
+ }
+ }
+ else
+ {
+ throw new IllegalArgumentException("There is no registered PortletInvoker with id '" + id + "'");
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ throw new ConsumerException("Couldn't " + (start ? "start" : "stop") + " Consumer service '" + id + "'", e);
+ }
+
+ // update ProducerInfo
+ updateProducerInfo(consumer.getProducerInfo());
+ }
+
+ private String getListenerIdFrom(String id)
+ {
+ return RELEASE_SESSIONS_LISTENER + id;
+ }
+
+ protected abstract void save(ProducerInfo info, String messageOnError);
+
+ protected abstract void delete(ProducerInfo info);
+
+ protected abstract String update(ProducerInfo producerInfo);
+
+ protected abstract Iterator getAllProducerInfos();
+}
Copied: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/ConsumerRegistry.java (from rev 212, components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/ConsumerRegistry.java)
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/ConsumerRegistry.java (rev 0)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/ConsumerRegistry.java 2009-10-01 03:25:02 UTC (rev 219)
@@ -0,0 +1,77 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2009, 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.wsrp.consumer.registry;
+
+import org.gatein.pc.federation.FederatingPortletInvoker;
+import org.gatein.wsrp.WSRPConsumer;
+import org.gatein.wsrp.api.SessionEventBroadcaster;
+import org.gatein.wsrp.consumer.ConsumerException;
+import org.gatein.wsrp.consumer.ProducerInfo;
+
+import java.util.List;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision: 12693 $
+ * @since 2.6
+ */
+public interface ConsumerRegistry
+{
+ List<WSRPConsumer> getConfiguredConsumers();
+
+ WSRPConsumer getConsumer(String id);
+
+ FederatingPortletInvoker getFederatingPortletInvoker();
+
+ WSRPConsumer createConsumer(String id, Integer expirationCacheSeconds) throws ConsumerException;
+
+ void persistConsumer(WSRPConsumer consumer) throws ConsumerException;
+
+ /**
+ * Activates the consumer associated with the specified identifier if and only if access to the remote producer is
+ * properly setup (i.e. the associated service factory MUST be available).
+ *
+ * @param id the identifier of the consumer to be activated
+ * @throws ConsumerException
+ */
+ void activateConsumerWith(String id) throws ConsumerException;
+
+ void updateProducerInfo(ProducerInfo producerInfo) throws ConsumerException;
+
+ void deactivateConsumerWith(String id) throws ConsumerException;
+
+ void registerOrDeregisterConsumerWith(String id, boolean register) throws ConsumerException;
+
+ void destroyConsumer(String id) throws ConsumerException;
+
+ void reloadConsumers();
+
+ void start() throws Exception;
+
+ void stop() throws Exception;
+
+ void setSessionEventBroadcaster(SessionEventBroadcaster sessionEventBroadcaster);
+
+ void setFederatingPortletInvoker(FederatingPortletInvoker federatingPortletInvoker);
+}
\ No newline at end of file
Added: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/hibernate/HibernateConsumerRegistry.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/hibernate/HibernateConsumerRegistry.java (rev 0)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/hibernate/HibernateConsumerRegistry.java 2009-10-01 03:25:02 UTC (rev 219)
@@ -0,0 +1,129 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2008, 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.wsrp.consumer.registry.hibernate;
+
+import org.gatein.wsrp.consumer.ConsumerException;
+import org.gatein.wsrp.consumer.ProducerInfo;
+import org.gatein.wsrp.consumer.registry.AbstractConsumerRegistry;
+import org.hibernate.HibernateException;
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+
+import javax.naming.InitialContext;
+import java.util.Iterator;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class HibernateConsumerRegistry extends AbstractConsumerRegistry
+{
+ private SessionFactory sessionFactory;
+ private String sessionFactoryJNDIName;
+
+ protected void save(ProducerInfo info, String messageOnError)
+ {
+ try
+ {
+ Session session = sessionFactory.getCurrentSession();
+ session.persist(info);
+ }
+ catch (HibernateException e)
+ {
+ throw new ConsumerException(messageOnError, e);
+ }
+ }
+
+ protected void delete(ProducerInfo info)
+ {
+ Session session = sessionFactory.getCurrentSession();
+
+ session.delete(info);
+ }
+
+ public String getSessionFactoryJNDIName()
+ {
+ return sessionFactoryJNDIName;
+ }
+
+ public void setSessionFactoryJNDIName(String sessionFactoryJNDIName)
+ {
+ this.sessionFactoryJNDIName = sessionFactoryJNDIName;
+ }
+
+ /**
+ * Updates the given ProducerInfo
+ *
+ * @param producerInfo the ProducerInfo to update
+ * @return the id that was previously assigned to the specified ProducerInfo or <code>null</code> if the id hasn't
+ * been modified
+ */
+ protected String update(ProducerInfo producerInfo)
+ {
+ String oldId;
+ Session session = sessionFactory.getCurrentSession();
+ try
+ {
+
+ // Retrieve the previous id of the given ProducerInfo to update local consumers map if needed
+ oldId = (String)session.createQuery("select pi.persistentId from ProducerInfo pi where pi.id = :key")
+ .setParameter("key", producerInfo.getKey()).uniqueResult();
+ if (producerInfo.getId().equals(oldId))
+ {
+ oldId = null; // reset oldId as the ProducerInfo's id hasn't been modified
+ }
+
+ // merge old producer info with new data
+ session.update(producerInfo);
+
+ }
+ catch (HibernateException e)
+ {
+ throw new ConsumerException("Couldn't update ProducerInfo for Consumer '" + producerInfo.getId() + "'", e);
+ }
+ return oldId;
+ }
+
+ protected Iterator getAllProducerInfos()
+ {
+ Session session = sessionFactory.getCurrentSession();
+
+ Iterator producerInfos = session.createQuery("from ProducerInfo pi order by pi.persistentId").iterate();
+ return producerInfos;
+ }
+
+ @Override
+ public void start() throws Exception
+ {
+ InitialContext initialContext = new InitialContext();
+ sessionFactory = (SessionFactory)initialContext.lookup(sessionFactoryJNDIName);
+ super.start();
+ }
+
+ @Override
+ public void stop() throws Exception
+ {
+ sessionFactory = null;
+ super.stop();
+ }
+}
Added: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/xml/XMLConsumerRegistry.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/xml/XMLConsumerRegistry.java (rev 0)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/xml/XMLConsumerRegistry.java 2009-10-01 03:25:02 UTC (rev 219)
@@ -0,0 +1,139 @@
+/******************************************************************************
+ * 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. *
+ ******************************************************************************/
+package org.gatein.wsrp.consumer.registry.xml;
+
+import org.gatein.common.xml.NullEntityResolver;
+import org.gatein.wsrp.WSRPConsumer;
+import org.gatein.wsrp.consumer.ProducerInfo;
+import org.gatein.wsrp.consumer.registry.AbstractConsumerRegistry;
+import org.jboss.xb.binding.JBossXBException;
+import org.jboss.xb.binding.ObjectModelFactory;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.UnmarshallerFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xml.sax.EntityResolver;
+
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Iterator;
+import java.util.SortedMap;
+import java.util.TreeMap;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision: 9360 $
+ */
+public class XMLConsumerRegistry extends AbstractConsumerRegistry
+{
+ private final static Logger log = LoggerFactory.getLogger(XMLConsumerRegistry.class);
+
+ /** . */
+ private static final String defaultWSRPLocation = "conf/wsrp-consumers-config.xml";
+
+ private EntityResolver entityResolver;
+
+ public XMLConsumerRegistry()
+ {
+ consumers = new TreeMap<String, WSRPConsumer>();
+ }
+
+ public EntityResolver getEntityResolver()
+ {
+ return entityResolver;
+ }
+
+ public void setEntityResolver(EntityResolver entityResolver)
+ {
+ this.entityResolver = entityResolver;
+ }
+
+ public void start() throws Exception
+ {
+ URL defaultWSRPURL = Thread.currentThread().getContextClassLoader().getResource(defaultWSRPLocation);
+ if (defaultWSRPURL != null)
+ {
+ InputStream inputStream = defaultWSRPURL.openStream();
+
+ Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
+ ObjectModelFactory factory = new XMLWSRPConsumerFactory(this);
+ if (entityResolver == null)
+ {
+ log.debug("Could not obtain entity resolver for XMLConsumerRegistry");
+ entityResolver = new NullEntityResolver();
+ }
+ unmarshaller.setEntityResolver(entityResolver);
+ try
+ {
+ consumers = (SortedMap<String, WSRPConsumer>)unmarshaller.unmarshal(inputStream, factory, null);
+ }
+ catch (JBossXBException e)
+ {
+ e.printStackTrace();
+ }
+
+ for (WSRPConsumer consumer : consumers.values())
+ {
+ activateConsumerWith(consumer.getProducerId());
+ }
+ }
+ }
+
+ @Override
+ public void stop() throws Exception
+ {
+ for (WSRPConsumer consumer : consumers.values())
+ {
+ consumer.stop();
+ }
+ }
+
+ @Override
+ protected void save(ProducerInfo info, String messageOnError)
+ {
+ // do nothing
+ }
+
+ @Override
+ protected void delete(ProducerInfo info)
+ {
+ // do nothing
+ }
+
+ @Override
+ protected String update(ProducerInfo producerInfo)
+ {
+ return null;
+ }
+
+ @Override
+ protected Iterator getAllProducerInfos()
+ {
+ return consumers.values().iterator();
+ }
+
+ SortedMap<String, WSRPConsumer> getConsumers()
+ {
+ return consumers;
+ }
+}
Property changes on: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/xml/XMLConsumerRegistry.java
___________________________________________________________________
Name: svn:executable
+ *
Added: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/xml/XMLWSRPConsumerFactory.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/xml/XMLWSRPConsumerFactory.java (rev 0)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/xml/XMLWSRPConsumerFactory.java 2009-10-01 03:25:02 UTC (rev 219)
@@ -0,0 +1,366 @@
+/******************************************************************************
+ * 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. *
+ ******************************************************************************/
+package org.gatein.wsrp.consumer.registry.xml;
+
+import org.gatein.common.util.ParameterValidation;
+import org.gatein.wsrp.WSRPConsumer;
+import org.gatein.wsrp.consumer.EndpointConfigurationInfo;
+import org.gatein.wsrp.consumer.ProducerInfo;
+import org.gatein.wsrp.consumer.RegistrationInfo;
+import org.gatein.wsrp.consumer.registry.ConsumerRegistry;
+import org.jboss.util.StringPropertyReplacer;
+import org.jboss.xb.binding.GenericObjectModelFactory;
+import org.jboss.xb.binding.UnmarshallingContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xml.sax.Attributes;
+
+import java.util.SortedMap;
+import java.util.TreeMap;
+
+/**
+ * Wire the mbeans to install
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 8784 $
+ */
+public class XMLWSRPConsumerFactory implements GenericObjectModelFactory
+{
+ private static final Logger log = LoggerFactory.getLogger(XMLWSRPConsumerFactory.class);
+
+ private ConsumerRegistry consumerRegistry;
+
+ private static final boolean DEBUG = true;
+
+ /** . */
+ private static final String WSRP_PRODUCER = "wsrp-producer";
+
+ public static class Property
+ {
+ String name;
+ String value;
+ String lang;
+ }
+
+ public XMLWSRPConsumerFactory(ConsumerRegistry consumerRegistry)
+ {
+ this.consumerRegistry = consumerRegistry;
+ }
+
+ public Object newRoot(Object root, UnmarshallingContext nav, String nsURI, String localName, Attributes attrs)
+ {
+ if (consumerRegistry instanceof XMLConsumerRegistry)
+ {
+ XMLConsumerRegistry registry = (XMLConsumerRegistry)consumerRegistry;
+ return registry.getConsumers();
+ }
+
+ return new TreeMap<String, WSRPConsumer>();
+ }
+
+ public Object completeRoot(Object root, UnmarshallingContext nav, String nsURI, String localName)
+ {
+ return root;
+ }
+
+ public Object newChild(Object parent, UnmarshallingContext unmarshallingContext, String nsURI, String localName, Attributes attributes)
+ {
+ if (parent instanceof SortedMap)
+ {
+ return newChild((SortedMap<String, WSRPConsumer>)parent, unmarshallingContext, nsURI, localName, attributes);
+ }
+ if (parent instanceof RegistrationInfo)
+ {
+ return newChild((RegistrationInfo)parent, unmarshallingContext, nsURI, localName, attributes);
+ }
+ if (parent instanceof WSRPConsumer)
+ {
+ return newChild((WSRPConsumer)parent, unmarshallingContext, nsURI, localName, attributes);
+ }
+ return null;
+ }
+
+ public void addChild(Object parent, Object child, UnmarshallingContext unmarshallingContext, String nsURI, String localName)
+ {
+ if (parent instanceof RegistrationInfo && child instanceof Property)
+ {
+ addChild((RegistrationInfo)parent, (Property)child, unmarshallingContext, nsURI, localName);
+ }
+ else if (parent instanceof SortedMap && child instanceof WSRPConsumer)
+ {
+ addChild((SortedMap<String, WSRPConsumer>)parent, (WSRPConsumer)child, unmarshallingContext, nsURI, localName);
+ }
+ }
+
+ public void setValue(Object parent, UnmarshallingContext unmarshallingContext, String nsURI, String localName, String value)
+ {
+ if (parent instanceof EndpointConfigurationInfo)
+ {
+ setValue((EndpointConfigurationInfo)parent, unmarshallingContext, nsURI, localName, value);
+ }
+ else if (parent instanceof Property)
+ {
+ setValue((Property)parent, unmarshallingContext, nsURI, localName, value);
+ }
+ else if (parent instanceof RegistrationInfo)
+ {
+ setValue((RegistrationInfo)parent, unmarshallingContext, nsURI, localName, value);
+ }
+ }
+
+ public Object newChild(SortedMap<String, WSRPConsumer> consumers, UnmarshallingContext nav, String nsURI, String localName,
+ Attributes attrs)
+ {
+ if (DEBUG)
+ {
+ System.out.println("newchild deployment " + localName);
+ }
+
+ if (WSRP_PRODUCER.equals(localName))
+ {
+ String id = attrs.getValue("id");
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(id, "producer identifier", "Configuring a producer");
+
+ // check that the consumer doesn't exist in the database first
+ WSRPConsumer consumer = consumerRegistry.getConsumer(id);
+ if (consumer != null)
+ {
+ String message = "Added consumer for producer '" + id + "' with status: ";
+
+ // if consumer is active, add it to the list of services
+ if (consumer.getProducerInfo().isActive())
+ {
+ consumers.put(id, consumer);
+ message += "active";
+ }
+ else
+ {
+ message += "inactive";
+ }
+
+ log.info(message + " (loaded from database).");
+
+ // consumer already exists, do not further process this producer and use the DB configuration instead
+ return null;
+ }
+
+ String expirationCache = attrs.getValue("expiration-cache");
+ Integer expirationCacheSeconds = null;
+ if (expirationCache != null)
+ {
+ try
+ {
+ expirationCacheSeconds = new Integer(expirationCache);
+ }
+ catch (NumberFormatException e)
+ {
+ log.info("Ignoring bad expiration cache value " + expirationCache + " for producer '" + id + "'");
+ }
+ }
+
+ // consumer didn't exist in the database, so create one and configure it
+ consumer = consumerRegistry.createConsumer(id, expirationCacheSeconds);
+
+ return consumer;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public Object newChild(WSRPConsumer consumer, UnmarshallingContext nav, String nsURI, String localName,
+ Attributes attrs)
+ {
+ if (DEBUG)
+ {
+ System.out.println("newchild service " + localName);
+ }
+
+ ProducerInfo prodInfo = consumer.getProducerInfo();
+
+ if ("endpoint-config".equals(localName) || "endpoint-wsdl-url".equals(localName))
+ {
+ return prodInfo.getEndpointConfigurationInfo();
+ }
+ else if ("registration-data".equals(localName))
+ {
+ return new RegistrationInfo(prodInfo);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public Object newChild(RegistrationInfo registrationInfo, UnmarshallingContext nav, String nsURI, String localName,
+ Attributes attrs)
+ {
+ if (DEBUG)
+ {
+ System.out.println("newChild registrationInfo " + localName);
+ }
+
+ if ("property".equals(localName))
+ {
+ return new Property();
+ }
+ return null;
+ }
+
+ public void setValue(EndpointConfigurationInfo endpointInfo, UnmarshallingContext nav, String nsURI,
+ String localName, String value)
+ {
+ if (DEBUG)
+ {
+ System.out.println("setvalue endpointInfo " + localName);
+ }
+
+ if ("service-description-url".equals(localName))
+ {
+ // Resolve value that may contain properties for that one
+ value = StringPropertyReplacer.replaceProperties(value);
+ endpointInfo.setServiceDescriptionURL(value);
+ }
+ else if ("markup-url".equals(localName))
+ {
+ // Resolve value that may contain properties for that one
+ value = StringPropertyReplacer.replaceProperties(value);
+ endpointInfo.setMarkupURL(value);
+ }
+ else if ("registration-url".equals(localName))
+ {
+ // Resolve value that may contain properties for that one
+ value = StringPropertyReplacer.replaceProperties(value);
+ endpointInfo.setRegistrationURL(value);
+ }
+ else if ("portlet-management-url".equals(localName))
+ {
+ // Resolve value that may contain properties for that one
+ value = StringPropertyReplacer.replaceProperties(value);
+ endpointInfo.setPortletManagementURL(value);
+ }
+ else if ("endpoint-wsdl-url".equals(localName))
+ {
+ value = StringPropertyReplacer.replaceProperties(value);
+ try
+ {
+ endpointInfo.setWsdlDefinitionURL(value);
+ }
+ catch (RuntimeException e)
+ {
+ // ignore at this point if the WSDL cannot be retrieved, another attempt will be made before persisting
+ }
+ }
+ }
+
+ public void setValue(RegistrationInfo registrationInfo, UnmarshallingContext nav, String nsURI, String localName,
+ String value)
+ {
+ if (DEBUG)
+ {
+ System.out.println("setvalue registrationinfo " + localName);
+ }
+
+ if ("consumer-name".equals(localName))
+ {
+ value = StringPropertyReplacer.replaceProperties(value);
+ registrationInfo.setConsumerName(value);
+ }
+ }
+
+ public void setValue(Property property, UnmarshallingContext nav, String nsURI, String localName, String value)
+ {
+ if (DEBUG)
+ {
+ System.out.println("setvalue property " + localName);
+ }
+
+ if ("name".equals(localName))
+ {
+ value = StringPropertyReplacer.replaceProperties(value);
+ property.name = value;
+ }
+ else if ("lang".equals(localName))
+ {
+ value = StringPropertyReplacer.replaceProperties(value);
+ property.lang = value;
+ }
+ else if ("value".equals(localName))
+ {
+ value = StringPropertyReplacer.replaceProperties(value);
+ property.value = value;
+ }
+ }
+
+ public void addChild(RegistrationInfo registrationInfo, Property property,
+ UnmarshallingContext nav, String nsURI, String localName)
+ {
+ if (DEBUG)
+ {
+ System.out.println("addchild registrationinfo property " + localName);
+ }
+
+ registrationInfo.setRegistrationPropertyValue(property.name, property.value).setLang(property.lang);
+ }
+
+ public void addChild(SortedMap<String, WSRPConsumer> consumers, WSRPConsumer consumer, UnmarshallingContext nav, String nsURI,
+ String localName)
+ {
+ ProducerInfo info = consumer.getProducerInfo();
+
+ if (DEBUG)
+ {
+ System.out.println("adding consumer " + info.getId() + " to deployment - localName: " + localName);
+ }
+
+ String message;
+ String id = consumer.getProducerId();
+ if (consumer.getProducerInfo().getEndpointConfigurationInfo().isAvailable())
+ {
+ message = "Added consumer for producer '" + id + "' from xml configuration.";
+ consumers.put(id, consumer);
+ }
+ else
+ {
+ message = "There was a problem initializing the WSRP interface for producer '"
+ + id + "'. The consumer will NOT be available.";
+ info.setActive(false);
+ }
+
+ // update the producer info once the whole information is known
+ try
+ {
+ consumerRegistry.updateProducerInfo(info);
+ }
+ catch (Exception e)
+ {
+ // if we couldn't update the info, remove it from the list of service to be activated
+ consumers.remove(id);
+ log.info("Couldn't update the ProducerInfo for Consumer '" + info.getId() + "'", e);
+ return;
+ }
+
+ log.info(message);
+ }
+}
Property changes on: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/xml/XMLWSRPConsumerFactory.java
___________________________________________________________________
Name: svn:executable
+ *
Added: components/wsrp/trunk/consumer/src/main/resources/conf/wsrp-consumers-config.xml
===================================================================
--- components/wsrp/trunk/consumer/src/main/resources/conf/wsrp-consumers-config.xml (rev 0)
+++ components/wsrp/trunk/consumer/src/main/resources/conf/wsrp-consumers-config.xml 2009-10-01 03:25:02 UTC (rev 219)
@@ -0,0 +1,85 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<deployments xmlns="urn:jboss:portal:wsrp:consumer:v2_7" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jboss:portal:wsrp:consumer:v2_7 http://www.jboss.org/portal/xsd/jboss-wsrp-consumer_2_7.xsd">
+ <deployment>
+ <wsrp-producer id="self" expiration-cache="300">
+ <!--
+ we need to use the individual endpoint configuration because the configuration via wsdl forces an
+ immediate attempt to access the web service description which is not available yet at this point of deployment
+ -->
+ <endpoint-config>
+ <service-description-url>http://localhost:8080/portal-wsrp/ServiceDescriptionService
+ </service-description-url>
+ <markup-url>http://localhost:8080/portal-wsrp/MarkupService</markup-url>
+ <registration-url>http://localhost:8080/portal-wsrp/RegistrationService</registration-url>
+ <portlet-management-url>http://localhost:8080/portal-wsrp/PortletManagementService</portlet-management-url>
+ </endpoint-config>
+ <registration-data/>
+ </wsrp-producer>
+ </deployment>
+ <!--<deployment>
+ <wsrp-producer id="NetUnity" expiration-cache="300">
+ <endpoint-wsdl-url>http://wsrp.netunitysoftware.com/WSRPTestService/WSRPTestService.asmx?Ope...</endpoint-wsdl-url>
+ <registration-data/>
+ </wsrp-producer>
+ </deployment>-->
+ <!--<deployment>
+ <wsrp-producer id="vignette" expiration-cache="300">
+ <endpoint-wsdl-url>http://wsrpdemo.vignette.com:8080/producer/wsdl</endpoint-wsdl-url>
+ <registration-data>
+ <property>
+ <name>com.vignette.wsrp.registration.username</name>
+ <lang>en</lang>
+ <value>test</value>
+ </property>
+ <property>
+ <name>com.vignette.wsrp.registration.password</name>
+ <lang>en</lang>
+ <value>test</value>
+ </property>
+ </registration-data>
+ </wsrp-producer>
+ </deployment>-->
+ <deployment>
+ <wsrp-producer id="bea" expiration-cache="300">
+ <endpoint-wsdl-url>http://wsrp.bea.com:7001/producer/producer?WSDL</endpoint-wsdl-url>
+ <registration-data>
+ <property>
+ <name>registration/consumerRole</name>
+ <lang>en</lang>
+ <value>insider</value>
+ </property>
+ </registration-data>
+ </wsrp-producer>
+ </deployment>
+ <!--<deployment>
+ <wsrp-producer id="oracle" expiration-cache="300">
+ <endpoint-wsdl-url>http://portalstandards.oracle.com/portletapp/portlets?WSDL</endpoint-wsdl-url>
+ <registration-data/>
+ </wsrp-producer>
+ </deployment>-->
+</deployments>
\ No newline at end of file
Property changes on: components/wsrp/trunk/consumer/src/main/resources/conf/wsrp-consumers-config.xml
___________________________________________________________________
Name: svn:executable
+ *
15 years, 2 months