Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 72357 invoked from network); 8 Jan 2009 10:05:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Jan 2009 10:05:13 -0000 Received: (qmail 16968 invoked by uid 500); 8 Jan 2009 10:05:13 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 16840 invoked by uid 500); 8 Jan 2009 10:05:13 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 16831 invoked by uid 99); 8 Jan 2009 10:05:13 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Jan 2009 02:05:13 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Jan 2009 10:05:12 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 07FDD2388988; Thu, 8 Jan 2009 02:04:52 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r732671 - /geronimo/plugins/tuscany/trunk/geronimo-tuscany-http-tomcat/src/main/java/org/apache/geronimo/tuscany/http/tomcat/GeronimoServletHost.java Date: Thu, 08 Jan 2009 10:04:51 -0000 To: scm@geronimo.apache.org From: vamsic007@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090108100452.07FDD2388988@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: vamsic007 Date: Thu Jan 8 02:04:50 2009 New Revision: 732671 URL: http://svn.apache.org/viewvc?rev=732671&view=rev Log: 1. Add a context to host only it has not already been added. 2. Destroy the context once it is stopped. Modified: geronimo/plugins/tuscany/trunk/geronimo-tuscany-http-tomcat/src/main/java/org/apache/geronimo/tuscany/http/tomcat/GeronimoServletHost.java Modified: geronimo/plugins/tuscany/trunk/geronimo-tuscany-http-tomcat/src/main/java/org/apache/geronimo/tuscany/http/tomcat/GeronimoServletHost.java URL: http://svn.apache.org/viewvc/geronimo/plugins/tuscany/trunk/geronimo-tuscany-http-tomcat/src/main/java/org/apache/geronimo/tuscany/http/tomcat/GeronimoServletHost.java?rev=732671&r1=732670&r2=732671&view=diff ============================================================================== --- geronimo/plugins/tuscany/trunk/geronimo-tuscany-http-tomcat/src/main/java/org/apache/geronimo/tuscany/http/tomcat/GeronimoServletHost.java (original) +++ geronimo/plugins/tuscany/trunk/geronimo-tuscany-http-tomcat/src/main/java/org/apache/geronimo/tuscany/http/tomcat/GeronimoServletHost.java Thu Jan 8 02:04:50 2009 @@ -139,7 +139,9 @@ } context = (StandardContext)((StandardHost)host).map(contextPath); + boolean newContext = false; if(context == null || context.getName().equals("")) { + newContext = true; context = new StandardContext(); context.setDocBase(docext + contextPath); context.setJ2EEApplication(JMX_APP_NAME); // FIXME: Different name @@ -180,7 +182,9 @@ if(!temp.exists()) { temp.mkdirs(); } - host.addChild(context); + if(newContext) { + host.addChild(context); + } try { context.start(); } catch (LifecycleException e) { @@ -209,8 +213,9 @@ if(context.findChildren().length < 3 && !context.getName().equals("")){ try{ ((StandardContext)context).stop(); - }catch(LifecycleException lfe){ - log.fatal("The context named " + context.getName() + " failed to stop",lfe); + ((StandardContext)context).destroy(); + }catch(Exception e){ + log.fatal("The context named " + context.getName() + " failed to stop", e); } host.removeChild(context); }