From do-not-reply at jboss.org Thu May 19 11:08:22 2011 Content-Type: multipart/mixed; boundary="===============8686302283418422457==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: gatein-commits at lists.jboss.org Subject: [gatein-commits] gatein SVN: r6502 - sandbox/as7_support/wci/jboss/jboss7/src/main/java/org/gatein/wci/jboss. Date: Thu, 19 May 2011 11:08:22 -0400 Message-ID: <201105191508.p4JF8MW2024373@svn01.web.mwc.hst.phx2.redhat.com> --===============8686302283418422457== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mstruk Date: 2011-05-19 11:08:22 -0400 (Thu, 19 May 2011) New Revision: 6502 Removed: sandbox/as7_support/wci/jboss/jboss7/src/main/java/org/gatein/wci/jboss/= JB7WebLifecycleListener.java Log: Removed unneeded class - would be a replacement for JB7ContainerServlet but= got that one working in the end Deleted: sandbox/as7_support/wci/jboss/jboss7/src/main/java/org/gatein/wci/= jboss/JB7WebLifecycleListener.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sandbox/as7_support/wci/jboss/jboss7/src/main/java/org/gatein/wci/jboss= /JB7WebLifecycleListener.java 2011-05-19 14:59:34 UTC (rev 6501) +++ sandbox/as7_support/wci/jboss/jboss7/src/main/java/org/gatein/wci/jboss= /JB7WebLifecycleListener.java 2011-05-19 15:08:22 UTC (rev 6502) @@ -1,104 +0,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. = * - *************************************************************************= *****/ -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 Marko Strukelj - */ -public class JB7WebLifecycleListener implements LifecycleListener -{ - private static final Logger log =3D LoggerFactory.getLogger(JB7WebLifec= ycleListener.class); - - /** . */ - private Container wrapper; - - /** . */ - private JB7ServletContainerContext containerContext; - - /** . */ - private boolean started; - - private boolean crossContextLogout =3D true; - - - public void lifecycleEvent(LifecycleEvent lifecycleEvent) - { - log(lifecycleEvent); - if ("complete-config".equals(lifecycleEvent.getType()) && !started) - { - wrapper =3D (Container) lifecycleEvent.getSource(); - start(); - } - else if (Lifecycle.BEFORE_STOP_EVENT.equals(lifecycleEvent.getType()= ) && started) - { - wrapper =3D null; - stop(); - } - } - - private void start() - { - started =3D true; - Container container =3D wrapper; - while (container.getParent() !=3D null) - { - container =3D container.getParent(); - if (container instanceof Engine) - { - Engine engine =3D (Engine) container; - containerContext =3D new JB7ServletContainerContext(engine); - containerContext.setCrossContextLogout(crossContextLogout); - containerContext.start(); - break; - } - } - } - - private void stop() - { - started =3D false; - if (containerContext !=3D null) - { - containerContext.stop(); - containerContext =3D null; - } - } - - public void setCrossContextLogout(String val) - { - crossContextLogout =3D Boolean.valueOf(val); - } - - private void log(LifecycleEvent lifecycleEvent) - { - System.out.println(lifecycleEvent); - } -} --===============8686302283418422457==--