gatein SVN: r6499 - in sandbox/as7_support/wci/jboss: jboss7 and 7 other directories.
by do-not-reply@jboss.org
Author: mstruk
Date: 2011-05-19 10:56:12 -0400 (Thu, 19 May 2011)
New Revision: 6499
Added:
sandbox/as7_support/wci/jboss/jboss7/
sandbox/as7_support/wci/jboss/jboss7/pom.xml
sandbox/as7_support/wci/jboss/jboss7/src/
sandbox/as7_support/wci/jboss/jboss7/src/main/
sandbox/as7_support/wci/jboss/jboss7/src/main/java/
sandbox/as7_support/wci/jboss/jboss7/src/main/java/org/
sandbox/as7_support/wci/jboss/jboss7/src/main/java/org/gatein/
sandbox/as7_support/wci/jboss/jboss7/src/main/java/org/gatein/wci/
sandbox/as7_support/wci/jboss/jboss7/src/main/java/org/gatein/wci/jboss/
sandbox/as7_support/wci/jboss/jboss7/src/main/java/org/gatein/wci/jboss/JB7ContainerServlet.java
sandbox/as7_support/wci/jboss/jboss7/src/main/java/org/gatein/wci/jboss/JB7ServletContainerContext.java
sandbox/as7_support/wci/jboss/jboss7/src/main/java/org/gatein/wci/jboss/JB7WebAppContext.java
sandbox/as7_support/wci/jboss/jboss7/src/main/java/org/gatein/wci/jboss/JB7WebLifecycleListener.java
Log:
wci-jboss7
Added: sandbox/as7_support/wci/jboss/jboss7/pom.xml
===================================================================
--- sandbox/as7_support/wci/jboss/jboss7/pom.xml (rev 0)
+++ sandbox/as7_support/wci/jboss/jboss7/pom.xml 2011-05-19 14:56:12 UTC (rev 6499)
@@ -0,0 +1,29 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.gatein.wci</groupId>
+ <artifactId>wci-parent</artifactId>
+ <version>2.1.0-Beta03-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>wci-jboss7</artifactId>
+ <packaging>jar</packaging>
+ <name>GateIn - WCI JBoss 7 compatibility component</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.gatein.wci</groupId>
+ <artifactId>wci-wci</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.web</groupId>
+ <artifactId>jbossweb</artifactId>
+ <version>3.0.0-CR1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.spec.javax.servlet</groupId>
+ <artifactId>jboss-servlet-api_3.0_spec</artifactId>
+ <version>1.0.0.Final</version>
+ </dependency>
+ </dependencies>
+
+</project>
Added: sandbox/as7_support/wci/jboss/jboss7/src/main/java/org/gatein/wci/jboss/JB7ContainerServlet.java
===================================================================
--- sandbox/as7_support/wci/jboss/jboss7/src/main/java/org/gatein/wci/jboss/JB7ContainerServlet.java (rev 0)
+++ sandbox/as7_support/wci/jboss/jboss7/src/main/java/org/gatein/wci/jboss/JB7ContainerServlet.java 2011-05-19 14:56:12 UTC (rev 6499)
@@ -0,0 +1,151 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2011, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.gatein.wci.jboss;
+
+import org.apache.catalina.Container;
+import org.apache.catalina.ContainerServlet;
+import org.apache.catalina.Engine;
+import org.apache.catalina.Wrapper;
+import org.gatein.common.logging.Logger;
+import org.gatein.common.logging.LoggerFactory;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+
+/**
+ * @author <a href="mailto:mstrukel@redhat.com">Marko Strukelj</a>
+ */
+public class JB7ContainerServlet extends HttpServlet implements ContainerServlet
+{
+ private static final Logger log = LoggerFactory.getLogger(JB7ContainerServlet.class);
+
+ /** Servlet context init parameter name that can be used to turn off cross-context logout */
+ private static final String CROSS_CONTEXT_LOGOUT_KEY = "org.gatein.wci.cross_context_logout";
+
+ /** . */
+ private Wrapper wrapper;
+
+ /** . */
+ private JB7ServletContainerContext 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 JB7ServletContainerContext(engine);
+ containerContext.setCrossContextLogout(getCrossContextLogoutConfig());
+ containerContext.start();
+ break;
+ }
+ }
+ }
+
+ private void stop()
+ {
+ if (containerContext != null)
+ {
+ containerContext.stop();
+
+ //
+ containerContext = null;
+ }
+ }
+
+ private boolean getCrossContextLogoutConfig()
+ {
+ String val = getServletContext().getInitParameter(CROSS_CONTEXT_LOGOUT_KEY);
+ if (val == null || Boolean.valueOf(val))
+ {
+ return true;
+ }
+
+ if (!"false".equalsIgnoreCase(val))
+ {
+ log.warn("Context init param " + CROSS_CONTEXT_LOGOUT_KEY + " value is invalid: " + val + " - falling back to: false");
+ }
+
+ log.info("Cross-context session invalidation on logout disabled");
+ return false;
+ }
+}
+
Added: sandbox/as7_support/wci/jboss/jboss7/src/main/java/org/gatein/wci/jboss/JB7ServletContainerContext.java
===================================================================
--- sandbox/as7_support/wci/jboss/jboss7/src/main/java/org/gatein/wci/jboss/JB7ServletContainerContext.java (rev 0)
+++ sandbox/as7_support/wci/jboss/jboss7/src/main/java/org/gatein/wci/jboss/JB7ServletContainerContext.java 2011-05-19 14:56:12 UTC (rev 6499)
@@ -0,0 +1,388 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2011, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.gatein.wci.jboss;
+
+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.apache.catalina.core.StandardContext;
+import org.gatein.common.logging.Logger;
+import org.gatein.common.logging.LoggerFactory;
+import org.gatein.wci.RequestDispatchCallback;
+import org.gatein.wci.ServletContainerVisitor;
+import org.gatein.wci.WebApp;
+import org.gatein.wci.authentication.GenericAuthentication;
+import org.gatein.wci.authentication.TicketService;
+import org.gatein.wci.command.CommandDispatcher;
+import org.gatein.wci.impl.DefaultServletContainerFactory;
+import org.gatein.wci.security.Credentials;
+import org.gatein.wci.spi.ServletContainerContext;
+
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:mstrukel@redhat.com">Marko Strukelj</a>
+ */
+public class JB7ServletContainerContext implements ServletContainerContext, ContainerListener, LifecycleListener
+{
+ private final static Logger log = LoggerFactory.getLogger(JB7ServletContainerContext.class);
+
+ /** . */
+ //TODO: maybe we should rename this to /jbossgateinservlet? but older versions of jboss
+ // use the tomcat ServletContainerContext.
+ 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;
+
+ /** Perform cross-context session invalidation on logout, or not */
+ private boolean crossContextLogout = true;
+
+ /** Used to perform 2-pass init in case any container events occur during first pass init */
+ private int initCount = 1;
+
+
+ public JB7ServletContainerContext(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 void setCrossContextLogout(boolean val)
+ {
+ crossContextLogout = val;
+ }
+
+ public void login(HttpServletRequest request, HttpServletResponse response, Credentials credentials, long validityMillis) throws ServletException, IOException
+ {
+ login(request, response, credentials, validityMillis, null);
+ }
+
+ public void login(HttpServletRequest request, HttpServletResponse response, Credentials credentials, long validityMillis, String initialURI) throws ServletException, IOException
+ {
+ if (initialURI == null)
+ {
+ initialURI = request.getRequestURI();
+ }
+ try
+ {
+ request.login(credentials.getUsername(), credentials.getPassword());
+ response.sendRedirect(response.encodeRedirectURL(initialURI));
+ }
+ catch (ServletException se)
+ {
+ se.printStackTrace();
+ try
+ {
+ String ticket = GenericAuthentication.TICKET_SERVICE.createTicket(new Credentials(credentials.getUsername(), credentials.getUsername()),
+ TicketService.DEFAULT_VALIDITY);
+ String url = "j_security_check?j_username=" + credentials.getUsername() + "&j_password=" + ticket + "&initialURI=" + initialURI;
+ url = response.encodeRedirectURL(url);
+ response.sendRedirect(url);
+ response.flushBuffer();
+ }
+ catch (Exception ignore)
+ {
+ }
+ }
+ }
+
+
+ public void logout(HttpServletRequest request, HttpServletResponse response) throws ServletException
+ {
+ HttpSession sess = request.getSession(false);
+ request.logout();
+
+ if (sess == null)
+ return;
+
+ if (!crossContextLogout)
+ return;
+
+ final String sessId = sess.getId();
+ DefaultServletContainerFactory.getInstance().getServletContainer().visit(new ServletContainerVisitor()
+ {
+ public void accept(WebApp webApp)
+ {
+ webApp.invalidateSession(sessId);
+ }
+ });
+ }
+
+ public String getContainerInfo()
+ {
+ return "JBossAS/7.x";
+ }
+
+ public synchronized void containerEvent(ContainerEvent event)
+ {
+ if (initCount > 0)
+ {
+ initCount++;
+ return;
+ }
+
+ processContainerEvent(event);
+ }
+
+ private void processContainerEvent(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);
+ engine.addContainerListener(this);
+
+ boolean again = false;
+ do
+ {
+ Container[] childrenContainers = engine.findChildren();
+ for (Container childContainer : childrenContainers)
+ {
+ if (childContainer instanceof Host)
+ {
+ Host host = (Host) childContainer;
+ registerHost(host);
+ }
+ }
+
+ synchronized(this)
+ {
+ again = initCount > 1;
+ initCount = again ? 1 : 0;
+ }
+ } while (again);
+ }
+
+ 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()))
+ {
+ host.addContainerListener(this);
+ monitoredHosts.add(host.getName());
+ }
+
+ Container[] childrenContainers = host.findChildren();
+ for (Container childContainer : childrenContainers)
+ {
+ if (childContainer instanceof StandardContext)
+ {
+ StandardContext context = (StandardContext) childContainer;
+ registerContext(context);
+ }
+ }
+ }
+
+ 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());
+
+ // we need to preemptively synchronize on context to prevent deadlocks from
+ // opposite order locking on jboss-as7
+ synchronized(context)
+ {
+ JB7WebAppContext webAppContext = new JB7WebAppContext(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();
+ }
+ }
+}
+
Added: sandbox/as7_support/wci/jboss/jboss7/src/main/java/org/gatein/wci/jboss/JB7WebAppContext.java
===================================================================
--- sandbox/as7_support/wci/jboss/jboss7/src/main/java/org/gatein/wci/jboss/JB7WebAppContext.java (rev 0)
+++ sandbox/as7_support/wci/jboss/jboss7/src/main/java/org/gatein/wci/jboss/JB7WebAppContext.java 2011-05-19 14:56:12 UTC (rev 6499)
@@ -0,0 +1,153 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2011, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.gatein.wci.jboss;
+
+import org.apache.catalina.Context;
+import org.apache.catalina.Manager;
+import org.apache.catalina.Session;
+import org.apache.catalina.Wrapper;
+import org.gatein.wci.command.CommandServlet;
+import org.gatein.wci.spi.WebAppContext;
+import org.w3c.dom.Document;
+
+import javax.servlet.ServletContext;
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * @author <a href="mailto:mstrukel@redhat.com">Marko Strukelj</a>
+ */
+public class JB7WebAppContext implements WebAppContext
+{
+ /** . */
+ private Document descriptor;
+
+ /** . */
+ private ServletContext servletContext;
+
+ /** . */
+ private ClassLoader loader;
+
+ /** . */
+ private String contextPath;
+
+ /** . */
+ private final Context context;
+
+ /** . */
+ private Wrapper commandServlet;
+
+ JB7WebAppContext(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()
+ {
+ // This code can cause deadlocks on .war undeploy when container performs multiple such operations concurrently
+ // as for example when JBoss AS7 is shutting down.
+
+ 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;
+ }
+
+ public boolean invalidateSession(String sessId)
+ {
+ Manager mgr = context.getManager();
+ if (mgr != null)
+ {
+ try
+ {
+ Session sess = mgr.findSession(sessId);
+ if (sess != null)
+ {
+ sess.expire();
+ return true;
+ }
+ }
+ catch (IOException ignored)
+ {
+ }
+ }
+ return false;
+ }
+}
+
Added: sandbox/as7_support/wci/jboss/jboss7/src/main/java/org/gatein/wci/jboss/JB7WebLifecycleListener.java
===================================================================
--- sandbox/as7_support/wci/jboss/jboss7/src/main/java/org/gatein/wci/jboss/JB7WebLifecycleListener.java (rev 0)
+++ sandbox/as7_support/wci/jboss/jboss7/src/main/java/org/gatein/wci/jboss/JB7WebLifecycleListener.java 2011-05-19 14:56:12 UTC (rev 6499)
@@ -0,0 +1,104 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2011, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.gatein.wci.jboss;
+
+import org.apache.catalina.Container;
+import org.apache.catalina.Engine;
+import org.apache.catalina.Lifecycle;
+import org.apache.catalina.LifecycleEvent;
+import org.apache.catalina.LifecycleListener;
+import org.gatein.common.logging.Logger;
+import org.gatein.common.logging.LoggerFactory;
+
+/**
+ * @author <a href="mailto:mstrukel@redhat.com">Marko Strukelj</a>
+ */
+public class JB7WebLifecycleListener implements LifecycleListener
+{
+ private static final Logger log = LoggerFactory.getLogger(JB7WebLifecycleListener.class);
+
+ /** . */
+ private Container wrapper;
+
+ /** . */
+ private JB7ServletContainerContext containerContext;
+
+ /** . */
+ private boolean started;
+
+ private boolean crossContextLogout = true;
+
+
+ public void lifecycleEvent(LifecycleEvent lifecycleEvent)
+ {
+ log(lifecycleEvent);
+ if ("complete-config".equals(lifecycleEvent.getType()) && !started)
+ {
+ wrapper = (Container) lifecycleEvent.getSource();
+ start();
+ }
+ else if (Lifecycle.BEFORE_STOP_EVENT.equals(lifecycleEvent.getType()) && started)
+ {
+ wrapper = null;
+ stop();
+ }
+ }
+
+ private void start()
+ {
+ started = true;
+ Container container = wrapper;
+ while (container.getParent() != null)
+ {
+ container = container.getParent();
+ if (container instanceof Engine)
+ {
+ Engine engine = (Engine) container;
+ containerContext = new JB7ServletContainerContext(engine);
+ containerContext.setCrossContextLogout(crossContextLogout);
+ containerContext.start();
+ break;
+ }
+ }
+ }
+
+ private void stop()
+ {
+ started = false;
+ if (containerContext != null)
+ {
+ containerContext.stop();
+ containerContext = null;
+ }
+ }
+
+ public void setCrossContextLogout(String val)
+ {
+ crossContextLogout = Boolean.valueOf(val);
+ }
+
+ private void log(LifecycleEvent lifecycleEvent)
+ {
+ System.out.println(lifecycleEvent);
+ }
+}
13 years, 7 months
gatein SVN: r6498 - sandbox/as7_support/pc/mc.
by do-not-reply@jboss.org
Author: mstruk
Date: 2011-05-19 10:55:08 -0400 (Thu, 19 May 2011)
New Revision: 6498
Modified:
sandbox/as7_support/pc/mc/pom.xml
Log:
Remove jboss unit from pc-mc as it stalls the build - we don't need it in sandbox
Modified: sandbox/as7_support/pc/mc/pom.xml
===================================================================
--- sandbox/as7_support/pc/mc/pom.xml 2011-05-19 14:53:05 UTC (rev 6497)
+++ sandbox/as7_support/pc/mc/pom.xml 2011-05-19 14:55:08 UTC (rev 6498)
@@ -34,7 +34,7 @@
<build>
<plugins>
- <plugin>
+ <!--plugin>
<groupId>org.jboss.unit</groupId>
<artifactId>jboss-unit-tooling-maven2</artifactId>
<executions>
@@ -57,7 +57,7 @@
<html>target/tests/reports/html/local</html>
</reports>
</configuration>
- </plugin>
+ </plugin-->
</plugins>
</build>
13 years, 7 months
gatein SVN: r6497 - sandbox/as7_support/pc.
by do-not-reply@jboss.org
Author: mstruk
Date: 2011-05-19 10:53:05 -0400 (Thu, 19 May 2011)
New Revision: 6497
Modified:
sandbox/as7_support/pc/pom.xml
Log:
Add jboss-as7-extension module to parent pom
Modified: sandbox/as7_support/pc/pom.xml
===================================================================
--- sandbox/as7_support/pc/pom.xml 2011-05-19 14:52:08 UTC (rev 6496)
+++ sandbox/as7_support/pc/pom.xml 2011-05-19 14:53:05 UTC (rev 6497)
@@ -47,7 +47,7 @@
<properties>
<version.gatein.common>2.0.4-Beta02</version.gatein.common>
- <version.gatein.wci>2.1.0-Beta01</version.gatein.wci>
+ <version.gatein.wci>2.1.0-Beta03-SNAPSHOT</version.gatein.wci>
<version.apache.portals.bridges>1.0.4</version.apache.portals.bridges>
<version.apache.taglibs>1.1.2</version.apache.taglibs>
<version.apache.log4j>1.2.14</version.apache.log4j>
@@ -157,6 +157,11 @@
</dependency>
<dependency>
<groupId>org.gatein.wci</groupId>
+ <artifactId>wci-jboss7</artifactId>
+ <version>${version.gatein.wci}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.wci</groupId>
<artifactId>wci-jetty</artifactId>
<version>${version.gatein.wci}</version>
</dependency>
13 years, 7 months
gatein SVN: r6496 - in sandbox/as7_support/pc/portal: src/assemble and 6 other directories.
by do-not-reply@jboss.org
Author: mstruk
Date: 2011-05-19 10:52:08 -0400 (Thu, 19 May 2011)
New Revision: 6496
Added:
sandbox/as7_support/pc/portal/src/assemble/simple-portal-ear-jboss7.xml
sandbox/as7_support/pc/portal/src/assemble/simple-portal-jboss7-ear.xml
sandbox/as7_support/pc/portal/src/assemble/simple-portal-jboss7.xml
sandbox/as7_support/pc/portal/src/assemble/simple-portal-war-jboss7.xml
sandbox/as7_support/pc/portal/src/main/java/org/gatein/pc/portal/SimplePortalInitializer.java
sandbox/as7_support/pc/portal/src/main/resources/jboss7/
sandbox/as7_support/pc/portal/src/main/resources/jboss7/META-INF/
sandbox/as7_support/pc/portal/src/main/resources/jboss7/META-INF/MANIFEST.MF
sandbox/as7_support/pc/portal/src/main/resources/jboss7/META-INF/application.xml
sandbox/as7_support/pc/portal/src/main/resources/jboss7/simple-portal.war/
sandbox/as7_support/pc/portal/src/main/resources/jboss7/simple-portal.war/WEB-INF/
sandbox/as7_support/pc/portal/src/main/resources/jboss7/simple-portal.war/WEB-INF/jboss-web.xml
sandbox/as7_support/pc/portal/src/main/resources/jboss7/simple-portal.war/WEB-INF/web.xml
Modified:
sandbox/as7_support/pc/portal/pom.xml
Log:
JBoss AS7 .ear and .war packaging for simple-portal
Modified: sandbox/as7_support/pc/portal/pom.xml
===================================================================
--- sandbox/as7_support/pc/portal/pom.xml 2011-05-19 14:50:17 UTC (rev 6495)
+++ sandbox/as7_support/pc/portal/pom.xml 2011-05-19 14:52:08 UTC (rev 6496)
@@ -124,6 +124,66 @@
<artifactId>slf4j-log4j12</artifactId>
<version>1.5.6</version>
</dependency>
+
+ <dependency>
+ <groupId>org.gatein.wci</groupId>
+ <artifactId>wci-jboss7</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.gatein.pc</groupId>
+ <artifactId>pc-samples</artifactId>
+ <version>${project.version}</version>
+ <type>war</type>
+ <classifier>basic-portlet</classifier>
+ </dependency>
+
+ <dependency>
+ <groupId>org.gatein.pc</groupId>
+ <artifactId>pc-samples</artifactId>
+ <version>${project.version}</version>
+ <type>war</type>
+ <classifier>eventdebug-portlet</classifier>
+ </dependency>
+
+ <dependency>
+ <groupId>org.gatein.pc</groupId>
+ <artifactId>pc-samples</artifactId>
+ <version>${project.version}</version>
+ <type>war</type>
+ <classifier>google-portlet</classifier>
+ </dependency>
+
+ <dependency>
+ <groupId>org.gatein.pc</groupId>
+ <artifactId>pc-samples</artifactId>
+ <version>${project.version}</version>
+ <type>war</type>
+ <classifier>jsp-portlet</classifier>
+ </dependency>
+
+ <dependency>
+ <groupId>org.gatein.pc</groupId>
+ <artifactId>pc-samples</artifactId>
+ <version>${project.version}</version>
+ <type>war</type>
+ <classifier>remotecontroller-portlet</classifier>
+ </dependency>
+
+ <dependency>
+ <groupId>org.gatein.pc</groupId>
+ <artifactId>pc-samples</artifactId>
+ <version>${project.version}</version>
+ <type>war</type>
+ <classifier>shoppingcart-portlet</classifier>
+ </dependency>
+
+ <dependency>
+ <groupId>org.gatein.pc</groupId>
+ <artifactId>pc-samples</artifactId>
+ <version>${project.version}</version>
+ <classifier>shoppingcart-event</classifier>
+ </dependency>
</dependencies>
<build>
@@ -138,6 +198,8 @@
<descriptor>src/assemble/simple-portal-tomcat60.xml</descriptor>
<descriptor>src/assemble/simple-portal-tomcat70.xml</descriptor>
<descriptor>src/assemble/simple-portal-jboss51.xml</descriptor>
+ <descriptor>src/assemble/simple-portal-jboss7.xml</descriptor>
+ <descriptor>src/assemble/simple-portal-jboss7-ear.xml</descriptor>
</descriptors>
</configuration>
<executions>
Added: sandbox/as7_support/pc/portal/src/assemble/simple-portal-ear-jboss7.xml
===================================================================
--- sandbox/as7_support/pc/portal/src/assemble/simple-portal-ear-jboss7.xml (rev 0)
+++ sandbox/as7_support/pc/portal/src/assemble/simple-portal-ear-jboss7.xml 2011-05-19 14:52:08 UTC (rev 6496)
@@ -0,0 +1,28 @@
+<component>
+
+ <fileSets>
+
+ <fileSet>
+ <directory>src/main/resources/jboss7</directory>
+ <outputDirectory></outputDirectory>
+ </fileSet>
+
+ <fileSet>
+ <directory>src/main/resources/simple-portal-war</directory>
+ <outputDirectory>simple-portal.war</outputDirectory>
+ <useStrictFiltering>true</useStrictFiltering>
+ <excludes>
+ <exclude>**/jboss-web.xml</exclude>
+ <exclude>**/context.xml</exclude>
+ <exclude>**/jboss-portal-beans.xml</exclude>
+ </excludes>
+ </fileSet>
+
+ <fileSet>
+ <directory>target/classes</directory>
+ <outputDirectory>simple-portal.war/WEB-INF/classes</outputDirectory>
+ </fileSet>
+
+ </fileSets>
+
+</component>
Added: sandbox/as7_support/pc/portal/src/assemble/simple-portal-jboss7-ear.xml
===================================================================
--- sandbox/as7_support/pc/portal/src/assemble/simple-portal-jboss7-ear.xml (rev 0)
+++ sandbox/as7_support/pc/portal/src/assemble/simple-portal-jboss7-ear.xml 2011-05-19 14:52:08 UTC (rev 6496)
@@ -0,0 +1,59 @@
+<assembly>
+ <id>jboss7-ear</id>
+ <formats>
+ <format>dir</format>
+ </formats>
+ <baseDirectory>simple-portal.ear</baseDirectory>
+
+ <componentDescriptors>
+ <componentDescriptor>src/assemble/simple-portal-ear-jboss7.xml</componentDescriptor>
+ </componentDescriptors>
+
+ <dependencySets>
+ <dependencySet>
+ <outputDirectory></outputDirectory>
+ <outputFileNameMapping>samples${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
+ <includes>
+ <include>org.gatein.pc:pc-samples:war:*:basic-portlet</include>
+ <include>org.gatein.pc:pc-samples:war:*:eventdebug-portlet</include>
+ <include>org.gatein.pc:pc-samples:war:*:google-portlet</include>
+ <include>org.gatein.pc:pc-samples:war:*:jsp-portlet</include>
+ <include>org.gatein.pc:pc-samples:war:*:remotecontroller-portlet</include>
+ <include>org.gatein.pc:pc-samples:war:*:shoppingcart-portlet</include>
+ <include>org.gatein.pc:pc-samples:jar:*:shoppingcart-event</include>
+ </includes>
+ </dependencySet>
+
+ <!--dependencySet>
+ <outputDirectory>lib</outputDirectory>
+ <includes>
+ <include>org.gatein.common:common-common</include>
+ <include>org.gatein.common:common-logging</include>
+ <include>javax.portlet:portlet-api</include>
+ <include>org.gatein.wci:wci-wci</include>
+ <include>org.gatein.wci:wci-jboss6</include>
+
+ <include>org.gatein.pc:pc-portlet</include>
+ <include>org.gatein.pc:pc-api</include>
+ <include>javax.ccpp:ccpp</include>
+ </includes>
+ </dependencySet-->
+ <dependencySet>
+ <outputDirectory>simple-portal.war/WEB-INF/lib</outputDirectory>
+ <includes>
+
+ <include>org.gatein.common:common-mc</include>
+ <include>org.gatein.pc:pc-controller</include>
+ <include>org.gatein.pc:pc-mc</include>
+
+ <include>org.jboss:jboss-common-core</include>
+ <include>org.jboss.microcontainer:jboss-dependency</include>
+ <include>org.jboss:jboss-reflect</include>
+ <include>org.jboss:jboss-mdr</include>
+ <include>org.jboss:jbossxb</include>
+
+ </includes>
+ </dependencySet>
+ </dependencySets>
+
+</assembly>
Added: sandbox/as7_support/pc/portal/src/assemble/simple-portal-jboss7.xml
===================================================================
--- sandbox/as7_support/pc/portal/src/assemble/simple-portal-jboss7.xml (rev 0)
+++ sandbox/as7_support/pc/portal/src/assemble/simple-portal-jboss7.xml 2011-05-19 14:52:08 UTC (rev 6496)
@@ -0,0 +1,70 @@
+<assembly>
+ <id>jboss7</id>
+ <formats>
+ <format>dir</format>
+ </formats>
+ <baseDirectory></baseDirectory>
+
+ <componentDescriptors>
+ <componentDescriptor>src/assemble/simple-portal-war-jboss7.xml</componentDescriptor>
+ <componentDescriptor>src/assemble/simple-portal-war.xml</componentDescriptor>
+ </componentDescriptors>
+
+ <dependencySets>
+ <dependencySet>
+ <outputDirectory>simple-portal.war/WEB-INF/lib</outputDirectory>
+ <includes>
+
+ <include>org.gatein.common:common-mc</include>
+ <include>org.gatein.pc:pc-controller</include>
+ <include>org.gatein.pc:pc-mc</include>
+
+ <include>org.jboss:jboss-common-core</include>
+ <include>org.jboss.microcontainer:jboss-dependency</include>
+ <include>org.jboss:jboss-reflect</include>
+ <include>org.jboss:jboss-mdr</include>
+ <include>org.jboss:jbossxb</include>
+
+ </includes>
+ </dependencySet>
+
+
+ <!-- modules -->
+ <!--dependencySet>
+ <outputDirectory>modules/javax/ccpp/main</outputDirectory>
+ <includes>
+ <include>javax.ccpp:ccpp</include>
+ </includes>
+ </dependencySet>
+ <dependencySet>
+ <outputDirectory>modules/javax/portlet/main</outputDirectory>
+ <includes>
+ <include>javax.portlet:portlet-api</include>
+ </includes>
+ </dependencySet>
+ <dependencySet>
+ <outputDirectory>modules/org/gatein/main</outputDirectory>
+ <includes>
+ <include>org.gatein:gatein-jboss-as7</include>
+ </includes>
+ </dependencySet>
+ <dependencySet>
+ <outputDirectory>modules/org/gatein/wci/main</outputDirectory>
+ <includes>
+ <include>org.gatein.wci:wci-wci</include>
+ <include>org.gatein.wci:wci-jboss6</include>
+ <include>org.gatein.common:common-common</include>
+ <include>org.gatein.common:common-logging</include>
+ </includes>
+ </dependencySet>
+ <dependencySet>
+ <outputDirectory>modules/org/gatein/pc/main</outputDirectory>
+ <includes>
+ <include>org.gatein.pc:pc-api</include>
+ <include>org.gatein.pc:pc-portlet</include>
+ </includes>
+ </dependencySet-->
+
+ </dependencySets>
+
+</assembly>
Added: sandbox/as7_support/pc/portal/src/assemble/simple-portal-war-jboss7.xml
===================================================================
--- sandbox/as7_support/pc/portal/src/assemble/simple-portal-war-jboss7.xml (rev 0)
+++ sandbox/as7_support/pc/portal/src/assemble/simple-portal-war-jboss7.xml 2011-05-19 14:52:08 UTC (rev 6496)
@@ -0,0 +1,12 @@
+<component>
+
+ <fileSets>
+
+ <fileSet>
+ <directory>src/main/resources/jboss7/simple-portal.war</directory>
+ <outputDirectory>simple-portal.war</outputDirectory>
+ </fileSet>
+
+ </fileSets>
+
+</component>
Added: sandbox/as7_support/pc/portal/src/main/java/org/gatein/pc/portal/SimplePortalInitializer.java
===================================================================
--- sandbox/as7_support/pc/portal/src/main/java/org/gatein/pc/portal/SimplePortalInitializer.java (rev 0)
+++ sandbox/as7_support/pc/portal/src/main/java/org/gatein/pc/portal/SimplePortalInitializer.java 2011-05-19 14:52:08 UTC (rev 6496)
@@ -0,0 +1,133 @@
+package org.gatein.pc.portal;
+
+import org.gatein.pc.mc.PortletApplicationDeployer;
+import org.gatein.pc.portlet.PortletInvokerInterceptor;
+import org.gatein.pc.portlet.aspects.CCPPInterceptor;
+import org.gatein.pc.portlet.aspects.ConsumerCacheInterceptor;
+import org.gatein.pc.portlet.aspects.ContextDispatcherInterceptor;
+import org.gatein.pc.portlet.aspects.EventPayloadInterceptor;
+import org.gatein.pc.portlet.aspects.PortletCustomizationInterceptor;
+import org.gatein.pc.portlet.aspects.ProducerCacheInterceptor;
+import org.gatein.pc.portlet.aspects.RequestAttributeConversationInterceptor;
+import org.gatein.pc.portlet.aspects.SecureTransportInterceptor;
+import org.gatein.pc.portlet.aspects.ValveInterceptor;
+import org.gatein.pc.portlet.container.ContainerPortletDispatcher;
+import org.gatein.pc.portlet.container.ContainerPortletInvoker;
+import org.gatein.pc.portlet.impl.state.StateConverterV0;
+import org.gatein.pc.portlet.impl.state.StateManagementPolicyService;
+import org.gatein.pc.portlet.impl.state.producer.PortletStatePersistenceManagerService;
+import org.gatein.pc.portlet.state.producer.ProducerPortletInvoker;
+import org.gatein.wci.ServletContainer;
+import org.gatein.wci.ServletContainerFactory;
+import org.gatein.wci.impl.DefaultServletContainerFactory;
+
+import javax.servlet.ServletContext;
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+/**
+ * @author <a href="mailto:mstrukel@redhat.com">Marko Strukelj</a>
+ */
+public class SimplePortalInitializer implements ServletContextListener
+{
+ private static final String APPLICATION_DEPLOYER_KEY = "jboss.portal:service=PortletApplicationDeployer";
+
+ public SimplePortalInitializer()
+ {}
+
+ public void doInit(ServletContext ctx)
+ {
+ PortletApplicationDeployer deployer = new PortletApplicationDeployer();
+ ctx.setAttribute(APPLICATION_DEPLOYER_KEY, deployer);
+
+ ServletContainerFactory containerFactory = DefaultServletContainerFactory.getInstance();
+ deployer.setServletContainerFactory(containerFactory);
+ ctx.setAttribute("jboss.portal:service=ServletContainerFactory", containerFactory);
+
+ ServletContainer container = containerFactory.getServletContainer();
+ ctx.setAttribute("jboss.portal:service=ServletContainer", container);
+
+ PortletStatePersistenceManagerService persistence = new PortletStatePersistenceManagerService();
+ ctx.setAttribute("jboss.portal:service=ProducerPersistenceManager", persistence);
+
+ StateManagementPolicyService state = new StateManagementPolicyService();
+ state.setPersistLocally(true);
+ ctx.setAttribute("jboss.portal:service=ProducerStateManagementPolicy", state);
+
+ StateConverterV0 stateConverter = new StateConverterV0();
+ ctx.setAttribute("jboss.portal:service=ProducerStateConverter", stateConverter);
+
+ PortletInvokerInterceptor portletIcpt = new PortletInvokerInterceptor();
+ ctx.setAttribute("jboss.portal:service=ConsumerPortletInvoker", portletIcpt);
+
+ ConsumerCacheInterceptor cacheIcpt = new ConsumerCacheInterceptor();
+ portletIcpt.setNext(cacheIcpt);
+ ctx.setAttribute("jboss.portal:service=ConsumerCacheInterceptor", cacheIcpt);
+
+ PortletCustomizationInterceptor customizeIcpt = new PortletCustomizationInterceptor();
+ cacheIcpt.setNext(customizeIcpt);
+ ctx.setAttribute("jboss.portal:service=PortletCustomizationInterceptor", customizeIcpt);
+
+ ProducerPortletInvoker ppi = new ProducerPortletInvoker();
+ ppi.setPersistenceManager(persistence);
+ ppi.setStateManagementPolicy(state);
+ ppi.setStateConverter(stateConverter);
+ customizeIcpt.setNext(ppi);
+ ctx.setAttribute("jboss.portal:service=ProducerPortletInvoker", ppi);
+
+ ContainerPortletInvoker cpi = new ContainerPortletInvoker();
+ ppi.setNext(cpi);
+ deployer.setContainerPortletInvoker(cpi);
+ ctx.setAttribute("jboss.portal:service=ContainerPortletInvoker", cpi);
+
+ ValveInterceptor vi = new ValveInterceptor();
+ vi.setPortletApplicationRegistry(deployer);
+ cpi.setNext(vi);
+ ctx.setAttribute("jboss.portal:service=ValveInterceptor", vi);
+
+ SecureTransportInterceptor sti = new SecureTransportInterceptor();
+ vi.setNext(sti);
+ ctx.setAttribute("jboss.portal:service=SecureTransportInterceptor", sti);
+
+ ContextDispatcherInterceptor ci = new ContextDispatcherInterceptor();
+ ci.setServletContainerFactory(containerFactory);
+ sti.setNext(ci);
+ ctx.setAttribute("jboss.portal:service=ContextDispatcherInterceptor", ci);
+
+ ProducerCacheInterceptor pci = new ProducerCacheInterceptor();
+ ci.setNext(pci);
+ ctx.setAttribute("jboss.portal:service=ProducerCacheInterceptor", pci);
+
+ CCPPInterceptor ccppi = new CCPPInterceptor();
+ pci.setNext(ccppi);
+ ctx.setAttribute("jboss.portal:service=CCPPInterceptor", ccppi);
+
+ RequestAttributeConversationInterceptor raci = new RequestAttributeConversationInterceptor();
+ ccppi.setNext(raci);
+ ctx.setAttribute("jboss.portal:service=RequestAttributeConversationInterceptor", raci);
+
+ EventPayloadInterceptor epi = new EventPayloadInterceptor();
+ raci.setNext(epi);
+ ctx.setAttribute("jboss.portal:service=EventPayloadInterceptor", epi);
+
+ ContainerPortletDispatcher dispatcher = new ContainerPortletDispatcher();
+ epi.setNext(dispatcher);
+ ctx.setAttribute("jboss.portal:service=PortletContainerDispatcher", dispatcher);
+
+ // don't forget to start the deployer - MC automatically calls start() method, here we do it manually
+ deployer.start();
+ }
+
+ public void contextInitialized(ServletContextEvent servletContextEvent)
+ {
+ doInit(servletContextEvent.getServletContext());
+ }
+
+ public void contextDestroyed(ServletContextEvent servletContextEvent)
+ {
+ PortletApplicationDeployer deployer = (PortletApplicationDeployer)
+ servletContextEvent.getServletContext().getAttribute(APPLICATION_DEPLOYER_KEY);
+ if (deployer != null)
+ deployer.stop();
+ }
+}
Added: sandbox/as7_support/pc/portal/src/main/resources/jboss7/META-INF/MANIFEST.MF
===================================================================
--- sandbox/as7_support/pc/portal/src/main/resources/jboss7/META-INF/MANIFEST.MF (rev 0)
+++ sandbox/as7_support/pc/portal/src/main/resources/jboss7/META-INF/MANIFEST.MF 2011-05-19 14:52:08 UTC (rev 6496)
@@ -0,0 +1,2 @@
+Manifest-Version: 1.0
+Dependencies: org.jboss.as.web,org.slf4j
Added: sandbox/as7_support/pc/portal/src/main/resources/jboss7/META-INF/application.xml
===================================================================
--- sandbox/as7_support/pc/portal/src/main/resources/jboss7/META-INF/application.xml (rev 0)
+++ sandbox/as7_support/pc/portal/src/main/resources/jboss7/META-INF/application.xml 2011-05-19 14:52:08 UTC (rev 6496)
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<application xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+ http://java.sun.com/xml/ns/javaee/application_6.xsd"
+ version="6">
+ <application-name>Simple Portal</application-name>
+ <description>Simple Portal</description>
+
+ <module>
+ <web>
+ <web-uri>simple-portal.war</web-uri>
+ <context-root>/simple-portal</context-root>
+ </web>
+ </module>
+ <module>
+ <web>
+ <web-uri>samples-basic-portlet.war</web-uri>
+ <context-root>/samples-basic-portlet</context-root>
+ </web>
+ </module>
+ <module>
+ <web>
+ <web-uri>samples-jsp-portlet.war</web-uri>
+ <context-root>/samples-jsp-portlet</context-root>
+ </web>
+ </module>
+ <module>
+ <web>
+ <web-uri>samples-google-portlet.war</web-uri>
+ <context-root>/samples-google-portlet</context-root>
+ </web>
+ </module>
+ <module>
+ <web>
+ <web-uri>samples-eventdebug-portlet.war</web-uri>
+ <context-root>/samples-eventdebug-portlet</context-root>
+ </web>
+ </module>
+ <module>
+ <web>
+ <web-uri>samples-remotecontroller-portlet.war</web-uri>
+ <context-root>/samples-remotecontroller-portlet</context-root>
+ </web>
+ </module>
+ <module>
+ <web>
+ <web-uri>samples-shoppingcart-portlet.war</web-uri>
+ <context-root>/samples-shoppingcart-portlet</context-root>
+ </web>
+ </module>
+ <module>
+ <ejb>samples-shoppingcart-event.jar</ejb>
+ </module>
+</application>
\ No newline at end of file
Added: sandbox/as7_support/pc/portal/src/main/resources/jboss7/simple-portal.war/WEB-INF/jboss-web.xml
===================================================================
--- sandbox/as7_support/pc/portal/src/main/resources/jboss7/simple-portal.war/WEB-INF/jboss-web.xml (rev 0)
+++ sandbox/as7_support/pc/portal/src/main/resources/jboss7/simple-portal.war/WEB-INF/jboss-web.xml 2011-05-19 14:52:08 UTC (rev 6496)
@@ -0,0 +1,73 @@
+<?xml version="1.0"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2011, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<jboss-web xmlns="http://www.jboss.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-web_6_0.xsd"
+ version="6.0">
+<!--
+xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-web_7_0.xsd"
+ version="7.0"
+ -->
+ <!--listener>
+ <class-name>org.gatein.pc.portal.JBossWebContainerListener</class-name>
+ <listener-type>CONTAINER</listener-type>
+ <param>
+ <description>Debug level (DEBUG, INFO, WARN, ERROR)</description>
+ <param-name>debugLevel</param-name>
+ <param-value>debug</param-value>
+ </param>
+ </listener-->
+ <!--listener>
+ <class-name>org.gatein.wci.jboss.JB6WebLifecycleListener</class-name>
+ <listener-type>LIFECYCLE</listener-type>
+ <param>
+ <description>Perform cross-context logout? (true by default)</description>
+ <param-name>crossContextLogout</param-name>
+ <param-value>true</param-value>
+ </param>
+ </listener-->
+
+ <!--listener>
+ <class-name>org.gatein.pc.portal.JBossWebLifecycleListener</class-name>
+ <listener-type>LIFECYCLE</listener-type>
+ <param>
+ <description>Perform cross-context logout? (true by default)</description>
+ <param-name>crossContextLogout</param-name>
+ <param-value>true</param-value>
+ </param>
+ </listener-->
+ <!--listener>
+ <class-name>org.gatein.pc.portal.JBossWebServletInstanceListener</class-name>
+ <listener-type>SERVLET_INSTANCE</listener-type>
+ </listener>
+ <listener>
+ <class-name>org.gatein.pc.portal.JBossWebServletContainerListener</class-name>
+ <listener-type>SERVLET_CONTAINER</listener-type>
+ </listener>
+ <listener>
+ <class-name>org.gatein.pc.portal.JBossWebServletLifecycleListener</class-name>
+ <listener-type>SERVLET_LIFECYCLE</listener-type>
+ </listener-->
+</jboss-web>
\ No newline at end of file
Added: sandbox/as7_support/pc/portal/src/main/resources/jboss7/simple-portal.war/WEB-INF/web.xml
===================================================================
--- sandbox/as7_support/pc/portal/src/main/resources/jboss7/simple-portal.war/WEB-INF/web.xml (rev 0)
+++ sandbox/as7_support/pc/portal/src/main/resources/jboss7/simple-portal.war/WEB-INF/web.xml 2011-05-19 14:52:08 UTC (rev 6496)
@@ -0,0 +1,54 @@
+<?xml version="1.0"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<web-app xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ version="2.5">
+
+ <filter>
+ <filter-name>ErrorHandlingFilter</filter-name>
+ <filter-class>org.gatein.pc.portal.ErrorHandlingFilter</filter-class>
+ </filter>
+ <filter>
+ <filter-name>ControllerFilter</filter-name>
+ <filter-class>org.gatein.pc.portal.jsp.ControllerFilter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>ErrorHandlingFilter</filter-name>
+ <url-pattern>*.jsp</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>ControllerFilter</filter-name>
+ <url-pattern>*.jsp</url-pattern>
+ </filter-mapping>
+ <listener>
+ <listener-class>org.gatein.pc.portal.SimplePortalInitializer</listener-class>
+ </listener>
+ <servlet>
+ <servlet-name>ContainerServlet</servlet-name>
+ <servlet-class>org.gatein.wci.jboss.JB7ContainerServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+</web-app>
13 years, 7 months
gatein SVN: r6495 - in sandbox/as7_support/pc: jboss-as7-extension and 33 other directories.
by do-not-reply@jboss.org
Author: mstruk
Date: 2011-05-19 10:50:17 -0400 (Thu, 19 May 2011)
New Revision: 6495
Added:
sandbox/as7_support/pc/jboss-as7-extension/
sandbox/as7_support/pc/jboss-as7-extension/extension/
sandbox/as7_support/pc/jboss-as7-extension/extension/pom.xml
sandbox/as7_support/pc/jboss-as7-extension/extension/src/
sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/
sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/
sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/
sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/
sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/
sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/
sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/
sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/Attribute.java
sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/Constants.java
sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/Element.java
sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/GateInExtension.java
sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemAdd.java
sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemDescribe.java
sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemDescriptionProviders.java
sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemDescriptions.java
sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemParser.java
sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/Namespace.java
sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/SharedPortletTldsMetaDataBuilder.java
sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/
sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/PortletWarClassloadingDependencyProcessor.java
sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/PortletWarDeploymentInitializingProcessor.java
sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/PortletWarKey.java
sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/resources/
sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/resources/META-INF/
sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/resources/META-INF/services/
sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/resources/META-INF/services/org.jboss.as.controller.Extension
sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/resources/org/
sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/resources/org/gatein/
sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/resources/org/gatein/LocalDescriptions.properties
sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/resources/schema/
sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/resources/schema/jboss-gatein.xsd
sandbox/as7_support/pc/jboss-as7-extension/modules/
sandbox/as7_support/pc/jboss-as7-extension/modules/build.xml
sandbox/as7_support/pc/jboss-as7-extension/modules/lib.xml
sandbox/as7_support/pc/jboss-as7-extension/modules/pom.xml
sandbox/as7_support/pc/jboss-as7-extension/modules/src/
sandbox/as7_support/pc/jboss-as7-extension/modules/src/main/
sandbox/as7_support/pc/jboss-as7-extension/modules/src/main/java/
sandbox/as7_support/pc/jboss-as7-extension/modules/src/main/resources/
sandbox/as7_support/pc/jboss-as7-extension/modules/src/main/resources/modules/
sandbox/as7_support/pc/jboss-as7-extension/modules/src/main/resources/modules/javax/
sandbox/as7_support/pc/jboss-as7-extension/modules/src/main/resources/modules/javax/ccpp/
sandbox/as7_support/pc/jboss-as7-extension/modules/src/main/resources/modules/javax/ccpp/main/
sandbox/as7_support/pc/jboss-as7-extension/modules/src/main/resources/modules/javax/ccpp/main/module.xml
sandbox/as7_support/pc/jboss-as7-extension/modules/src/main/resources/modules/javax/portlet/
sandbox/as7_support/pc/jboss-as7-extension/modules/src/main/resources/modules/javax/portlet/main/
sandbox/as7_support/pc/jboss-as7-extension/modules/src/main/resources/modules/javax/portlet/main/module.xml
sandbox/as7_support/pc/jboss-as7-extension/modules/src/main/resources/modules/org/
sandbox/as7_support/pc/jboss-as7-extension/modules/src/main/resources/modules/org/gatein/
sandbox/as7_support/pc/jboss-as7-extension/modules/src/main/resources/modules/org/gatein/main/
sandbox/as7_support/pc/jboss-as7-extension/modules/src/main/resources/modules/org/gatein/main/module.xml
sandbox/as7_support/pc/jboss-as7-extension/modules/src/main/resources/modules/org/gatein/pc/
sandbox/as7_support/pc/jboss-as7-extension/modules/src/main/resources/modules/org/gatein/pc/main/
sandbox/as7_support/pc/jboss-as7-extension/modules/src/main/resources/modules/org/gatein/pc/main/module.xml
sandbox/as7_support/pc/jboss-as7-extension/modules/src/main/resources/modules/org/gatein/wci/
sandbox/as7_support/pc/jboss-as7-extension/modules/src/main/resources/modules/org/gatein/wci/main/
sandbox/as7_support/pc/jboss-as7-extension/modules/src/main/resources/modules/org/gatein/wci/main/module.xml
sandbox/as7_support/pc/jboss-as7-extension/pom.xml
Log:
Extension and modules that integrate wci and pc into JBoss AS7
Added: sandbox/as7_support/pc/jboss-as7-extension/extension/pom.xml
===================================================================
--- sandbox/as7_support/pc/jboss-as7-extension/extension/pom.xml (rev 0)
+++ sandbox/as7_support/pc/jboss-as7-extension/extension/pom.xml 2011-05-19 14:50:17 UTC (rev 6495)
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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/xsd/maven-4.0.0.xsd">
+
+ <parent>
+ <groupId>org.gatein.pc</groupId>
+ <artifactId>jboss-as7-extension</artifactId>
+ <version>2.3.0-Beta04-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.gatein</groupId>
+ <artifactId>gatein-jboss-as7</artifactId>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.jboss.as</groupId>
+ <artifactId>jboss-as-controller</artifactId>
+ <version>${version.jboss.as}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.as</groupId>
+ <artifactId>jboss-as-server</artifactId>
+ <version>${version.jboss.as}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.as</groupId>
+ <artifactId>jboss-as-ee</artifactId>
+ <version>${version.jboss.as}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.as</groupId>
+ <artifactId>jboss-as-web</artifactId>
+ <version>${version.jboss.as}</version>
+ </dependency>
+
+ </dependencies>
+
+</project>
\ No newline at end of file
Added: sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/Attribute.java
===================================================================
--- sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/Attribute.java (rev 0)
+++ sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/Attribute.java 2011-05-19 14:50:17 UTC (rev 6495)
@@ -0,0 +1,48 @@
+package org.gatein.integration.jboss.as7;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:mstrukel@redhat.com">Marko Strukelj</a>
+ */
+public enum Attribute {
+ UNKNOWN(null);
+
+ private final String name;
+
+ Attribute(final String name) {
+ this.name = name;
+ }
+
+ /**
+ * Get the local name of this attribute.
+ *
+ * @return the local name
+ */
+ public String getLocalName() {
+ return name;
+ }
+
+ private static final Map<String, Attribute> MAP;
+
+ static {
+ final Map<String, Attribute> map = new HashMap<String, Attribute>();
+ for (Attribute element : values()) {
+ final String name = element.getLocalName();
+ if (name != null)
+ map.put(name, element);
+ }
+ MAP = map;
+ }
+
+ public static Attribute forName(String localName) {
+ final Attribute element = MAP.get(localName);
+ return element == null ? UNKNOWN : element;
+ }
+
+ @Override
+ public String toString() {
+ return getLocalName();
+ }
+}
Added: sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/Constants.java
===================================================================
--- sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/Constants.java (rev 0)
+++ sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/Constants.java 2011-05-19 14:50:17 UTC (rev 6495)
@@ -0,0 +1,12 @@
+package org.gatein.integration.jboss.as7;
+
+import org.jboss.as.server.deployment.AttachmentKey;
+
+/**
+ * @author <a href="mailto:mstrukel@redhat.com">Marko Strukelj</a>
+ */
+interface Constants {
+
+ String CONTAINER_CONFIG = "configuration";
+ String WCI_SERVLET_CLASS = "wci-servlet-class";
+}
Added: sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/Element.java
===================================================================
--- sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/Element.java (rev 0)
+++ sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/Element.java 2011-05-19 14:50:17 UTC (rev 6495)
@@ -0,0 +1,46 @@
+package org.gatein.integration.jboss.as7;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:mstrukel@redhat.com">Marko Strukelj</a>
+ */
+public enum Element {
+ // must be first
+ UNKNOWN(null),
+ CONTAINER_CONFIG(Constants.CONTAINER_CONFIG),
+ WCI_SERVLET_CLASS(Constants.WCI_SERVLET_CLASS);
+
+ private final String name;
+
+ Element(final String name) {
+ this.name = name;
+ }
+
+ /**
+ * Get the local name of this element.
+ *
+ * @return the local name
+ */
+ public String getLocalName() {
+ return name;
+ }
+
+ private static final Map<String, Element> MAP;
+
+ static {
+ final Map<String, Element> map = new HashMap<String, Element>();
+ for (Element element : values()) {
+ final String name = element.getLocalName();
+ if (name != null)
+ map.put(name, element);
+ }
+ MAP = map;
+ }
+
+ public static Element forName(String localName) {
+ final Element element = MAP.get(localName);
+ return element == null ? UNKNOWN : element;
+ }
+}
Added: sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/GateInExtension.java
===================================================================
--- sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/GateInExtension.java (rev 0)
+++ sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/GateInExtension.java 2011-05-19 14:50:17 UTC (rev 6495)
@@ -0,0 +1,39 @@
+package org.gatein.integration.jboss.as7;
+
+import org.jboss.as.controller.Extension;
+import org.jboss.as.controller.ExtensionContext;
+import org.jboss.as.controller.SubsystemRegistration;
+import org.jboss.as.controller.parsing.ExtensionParsingContext;
+import org.jboss.as.controller.registry.ModelNodeRegistration;
+import org.jboss.as.controller.registry.OperationEntry;
+import org.jboss.logging.Logger;
+
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ADD;
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.DESCRIBE;
+
+/**
+ * @author <a href="mailto:mstrukel@redhat.com">Marko Strukelj</a>
+ */
+public class GateInExtension implements Extension {
+
+ private static final Logger log = Logger.getLogger("org.gatein");
+
+ public static final String SUBSYSTEM_NAME = "gatein";
+
+ /** {@inheritDoc} */
+ @Override
+ public void initialize(ExtensionContext context) {
+ log.debugf("Activating GateIn Extension");
+ final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME);
+ final ModelNodeRegistration registration = subsystem.registerSubsystemModel(GateInSubsystemDescriptionProviders.SUBSYSTEM);
+ registration.registerOperationHandler(ADD, GateInSubsystemAdd.INSTANCE, GateInSubsystemAdd.INSTANCE, false);
+ registration.registerOperationHandler(DESCRIBE, GateInSubsystemDescribe.INSTANCE, GateInSubsystemDescribe.INSTANCE, false, OperationEntry.EntryType.PRIVATE);
+ subsystem.registerXMLElementWriter(GateInSubsystemParser.getInstance());
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void initializeParsers(ExtensionParsingContext context) {
+ context.setSubsystemXmlMapping(Namespace.CURRENT.getUriString(), GateInSubsystemParser.getInstance());
+ }
+}
Added: sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemAdd.java
===================================================================
--- sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemAdd.java (rev 0)
+++ sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemAdd.java 2011-05-19 14:50:17 UTC (rev 6495)
@@ -0,0 +1,70 @@
+package org.gatein.integration.jboss.as7;
+
+import org.gatein.integration.jboss.as7.deployment.PortletWarClassloadingDependencyProcessor;
+import org.gatein.integration.jboss.as7.deployment.PortletWarDeploymentInitializingProcessor;
+import org.jboss.as.controller.BasicOperationResult;
+import org.jboss.as.controller.ModelAddOperationHandler;
+import org.jboss.as.controller.OperationContext;
+import org.jboss.as.controller.OperationFailedException;
+import org.jboss.as.controller.OperationResult;
+import org.jboss.as.controller.ResultHandler;
+import org.jboss.as.controller.RuntimeTask;
+import org.jboss.as.controller.RuntimeTaskContext;
+import org.jboss.as.controller.descriptions.DescriptionProvider;
+import org.jboss.as.server.BootOperationContext;
+import org.jboss.as.server.BootOperationHandler;
+import org.jboss.as.server.deployment.Phase;
+import org.jboss.dmr.ModelNode;
+
+import java.util.Locale;
+
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP;
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP_ADDR;
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.REMOVE;
+
+/**
+ * @author <a href="mailto:mstrukel@redhat.com">Marko Strukelj</a>
+ */
+public class GateInSubsystemAdd implements ModelAddOperationHandler, BootOperationHandler, DescriptionProvider {
+ static final GateInSubsystemAdd INSTANCE = new GateInSubsystemAdd();
+
+ static final int STRUCTURE_PORTLET_WAR_DEPLOYMENT_INIT = 0x0B80;
+ static final int DEPENDENCIES_PORTLET_MODULE = 0x1100;
+
+ private GateInSubsystemAdd() {
+
+ }
+
+ public ModelNode getModelDescription(Locale locale) {
+ return GateInSubsystemDescriptions.getSubsystemDescription(locale);
+ }
+
+ public OperationResult execute(final OperationContext updateContext, final ModelNode operation, final ResultHandler resultHandler) throws OperationFailedException {
+ final ModelNode config = operation.get(Constants.CONTAINER_CONFIG);
+
+ final ModelNode subModel = updateContext.getSubModel();
+ subModel.get(Constants.CONTAINER_CONFIG).set(config);
+
+ if (updateContext instanceof BootOperationContext) {
+ final BootOperationContext ctx = (BootOperationContext) updateContext;
+ updateContext.getRuntimeContext().setRuntimeTask(new RuntimeTask() {
+ public void execute(RuntimeTaskContext context) throws OperationFailedException {
+
+ SharedPortletTldsMetaDataBuilder tldsBuilder = new SharedPortletTldsMetaDataBuilder();
+
+ ctx.addDeploymentProcessor(Phase.PARSE, STRUCTURE_PORTLET_WAR_DEPLOYMENT_INIT, new PortletWarDeploymentInitializingProcessor());
+ ctx.addDeploymentProcessor(Phase.DEPENDENCIES, DEPENDENCIES_PORTLET_MODULE,
+ new PortletWarClassloadingDependencyProcessor(tldsBuilder.create()));
+ resultHandler.handleResultComplete();
+ }
+ });
+ } else {
+ resultHandler.handleResultComplete();
+ }
+
+ final ModelNode compensatingOperation = new ModelNode();
+ compensatingOperation.get(OP).set(REMOVE);
+ compensatingOperation.get(OP_ADDR).set(operation.require(OP_ADDR));
+ return new BasicOperationResult(compensatingOperation);
+ }
+}
Added: sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemDescribe.java
===================================================================
--- sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemDescribe.java (rev 0)
+++ sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemDescribe.java 2011-05-19 14:50:17 UTC (rev 6495)
@@ -0,0 +1,50 @@
+package org.gatein.integration.jboss.as7;
+
+import org.jboss.as.controller.BasicOperationResult;
+import org.jboss.as.controller.ModelQueryOperationHandler;
+import org.jboss.as.controller.OperationContext;
+import org.jboss.as.controller.OperationResult;
+import org.jboss.as.controller.PathAddress;
+import org.jboss.as.controller.ResultHandler;
+import org.jboss.as.controller.descriptions.DescriptionProvider;
+import org.jboss.as.controller.operations.common.Util;
+import org.jboss.dmr.ModelNode;
+
+import java.util.Locale;
+
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ADD;
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP;
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP_ADDR;
+
+/**
+ * @author <a href="mailto:mstrukel@redhat.com">Marko Strukelj</a>
+ */
+public class GateInSubsystemDescribe implements ModelQueryOperationHandler, DescriptionProvider {
+
+ static final GateInSubsystemDescribe INSTANCE = new GateInSubsystemDescribe();
+
+ /** {@inheritDoc} */
+ @Override
+ public OperationResult execute(final OperationContext context, final ModelNode operation, final ResultHandler resultHandler) {
+ final ModelNode result = new ModelNode();
+ final PathAddress rootAddress = PathAddress.pathAddress(PathAddress.pathAddress(operation.require(OP_ADDR)).getLastElement());
+ final ModelNode subModel = context.getSubModel();
+
+ final ModelNode subsystemAdd = new ModelNode();
+ subsystemAdd.get(OP).set(ADD);
+ subsystemAdd.get(OP_ADDR).set(rootAddress.toModelNode());
+ if(subModel.hasDefined(Constants.CONTAINER_CONFIG)) {
+ subsystemAdd.get(Constants.CONTAINER_CONFIG).set(subModel.get(Constants.CONTAINER_CONFIG));
+ }
+ result.add(subsystemAdd);
+
+ resultHandler.handleResultFragment(Util.NO_LOCATION, result);
+ resultHandler.handleResultComplete();
+ return new BasicOperationResult();
+ }
+
+ @Override
+ public ModelNode getModelDescription(Locale locale) {
+ return new ModelNode();
+ }
+}
Added: sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemDescriptionProviders.java
===================================================================
--- sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemDescriptionProviders.java (rev 0)
+++ sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemDescriptionProviders.java 2011-05-19 14:50:17 UTC (rev 6495)
@@ -0,0 +1,20 @@
+package org.gatein.integration.jboss.as7;
+
+import org.jboss.as.controller.descriptions.DescriptionProvider;
+import org.jboss.dmr.ModelNode;
+
+import java.util.Locale;
+
+/**
+ * Common web description providers.
+ *
+ * @author <a href="mailto:mstrukel@redhat.com">Marko Strukelj</a>
+ */
+public class GateInSubsystemDescriptionProviders {
+ public static final DescriptionProvider SUBSYSTEM = new DescriptionProvider() {
+ @Override
+ public ModelNode getModelDescription(Locale locale) {
+ return GateInSubsystemDescriptions.getSubsystemDescription(locale);
+ }
+ };
+}
Added: sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemDescriptions.java
===================================================================
--- sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemDescriptions.java (rev 0)
+++ sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemDescriptions.java 2011-05-19 14:50:17 UTC (rev 6495)
@@ -0,0 +1,50 @@
+package org.gatein.integration.jboss.as7;
+
+import org.jboss.dmr.ModelNode;
+import org.jboss.dmr.ModelType;
+
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.*;
+
+/**
+ * @author <a href="mailto:mstrukel@redhat.com">Marko Strukelj</a>
+ */
+public class GateInSubsystemDescriptions {
+ static final String RESOURCE_NAME = GateInSubsystemDescriptions.class.getPackage().getName() + ".LocalDescriptions";
+
+ public static ModelNode getSubsystemDescription(final Locale locale) {
+ final ResourceBundle bundle = getResourceBundle(locale);
+
+ final ModelNode node = new ModelNode();
+
+ node.get(DESCRIPTION).set(bundle.getString("gatein"));
+ node.get(HEAD_COMMENT_ALLOWED).set(true);
+ node.get(TAIL_COMMENT_ALLOWED).set(true);
+ node.get(NAMESPACE).set(Namespace.GATEIN_1_0.getUriString());
+
+ node.get(ATTRIBUTES, Constants.WCI_SERVLET_CLASS, TYPE).set(ModelType.STRING);
+ node.get(ATTRIBUTES, Constants.WCI_SERVLET_CLASS, DESCRIPTION).set(bundle.getString("gatein.wci-servlet-class"));
+ node.get(ATTRIBUTES, Constants.WCI_SERVLET_CLASS, REQUIRED).set(true);
+
+ getConfigurationCommonDescription(node.get(ATTRIBUTES, Constants.CONTAINER_CONFIG), bundle);
+ return node;
+ }
+
+ static ModelNode getConfigurationCommonDescription(final ModelNode node, final ResourceBundle bundle) {
+
+ node.get(TYPE).set(ModelType.OBJECT);
+ node.get(DESCRIPTION).set(bundle.getString("gatein.configuration"));
+ node.get(REQUIRED).set(false);
+
+ return node;
+ }
+
+ private static ResourceBundle getResourceBundle(Locale locale) {
+ if (locale == null) {
+ locale = Locale.getDefault();
+ }
+ return ResourceBundle.getBundle(RESOURCE_NAME, locale);
+ }
+}
Added: sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemParser.java
===================================================================
--- sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemParser.java (rev 0)
+++ sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemParser.java 2011-05-19 14:50:17 UTC (rev 6495)
@@ -0,0 +1,158 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.integration.jboss.as7;
+
+import org.jboss.as.controller.persistence.SubsystemMarshallingContext;
+import org.jboss.dmr.ModelNode;
+
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import java.util.List;
+
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.*;
+import static org.jboss.as.controller.parsing.ParseUtils.*;
+
+import org.jboss.staxmapper.XMLElementReader;
+import org.jboss.staxmapper.XMLElementWriter;
+import org.jboss.staxmapper.XMLExtendedStreamReader;
+import org.jboss.staxmapper.XMLExtendedStreamWriter;
+
+import static org.gatein.integration.jboss.as7.Constants.*;
+
+/**
+ * GateIn subsystem parser.
+ *
+ * @author <a href="mailto:mstrukel@redhat.com">Marko Strukelj</a>
+ */
+public class GateInSubsystemParser implements XMLStreamConstants, XMLElementReader<List<ModelNode>>, XMLElementWriter<SubsystemMarshallingContext> {
+
+ private static final GateInSubsystemParser INSTANCE = new GateInSubsystemParser();
+
+ static GateInSubsystemParser getInstance() {
+ return INSTANCE;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void writeContent(XMLExtendedStreamWriter writer, SubsystemMarshallingContext context) throws XMLStreamException {
+ context.startSubsystemElement(Namespace.CURRENT.getUriString(), false);
+
+ ModelNode node = context.getModelNode();
+ if (node.hasDefined(CONTAINER_CONFIG)) {
+ writeContainerConfig(writer, node.get(CONTAINER_CONFIG));
+ }
+ writer.writeEndElement();
+ }
+
+ private void writeContainerConfig(XMLExtendedStreamWriter writer, ModelNode config) throws XMLStreamException {
+ writer.writeStartElement(Element.CONTAINER_CONFIG.getLocalName());
+ if (config.hasDefined(WCI_SERVLET_CLASS)) {
+ writer.writeStartElement(Element.WCI_SERVLET_CLASS.getLocalName());
+ writer.writeCharacters(config.get(WCI_SERVLET_CLASS).asString());
+ writer.writeEndElement();
+ }
+ writer.writeEndElement();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void readElement(XMLExtendedStreamReader reader, List<ModelNode> list) throws XMLStreamException {
+ // no attributes
+ if (reader.getAttributeCount() > 0) {
+ throw unexpectedAttribute(reader, 0);
+ }
+
+ final ModelNode address = new ModelNode();
+ address.add(SUBSYSTEM, GateInExtension.SUBSYSTEM_NAME);
+ address.protect();
+
+ final ModelNode subsystem = new ModelNode();
+ subsystem.get(OP).set(ADD);
+ subsystem.get(OP_ADDR).set(address);
+ final int count = reader.getAttributeCount();
+ for (int i = 0; i < count; i++) {
+ requireNoNamespaceAttribute(reader, i);
+ final String value = reader.getAttributeValue(i);
+ final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
+ switch (attribute) {
+ default:
+ unexpectedAttribute(reader, i);
+ }
+ }
+ list.add(subsystem);
+
+ // elements
+ while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
+ switch (Namespace.forUri(reader.getNamespaceURI())) {
+ case GATEIN_1_0: {
+ final Element element = Element.forName(reader.getLocalName());
+ switch (element) {
+ case CONTAINER_CONFIG: {
+ final ModelNode config = parseContainerConfig(reader);
+ subsystem.get(CONTAINER_CONFIG).set(config);
+ break;
+ }
+ default: {
+ throw unexpectedElement(reader);
+ }
+ }
+ break;
+ }
+ default: {
+ throw unexpectedElement(reader);
+ }
+ }
+ }
+ }
+
+ static ModelNode parseContainerConfig(XMLExtendedStreamReader reader) throws XMLStreamException {
+ final ModelNode config = new ModelNode();
+ // no attributes
+ if (reader.getAttributeCount() > 0) {
+ throw unexpectedAttribute(reader, 0);
+ }
+ // elements
+ while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
+ final Element element = Element.forName(reader.getLocalName());
+ switch (element) {
+ case WCI_SERVLET_CLASS: {
+ final String wciServletClass = reader.getElementText().trim();
+ config.get(WCI_SERVLET_CLASS).set(wciServletClass);
+ break;
+ }
+ default:
+ throw unexpectedElement(reader);
+ }
+ }
+ return config;
+ }
+
+ static void writeAttribute(final XMLExtendedStreamWriter writer, final String name, ModelNode node) throws XMLStreamException {
+ if (node.hasDefined(name)) {
+ writer.writeAttribute(name, node.get(name).asString());
+ }
+ }
+}
Added: sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/Namespace.java
===================================================================
--- sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/Namespace.java (rev 0)
+++ sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/Namespace.java 2011-05-19 14:50:17 UTC (rev 6495)
@@ -0,0 +1,51 @@
+package org.gatein.integration.jboss.as7;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:mstrukel@redhat.com">Marko Strukelj</a>
+ */
+public enum Namespace {
+ // must be first
+ UNKNOWN(null),
+
+ GATEIN_1_0("urn:jboss:domain:gatein:1.0");
+
+ /**
+ * The current namespace version.
+ */
+ public static final Namespace CURRENT = GATEIN_1_0;
+
+ private final String name;
+
+ Namespace(final String name) {
+ this.name = name;
+ }
+
+ /**
+ * Get the URI of this namespace.
+ *
+ * @return the URI
+ */
+ public String getUriString() {
+ return name;
+ }
+
+ private static final Map<String, Namespace> MAP;
+
+ static {
+ final Map<String, Namespace> map = new HashMap<String, Namespace>();
+ for (Namespace namespace : values()) {
+ final String name = namespace.getUriString();
+ if (name != null)
+ map.put(name, namespace);
+ }
+ MAP = map;
+ }
+
+ public static Namespace forUri(String uri) {
+ final Namespace element = MAP.get(uri);
+ return element == null ? UNKNOWN : element;
+ }
+}
Added: sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/SharedPortletTldsMetaDataBuilder.java
===================================================================
--- sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/SharedPortletTldsMetaDataBuilder.java (rev 0)
+++ sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/SharedPortletTldsMetaDataBuilder.java 2011-05-19 14:50:17 UTC (rev 6495)
@@ -0,0 +1,72 @@
+package org.gatein.integration.jboss.as7;
+
+import org.jboss.metadata.parser.jsp.TldMetaDataParser;
+import org.jboss.metadata.parser.util.NoopXmlResolver;
+import org.jboss.metadata.web.spec.TldMetaData;
+import org.jboss.modules.Module;
+import org.jboss.modules.ModuleClassLoader;
+import org.jboss.modules.ModuleIdentifier;
+import org.jboss.modules.ModuleLoadException;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:mstrukel@redhat.com">Marko Strukelj</a>
+ */
+class SharedPortletTldsMetaDataBuilder
+{
+ private static final String [] PORTLET_TLDS = {"portlet.tld", "portlet_2_0.tld"};
+
+ private final List<TldMetaData> tlds = new ArrayList<TldMetaData>();
+
+ SharedPortletTldsMetaDataBuilder()
+ {
+ init();
+ }
+
+ private void init() {
+ try {
+ ModuleClassLoader jstl = Module.getModuleFromCallerModuleLoader(ModuleIdentifier.create("org.gatein.pc")).getClassLoader();
+ for (String tld: PORTLET_TLDS) {
+ InputStream is = jstl.getResourceAsStream("META-INF/" + tld);
+ if (is != null) {
+ TldMetaData tldMetaData = parseTLD(tld, is);
+ tlds.add(tldMetaData);
+ }
+ }
+ } catch (ModuleLoadException e) {
+ // Ignore
+ } catch (Exception e) {
+ // Ignore
+ }
+ }
+
+ List<TldMetaData> create() {
+ final List<TldMetaData> metadata = new ArrayList<TldMetaData>();
+ metadata.addAll(tlds);
+ return metadata;
+ }
+
+ private TldMetaData parseTLD(String tld, InputStream is) throws Exception {
+ try {
+ final XMLInputFactory inputFactory = XMLInputFactory.newInstance();
+ inputFactory.setXMLResolver(NoopXmlResolver.create());
+ XMLStreamReader xmlReader = inputFactory.createXMLStreamReader(is);
+ return TldMetaDataParser.parse(xmlReader);
+ } finally {
+ try {
+ if (is != null) {
+ is.close();
+ }
+ } catch (IOException e) {
+ // Ignore
+ }
+ }
+ }
+
+}
Added: sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/PortletWarClassloadingDependencyProcessor.java
===================================================================
--- sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/PortletWarClassloadingDependencyProcessor.java (rev 0)
+++ sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/PortletWarClassloadingDependencyProcessor.java 2011-05-19 14:50:17 UTC (rev 6495)
@@ -0,0 +1,74 @@
+package org.gatein.integration.jboss.as7.deployment;
+
+import org.jboss.as.server.deployment.Attachments;
+import org.jboss.as.server.deployment.DeploymentPhaseContext;
+import org.jboss.as.server.deployment.DeploymentUnit;
+import org.jboss.as.server.deployment.DeploymentUnitProcessingException;
+import org.jboss.as.server.deployment.DeploymentUnitProcessor;
+import org.jboss.as.server.deployment.module.ModuleDependency;
+import org.jboss.as.server.deployment.module.ModuleSpecification;
+import org.jboss.as.web.deployment.TldsMetaData;
+import org.jboss.metadata.web.spec.TldMetaData;
+import org.jboss.modules.Module;
+import org.jboss.modules.ModuleIdentifier;
+import org.jboss.modules.ModuleLoader;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:mstrukel@redhat.com">Marko Strukelj</a>
+ */
+public class PortletWarClassloadingDependencyProcessor implements DeploymentUnitProcessor {
+
+ private static final ModuleIdentifier GATEIN_WCI = ModuleIdentifier.create("org.gatein.wci");
+ private static final ModuleIdentifier GATEIN_PC = ModuleIdentifier.create("org.gatein.pc");
+ private static final ModuleIdentifier JAVAX_PORTLET = ModuleIdentifier.create("javax.portlet");
+
+ private List<TldMetaData> tldMetas;
+
+ public PortletWarClassloadingDependencyProcessor(List<TldMetaData> tldMetaData)
+ {
+ this.tldMetas = tldMetaData;
+ }
+
+ @Override
+ public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
+ final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
+ if (deploymentUnit.getAttachment(PortletWarKey.INSTANCE) == null) {
+ return; // Skip non portlet deployments
+ }
+
+ final ModuleLoader moduleLoader = Module.getBootModuleLoader();
+ final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
+
+ // Add module dependencies
+ moduleSpecification.addDependency(new ModuleDependency(moduleLoader, GATEIN_WCI, false, false, false));
+ moduleSpecification.addDependency(new ModuleDependency(moduleLoader, GATEIN_PC, false, false, false));
+ moduleSpecification.addDependency(new ModuleDependency(moduleLoader, JAVAX_PORTLET, false, false, false));
+
+ // Provide tlds for portlet taglibs
+ provideTlds(deploymentUnit);
+ }
+
+ private void provideTlds(DeploymentUnit deploymentUnit)
+ {
+ TldsMetaData tsmd = deploymentUnit.getAttachment(TldsMetaData.ATTACHMENT_KEY);
+ if (tsmd == null)
+ throw new IllegalStateException("Attachment not present: TldsMetaData");
+
+ Map<String,TldMetaData> tlds = tsmd.getTlds();
+ if (tlds == null)
+ throw new IllegalStateException("TldsMetaData.tlds == null");
+
+ for (TldMetaData tld: tldMetas)
+ {
+ tlds.put(tld.getUri(), tld);
+ }
+ }
+
+ @Override
+ public void undeploy(DeploymentUnit context) {
+ }
+}
Added: sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/PortletWarDeploymentInitializingProcessor.java
===================================================================
--- sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/PortletWarDeploymentInitializingProcessor.java (rev 0)
+++ sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/PortletWarDeploymentInitializingProcessor.java 2011-05-19 14:50:17 UTC (rev 6495)
@@ -0,0 +1,41 @@
+package org.gatein.integration.jboss.as7.deployment;
+
+import org.jboss.as.ee.structure.DeploymentType;
+import org.jboss.as.ee.structure.DeploymentTypeMarker;
+import org.jboss.as.server.deployment.Attachments;
+import org.jboss.as.server.deployment.DeploymentPhaseContext;
+import org.jboss.as.server.deployment.DeploymentUnit;
+import org.jboss.as.server.deployment.DeploymentUnitProcessingException;
+import org.jboss.as.server.deployment.DeploymentUnitProcessor;
+import org.jboss.as.server.deployment.module.ResourceRoot;
+import org.jboss.as.web.deployment.WarMetaData;
+import org.jboss.metadata.web.spec.ServletMetaData;
+import org.jboss.metadata.web.spec.ServletsMetaData;
+import org.jboss.metadata.web.spec.WebMetaData;
+import org.jboss.vfs.VirtualFile;
+
+/**
+ * @author <a href="mailto:mstrukel@redhat.com">Marko Strukelj</a>
+ */
+public class PortletWarDeploymentInitializingProcessor implements DeploymentUnitProcessor {
+ private static final String PORTLET_XML = "WEB-INF/portlet.xml";
+
+ @Override
+ public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
+ final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
+ if (!DeploymentTypeMarker.isType(DeploymentType.WAR, deploymentUnit)) {
+ return; // Skip non web deployments
+ }
+ final ResourceRoot deploymentRoot = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT);
+ final VirtualFile portletXml = deploymentRoot.getRoot().getChild(PORTLET_XML);
+ if (portletXml.exists()) {
+ // we don't care about the contents, its existence is enough to mark it as a portlet app
+ deploymentUnit.putAttachment(PortletWarKey.INSTANCE, Boolean.TRUE);
+ }
+ }
+
+ @Override
+ public void undeploy(DeploymentUnit context) {
+
+ }
+}
Added: sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/PortletWarKey.java
===================================================================
--- sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/PortletWarKey.java (rev 0)
+++ sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/PortletWarKey.java 2011-05-19 14:50:17 UTC (rev 6495)
@@ -0,0 +1,12 @@
+package org.gatein.integration.jboss.as7.deployment;
+
+import org.jboss.as.server.deployment.AttachmentKey;
+
+/**
+ * @author <a href="mailto:mstrukel@redhat.com">Marko Strukelj</a>
+ */
+public class PortletWarKey {
+
+ public static final AttachmentKey<Boolean> INSTANCE = AttachmentKey.create(Boolean.class);
+
+}
Added: sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/resources/META-INF/services/org.jboss.as.controller.Extension
===================================================================
--- sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/resources/META-INF/services/org.jboss.as.controller.Extension (rev 0)
+++ sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/resources/META-INF/services/org.jboss.as.controller.Extension 2011-05-19 14:50:17 UTC (rev 6495)
@@ -0,0 +1,23 @@
+#
+# JBoss, Home of Professional Open Source.
+# Copyright 2011, Red Hat, Inc., and individual contributors
+# as indicated by the @author tags. See the copyright.txt file 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.
+#
+
+org.gatein.integration.jboss.as7.GateInExtension
\ No newline at end of file
Added: sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/resources/org/gatein/LocalDescriptions.properties
===================================================================
--- sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/resources/org/gatein/LocalDescriptions.properties (rev 0)
+++ sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/resources/org/gatein/LocalDescriptions.properties 2011-05-19 14:50:17 UTC (rev 6495)
@@ -0,0 +1,21 @@
+web=The configuration of the jboss.web subsystem.
+web.add=Operation adding the web subsystem.
+web.default-virtual-server=The web container's default virtual server. The default value is "localhost".
+web.native=Add the native initialization listener to the web container. The default value is "true".
+
+web.configuration=The common web container configuration.
+
+web.connector=A web connector.
+web.connector.add=Add a new web connector.
+web.connector.remove=Remove an existing web connector
+web.connector.name=A unique name for the connector.
+web.connector.protocol=The web connector protocol.
+web.connector.scheme=The web connector scheme.
+web.connector.socket-binding=The web connector socket-binding reference, this connector should be bound to.
+web.connector.enabled=Defines whether the connector should be started on startup. The default is true.
+
+web.virtual-server=A virtual host.
+web.virtual-server.add=Add a new virtual-server
+web.virtual-server.remove=Remove an existing virtual-server
+web.virtual-server.name=A unique virtual host name
+web.virtual-server.alias=The virtual server aliases
Added: sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/resources/schema/jboss-gatein.xsd
===================================================================
--- sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/resources/schema/jboss-gatein.xsd (rev 0)
+++ sandbox/as7_support/pc/jboss-as7-extension/extension/src/main/resources/schema/jboss-gatein.xsd 2011-05-19 14:50:17 UTC (rev 6495)
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ JBoss, Home of Professional Open Source.
+ ~ Copyright 2011, Red Hat, Inc., and individual contributors
+ ~ as indicated by the @author tags. See the copyright.txt file 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.
+ -->
+
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="urn:jboss:domain:gatein:1.0"
+ xmlns="urn:jboss:domain:gatein:1.0"
+ elementFormDefault="qualified"
+ attributeFormDefault="unqualified"
+ version="1.0">
+
+ <!-- The web subsystem root element -->
+ <xs:element name="subsystem" type="web-containerType" />
+
+ <!-- The web container configuration -->
+ <xs:complexType name="web-containerType">
+ <xs:annotation>
+ <xs:documentation>
+ <![CDATA[
+ The gatein subsystem, used to configure gatein support
+ ]]>
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:sequence>
+ <xs:element minOccurs="0" maxOccurs="1" name="configuration" type="webConfigType" />
+ </xs:sequence>
+ </xs:complexType>
+
+
+ <xs:complexType name="webConfigType">
+ <xs:sequence>
+ <xs:element name="wci-servlet-class" minOccurs="0" maxOccurs="1" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>
+ <![CDATA[
+ TODO: Description ...
+ ]]>
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+
+</xs:schema>
Added: sandbox/as7_support/pc/jboss-as7-extension/modules/build.xml
===================================================================
--- sandbox/as7_support/pc/jboss-as7-extension/modules/build.xml (rev 0)
+++ sandbox/as7_support/pc/jboss-as7-extension/modules/build.xml 2011-05-19 14:50:17 UTC (rev 6495)
@@ -0,0 +1,99 @@
+<!--
+ ~ JBoss, Home of Professional Open Source.
+ ~ Copyright 2010, Red Hat, Inc., and individual contributors
+ ~ as indicated by the @author tags. See the copyright.txt file 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.
+ -->
+
+<project name="module-repository" basedir="." default="modules">
+
+ <import file="lib.xml"/>
+
+ <property name="output.dir" value="target/jboss-${jboss.as.release.version}"/>
+ <target name="copy-files">
+ <copy todir="${output.dir}">
+ <fileset dir="src/main/resources">
+ <include name="bin/**"/>
+ </fileset>
+ <fileset dir="src/main/resources">
+ <include name="domain/**"/>
+ </fileset>
+ <fileset dir="src/main/resources">
+ <include name="standalone/**"/>
+ </fileset>
+ </copy>
+ <chmod perm="+x">
+ <fileset dir="${output.dir}/bin">
+ <include name="**/*.sh"/>
+ </fileset>
+ </chmod>
+ </target>
+
+ <target name="make-dirs">
+ <mkdir dir="${output.dir}/domain/content"/>
+ <mkdir dir="${output.dir}/standalone/lib/ext"/>
+ <mkdir dir="${output.dir}/domain/lib/ext"/>
+ </target>
+
+ <target name="modules">
+
+ <!--copy file="${org.jboss.modules:jboss-modules:jar}" tofile="${output.dir}/jboss-modules.jar"/-->
+
+ <!--
+ ~ Complete list of modules to assemble.
+ ~
+ ~ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ ~ +++++++ KEEP THIS LIST ALPHABETICAL BY MODULE NAME! +++++++
+ ~ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ -->
+ <module-def name="org.gatein">
+ <maven-resource group="org.gatein" artifact="gatein-jboss-as7" />
+ </module-def>
+
+ <module-def name="org.gatein.wci">
+ <maven-resource group="org.gatein.wci" artifact="wci-jboss7" />
+ <maven-resource group="org.gatein.wci" artifact="wci-wci" />
+ <maven-resource group="org.gatein.common" artifact="common-common" />
+ <maven-resource group="org.gatein.common" artifact="common-logging" />
+ </module-def>
+
+ <module-def name="org.gatein.pc">
+ <maven-resource group="org.gatein.pc" artifact="pc-api" />
+ <maven-resource group="org.gatein.pc" artifact="pc-portlet" />
+ </module-def>
+
+ <module-def name="javax.portlet">
+ <maven-resource group="javax.portlet" artifact="portlet-api" />
+ </module-def>
+
+ <module-def name="javax.ccpp">
+ <maven-resource group="javax.ccpp" artifact="ccpp" />
+ </module-def>
+
+ </target>
+
+ <target name="clean-target">
+ <delete dir="${output.dir}"/>
+ </target>
+
+ <target name="clean" depends="clean-target">
+ <delete file="maven-ant-tasks.jar"/>
+ </target>
+
+ <target name="all" depends="clean-target, modules, copy-files, make-dirs"/>
+</project>
Added: sandbox/as7_support/pc/jboss-as7-extension/modules/lib.xml
===================================================================
--- sandbox/as7_support/pc/jboss-as7-extension/modules/lib.xml (rev 0)
+++ sandbox/as7_support/pc/jboss-as7-extension/modules/lib.xml 2011-05-19 14:50:17 UTC (rev 6495)
@@ -0,0 +1,144 @@
+<!--
+ ~ JBoss, Home of Professional Open Source.
+ ~ Copyright 2010, Red Hat, Inc., and individual contributors
+ ~ as indicated by the @author tags. See the copyright.txt file 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.
+ -->
+
+<project name="module-repository-lib" xmlns:artifact="antlib:org.apache.maven.artifact.ant">
+
+ <property name="src.dir" value="src"/>
+ <property name="module.repo.src.dir" value="${src.dir}/main/resources/modules"/>
+ <property name="output.dir" value="target/jboss-${jboss.as.release.version}"/>
+ <property name="module.repo.output.dir" value="${output.dir}/modules"/>
+ <property name="module.xml" value="module.xml"/>
+
+
+ <taskdef name="jandex" classname="org.jboss.jandex.JandexAntTask" />
+
+ <macrodef name="module-def">
+ <attribute name="name"/>
+ <attribute name="slot" default="main"/>
+ <element name="resources" implicit="yes" optional="yes"/>
+
+ <sequential>
+ <echo message="Initializing module -> @{name}"/>
+ <!-- Figure out the correct module path -->
+ <define-module-dir name="@{name}" slot="@{slot}"/>
+
+ <!-- Make the module output director -->
+ <mkdir dir="${module.repo.output.dir}/${current.module.path}"/>
+
+ <!-- Copy the module.xml and other stuff to the output director -->
+ <copy todir="${module.repo.output.dir}/${current.module.path}">
+ <fileset dir="${module.repo.src.dir}/${current.module.path}">
+ <include name="**"/>
+ </fileset>
+ </copy>
+
+ <!-- Process the resource -->
+ <resources/>
+
+ <!-- Some final cleanup -->
+ <replace file="${module.repo.output.dir}/${current.module.path}/${module.xml}">
+ <replacetoken><![CDATA[
+ <!-- Insert resources here -->]]></replacetoken>
+ <replacevalue></replacevalue>
+ </replace>
+
+ </sequential>
+ </macrodef>
+
+ <scriptdef name="define-module-dir" language="javascript">
+ <attribute name="name"/>
+ <attribute name="slot"/>
+ <![CDATA[
+ name = attributes.get("name");
+ name = name.replace(".", "/");
+ project.setProperty("current.module.path", name + "/" + attributes.get("slot"));
+ ]]>
+ </scriptdef>
+
+ <macrodef name="maven-resource" >
+ <attribute name="group"/>
+ <attribute name="artifact"/>
+ <attribute name="jandex" default="false" />
+
+ <sequential>
+ <!-- Copy the jar to the module dir -->
+ <copy todir="${module.repo.output.dir}/${current.module.path}" failonerror="true">
+ <fileset file="${@{group}:@{artifact}:jar}"/>
+ <mapper type="flatten" />
+ </copy>
+
+ <basename file="${@{group}:@{artifact}:jar}" property="resourcename.@{group}.(a){artifact}"/>
+ <!-- Generate the Jandex Index -->
+ <jandex run="@{jandex}" newJar="true" >
+ <fileset dir="${module.repo.output.dir}/${current.module.path}" />
+ </jandex>
+ <!-- Update the resource entry in module.xml -->
+ <define-resource-root path="${resourcename.@{group}.(a){artifact}}" jandex="@{jandex}"/>
+ <replace file="${module.repo.output.dir}/${current.module.path}/${module.xml}">
+ <replacefilter token="<!-- Insert resources here -->" value="${current.resource.root} <!-- Insert resources here -->"/>
+ </replace>
+ </sequential>
+
+ </macrodef>
+
+ <macrodef name="maven-resource-with-classifier" >
+ <attribute name="group"/>
+ <attribute name="artifact"/>
+ <attribute name="classifier"/>
+ <attribute name="jandex" default="false" />
+
+ <sequential>
+ <!-- Copy the jar to the module dir -->
+ <copy todir="${module.repo.output.dir}/${current.module.path}" failonerror="true">
+ <fileset file="${@{group}:@{artifact}:jar:@{classifier}}"/> <!-- http://jira.codehaus.org/browse/MANTRUN-159 -->
+ <mapper type="flatten" />
+ </copy>
+
+ <basename file="${@{group}:@{artifact}:jar:@{classifier}}" property="resourcename.@{group}.@{artifact}.(a){classifier}"/>
+
+ <!-- Update the resource entry in module.xml -->
+ <define-resource-root path="${resourcename.@{group}.@{artifact}.(a){classifier}}"/>
+ <replace file="${module.repo.output.dir}/${current.module.path}/${module.xml}">
+ <replacefilter token="<!-- Insert resources here -->" value="${current.resource.root} <!-- Insert resources here -->"/>
+ </replace>
+ </sequential>
+
+ </macrodef>
+
+
+ <scriptdef name="define-resource-root" language="javascript">
+ <attribute name="path"/>
+ <attribute name="jandex"/>
+ <![CDATA[
+ path = attributes.get("path");
+ root = "<resource-root path=\"" + path + "\"/>";
+ if(path.indexOf('${') != -1) {
+ throw "Module resource root not found, make sure it is listed in build/pom.xml" + path;
+ }
+ if(attributes.get("jandex") == "true" ) {
+ root = root + "\n\t<resource-root path=\"" + path.replace(".jar","-jandex.jar") + "\"/>";
+ }
+ project.setProperty("current.resource.root", root);
+ ]]>
+ </scriptdef>
+
+</project>
Added: sandbox/as7_support/pc/jboss-as7-extension/modules/pom.xml
===================================================================
--- sandbox/as7_support/pc/jboss-as7-extension/modules/pom.xml (rev 0)
+++ sandbox/as7_support/pc/jboss-as7-extension/modules/pom.xml 2011-05-19 14:50:17 UTC (rev 6495)
@@ -0,0 +1,186 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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/xsd/maven-4.0.0.xsd">
+
+ <parent>
+ <groupId>org.gatein.pc</groupId>
+ <artifactId>jboss-as7-extension</artifactId>
+ <version>2.3.0-Beta04-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>gatein-jboss-as7-modules</artifactId>
+
+ <properties>
+ <version.org.jboss.jandex>1.0.0.Beta6</version.org.jboss.jandex>
+ </properties>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.gatein</groupId>
+ <artifactId>gatein-jboss-as7</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.wci</groupId>
+ <artifactId>wci-jboss7</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.gatein.wci</groupId>
+ <artifactId>wci-wci</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.web</groupId>
+ <artifactId>jbossweb</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.spec.javax.servlet</groupId>
+ <artifactId>jboss.servlet.api_3.0_spec</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.gatein.wci</groupId>
+ <artifactId>wci-wci</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.gatein.common</groupId>
+ <artifactId>common-common</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.gatein.common</groupId>
+ <artifactId>common-common</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.gatein.common</groupId>
+ <artifactId>common-logging</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.activation</groupId>
+ <artifactId>activation</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-vfs</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.gatein.common</groupId>
+ <artifactId>common-logging</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.gatein.pc</groupId>
+ <artifactId>pc-api</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.gatein.common</groupId>
+ <artifactId>common-common</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.gatein.pc</groupId>
+ <artifactId>pc-portlet</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.gatein.pc</groupId>
+ <artifactId>pc-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.gatein.wci</groupId>
+ <artifactId>wci-wci</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.portlet</groupId>
+ <artifactId>portlet-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.ccpp</groupId>
+ <artifactId>ccpp</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.servlet.jsp</groupId>
+ <artifactId>jsp-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>sun.jaxb</groupId>
+ <artifactId>jaxb-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.portlet</groupId>
+ <artifactId>portlet-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.ccpp</groupId>
+ <artifactId>ccpp</artifactId>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.4</version>
+ <inherited>false</inherited>
+ <executions>
+ <execution>
+ <id>build-dist</id>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <phase>package</phase>
+ <configuration>
+ <tasks>
+ <ant antfile="build.xml" inheritRefs="true">
+ <target name="all"/>
+ </ant>
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jandex</artifactId>
+ <version>${version.org.jboss.jandex}</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </build>
+
+
+</project>
\ No newline at end of file
Added: sandbox/as7_support/pc/jboss-as7-extension/modules/src/main/resources/modules/javax/ccpp/main/module.xml
===================================================================
--- sandbox/as7_support/pc/jboss-as7-extension/modules/src/main/resources/modules/javax/ccpp/main/module.xml (rev 0)
+++ sandbox/as7_support/pc/jboss-as7-extension/modules/src/main/resources/modules/javax/ccpp/main/module.xml 2011-05-19 14:50:17 UTC (rev 6495)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ ~ JBoss, Home of Professional Open Source.
+ ~ Copyright 2011, Red Hat, Inc., and individual contributors
+ ~ as indicated by the @author tags. See the copyright.txt file 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.
+ -->
+
+<module xmlns="urn:jboss:module:1.0" name="javax.ccpp">
+ <resources>
+ <!-- Insert resources here -->
+ </resources>
+
+ <dependencies>
+ </dependencies>
+</module>
Added: sandbox/as7_support/pc/jboss-as7-extension/modules/src/main/resources/modules/javax/portlet/main/module.xml
===================================================================
--- sandbox/as7_support/pc/jboss-as7-extension/modules/src/main/resources/modules/javax/portlet/main/module.xml (rev 0)
+++ sandbox/as7_support/pc/jboss-as7-extension/modules/src/main/resources/modules/javax/portlet/main/module.xml 2011-05-19 14:50:17 UTC (rev 6495)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ ~ JBoss, Home of Professional Open Source.
+ ~ Copyright 2011, Red Hat, Inc., and individual contributors
+ ~ as indicated by the @author tags. See the copyright.txt file 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.
+ -->
+
+<module xmlns="urn:jboss:module:1.0" name="javax.portlet">
+ <resources>
+ <!-- Insert resources here -->
+ </resources>
+
+ <dependencies>
+ </dependencies>
+</module>
Added: sandbox/as7_support/pc/jboss-as7-extension/modules/src/main/resources/modules/org/gatein/main/module.xml
===================================================================
--- sandbox/as7_support/pc/jboss-as7-extension/modules/src/main/resources/modules/org/gatein/main/module.xml (rev 0)
+++ sandbox/as7_support/pc/jboss-as7-extension/modules/src/main/resources/modules/org/gatein/main/module.xml 2011-05-19 14:50:17 UTC (rev 6495)
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ ~ JBoss, Home of Professional Open Source.
+ ~ Copyright 2011, Red Hat, Inc., and individual contributors
+ ~ as indicated by the @author tags. See the copyright.txt file 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.
+ -->
+
+<module xmlns="urn:jboss:module:1.0" name="org.gatein">
+ <resources>
+ <!-- Insert resources here -->
+ </resources>
+
+ <dependencies>
+ <module name="org.jboss.as.controller"/>
+ <module name="org.jboss.as.ee"/>
+ <module name="org.jboss.as.server"/>
+ <module name="org.jboss.as.web"/>
+ <module name="org.jboss.logging"/>
+ <module name="org.jboss.metadata"/>
+ <module name="org.jboss.modules"/>
+ <module name="org.jboss.staxmapper"/>
+ <module name="org.jboss.vfs"/>
+ </dependencies>
+</module>
Added: sandbox/as7_support/pc/jboss-as7-extension/modules/src/main/resources/modules/org/gatein/pc/main/module.xml
===================================================================
--- sandbox/as7_support/pc/jboss-as7-extension/modules/src/main/resources/modules/org/gatein/pc/main/module.xml (rev 0)
+++ sandbox/as7_support/pc/jboss-as7-extension/modules/src/main/resources/modules/org/gatein/pc/main/module.xml 2011-05-19 14:50:17 UTC (rev 6495)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ ~ JBoss, Home of Professional Open Source.
+ ~ Copyright 2011, Red Hat, Inc., and individual contributors
+ ~ as indicated by the @author tags. See the copyright.txt file 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.
+ -->
+
+<module xmlns="urn:jboss:module:1.0" name="org.gatein.pc">
+ <resources>
+ <!-- Insert resources here -->
+ </resources>
+
+ <dependencies>
+ <module name="javax.api" />
+ <module name="javax.xml.bind.api" />
+ <module name="org.gatein.wci" />
+ <module name="javax.servlet.api" />
+ <module name="javax.servlet.jsp.api" />
+ <module name="javax.portlet" />
+ <module name="javax.ccpp" />
+ </dependencies>
+</module>
\ No newline at end of file
Added: sandbox/as7_support/pc/jboss-as7-extension/modules/src/main/resources/modules/org/gatein/wci/main/module.xml
===================================================================
--- sandbox/as7_support/pc/jboss-as7-extension/modules/src/main/resources/modules/org/gatein/wci/main/module.xml (rev 0)
+++ sandbox/as7_support/pc/jboss-as7-extension/modules/src/main/resources/modules/org/gatein/wci/main/module.xml 2011-05-19 14:50:17 UTC (rev 6495)
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ ~ JBoss, Home of Professional Open Source.
+ ~ Copyright 2011, Red Hat, Inc., and individual contributors
+ ~ as indicated by the @author tags. See the copyright.txt file 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.
+ -->
+
+<module xmlns="urn:jboss:module:1.0" name="org.gatein.wci">
+ <resources>
+ <!-- Insert resources here -->
+ </resources>
+
+ <dependencies>
+ <module name="javax.servlet.api" />
+ <module name="org.jboss.as.web" />
+ <module name="org.slf4j" />
+ </dependencies>
+</module>
Added: sandbox/as7_support/pc/jboss-as7-extension/pom.xml
===================================================================
--- sandbox/as7_support/pc/jboss-as7-extension/pom.xml (rev 0)
+++ sandbox/as7_support/pc/jboss-as7-extension/pom.xml 2011-05-19 14:50:17 UTC (rev 6495)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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/xsd/maven-4.0.0.xsd">
+
+ <parent>
+ <groupId>org.gatein.pc</groupId>
+ <artifactId>pc-parent</artifactId>
+ <version>2.3.0-Beta04-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>jboss-as7-extension</artifactId>
+ <packaging>pom</packaging>
+
+ <properties>
+ <version.jboss.as>7.0.0.Beta3</version.jboss.as>
+ <jboss.as.release.version>7.0.0.Beta3</jboss.as.release.version>
+ <version.org.jboss.vfs>3.0.0.GA</version.org.jboss.vfs>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.gatein</groupId>
+ <artifactId>gatein-jboss-as7</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-vfs</artifactId>
+ <version>${version.org.jboss.vfs}</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <modules>
+ <module>extension</module>
+ <module>modules</module>
+ </modules>
+
+</project>
\ No newline at end of file
13 years, 7 months
gatein SVN: r6494 - sandbox/as7_support.
by do-not-reply@jboss.org
Author: mstruk
Date: 2011-05-18 17:24:44 -0400 (Wed, 18 May 2011)
New Revision: 6494
Added:
sandbox/as7_support/pc/
Log:
Branched pc trunk at r6493
13 years, 7 months
gatein SVN: r6492 - sandbox/cdi_support.
by do-not-reply@jboss.org
Author: mstruk
Date: 2011-05-18 17:19:14 -0400 (Wed, 18 May 2011)
New Revision: 6492
Added:
sandbox/cdi_support/wci/
Log:
Branched wci trunk at r6491
13 years, 7 months
gatein SVN: r6491 - sandbox.
by do-not-reply@jboss.org
Author: mstruk
Date: 2011-05-18 17:16:01 -0400 (Wed, 18 May 2011)
New Revision: 6491
Added:
sandbox/as7_support/
Log:
This branch is for developing the JBoss AS7 support
13 years, 7 months
gatein SVN: r6490 - epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2011-05-18 12:24:19 -0400 (Wed, 18 May 2011)
New Revision: 6490
Modified:
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/JCRRegistrationPersistenceManager.java
Log:
- JBEPP-955: needed to retrieve mappings from JCR before attempting to insert a new ConsumerGroup.
- Removed useless comment.
Modified: epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/JCRRegistrationPersistenceManager.java
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/JCRRegistrationPersistenceManager.java 2011-05-18 16:22:10 UTC (rev 6489)
+++ epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/JCRRegistrationPersistenceManager.java 2011-05-18 16:24:19 UTC (rev 6490)
@@ -148,7 +148,7 @@
ConsumerSPI consumer = super.internalCreateConsumer(consumerId, consumerName);
ChromatticSession session = persister.getSession();
- mappings = session.findByPath(ConsumersAndGroupsMapping.class, ConsumersAndGroupsMapping.NODE_NAME); // todo: needed?
+ mappings = session.findByPath(ConsumersAndGroupsMapping.class, ConsumersAndGroupsMapping.NODE_NAME);
try
{
ConsumerMapping cm = mappings.createConsumer(consumerId);
@@ -236,6 +236,7 @@
ConsumerGroupSPI group = super.internalCreateConsumerGroup(name);
ChromatticSession session = persister.getSession();
+ mappings = session.findByPath(ConsumersAndGroupsMapping.class, ConsumersAndGroupsMapping.NODE_NAME);
try
{
ConsumerGroupMapping cgm = mappings.createConsumerGroup(name);
13 years, 7 months