Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 46A5A651A for ; Tue, 19 Jul 2011 16:49:09 +0000 (UTC) Received: (qmail 60911 invoked by uid 500); 19 Jul 2011 16:49:08 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 60858 invoked by uid 500); 19 Jul 2011 16:49:08 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 60851 invoked by uid 99); 19 Jul 2011 16:49:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Jul 2011 16:49:07 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.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; Tue, 19 Jul 2011 16:49:06 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 8BAEB23889B1 for ; Tue, 19 Jul 2011 16:48:46 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1148441 - in /cxf/branches/2.4.x-fixes: ./ rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFNonSpringServlet.java Date: Tue, 19 Jul 2011 16:48:46 -0000 To: commits@cxf.apache.org From: ay@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110719164846.8BAEB23889B1@eris.apache.org> Author: ay Date: Tue Jul 19 16:48:45 2011 New Revision: 1148441 URL: http://svn.apache.org/viewvc?rev=1148441&view=rev Log: Merged revisions 1148235 via svnmerge from https://svn.apache.org/repos/asf/cxf/trunk ........ r1148235 | ay | 2011-07-19 10:41:37 +0200 (Tue, 19 Jul 2011) | 1 line [CXF-3665] server-side endpoint cleanup problem under spring/osgi ........ Modified: cxf/branches/2.4.x-fixes/ (props changed) cxf/branches/2.4.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java cxf/branches/2.4.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFNonSpringServlet.java Propchange: cxf/branches/2.4.x-fixes/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Tue Jul 19 16:48:45 2011 @@ -1 +1 @@ -/cxf/trunk:1144977,1145682,1146773,1147504,1148067,1148077,1148257 +/cxf/trunk:1144977,1145682,1146773,1147504,1148067,1148077,1148235,1148257 Propchange: cxf/branches/2.4.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: cxf/branches/2.4.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java?rev=1148441&r1=1148440&r2=1148441&view=diff ============================================================================== --- cxf/branches/2.4.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java (original) +++ cxf/branches/2.4.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java Tue Jul 19 16:48:45 2011 @@ -100,7 +100,7 @@ public abstract class AbstractHTTPDestin private static final Logger LOG = LogUtils.getL7dLogger(AbstractHTTPDestination.class); protected final Bus bus; - protected final DestinationRegistry registry; + protected DestinationRegistry registry; protected final String path; // Configuration values @@ -732,10 +732,20 @@ public abstract class AbstractHTTPDestin public boolean canAssert(QName type) { return PolicyUtils.HTTPSERVERPOLICY_ASSERTION_QNAME.equals(type); } + + public void releaseRegistry() { + registry = null; + } + @Override public void shutdown() { - registry.removeDestination(path); + synchronized (this) { + if (registry != null) { + registry.removeDestination(path); + releaseRegistry(); + } + } super.shutdown(); } } Modified: cxf/branches/2.4.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFNonSpringServlet.java URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFNonSpringServlet.java?rev=1148441&r1=1148440&r2=1148441&view=diff ============================================================================== --- cxf/branches/2.4.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFNonSpringServlet.java (original) +++ cxf/branches/2.4.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFNonSpringServlet.java Tue Jul 19 16:48:45 2011 @@ -30,6 +30,7 @@ import org.apache.cxf.BusFactory; import org.apache.cxf.resource.ResourceManager; import org.apache.cxf.transport.DestinationFactory; import org.apache.cxf.transport.DestinationFactoryManager; +import org.apache.cxf.transport.http.AbstractHTTPDestination; import org.apache.cxf.transport.http.DestinationRegistry; import org.apache.cxf.transport.http.HTTPTransportFactory; import org.apache.cxf.transport.servlet.servicelist.ServiceListGeneratorServlet; @@ -117,4 +118,15 @@ public class CXFNonSpringServlet extends } } + public void destroy() { + for (String path : destinationRegistry.getDestinationsPaths()) { + // clean up the destination in case the destination itself can no longer access the registry later + AbstractHTTPDestination dest = destinationRegistry.getDestinationForPath(path); + synchronized (dest) { + destinationRegistry.removeDestination(path); + dest.releaseRegistry(); + } + } + destinationRegistry = null; + } }