Return-Path: X-Original-To: apmail-camel-commits-archive@www.apache.org Delivered-To: apmail-camel-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 62B629BA1 for ; Tue, 20 Sep 2011 00:40:01 +0000 (UTC) Received: (qmail 18135 invoked by uid 500); 20 Sep 2011 00:40:01 -0000 Delivered-To: apmail-camel-commits-archive@camel.apache.org Received: (qmail 18103 invoked by uid 500); 20 Sep 2011 00:40:01 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 18094 invoked by uid 99); 20 Sep 2011 00:40:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Sep 2011 00:40:01 +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, 20 Sep 2011 00:39:58 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 2706C2388900 for ; Tue, 20 Sep 2011 00:39:37 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1172924 - in /camel/branches/camel-2.8.x: ./ camel-core/src/main/java/org/apache/camel/impl/converter/ camel-core/src/test/java/org/apache/camel/converter/ Date: Tue, 20 Sep 2011 00:39:37 -0000 To: commits@camel.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20110920003937.2706C2388900@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dkulp Date: Tue Sep 20 00:39:36 2011 New Revision: 1172924 URL: http://svn.apache.org/viewvc?rev=1172924&view=rev Log: Merged revisions 1166265 via svnmerge from https://svn.apache.org/repos/asf/camel/trunk ........ r1166265 | hadrian | 2011-09-07 13:00:31 -0400 (Wed, 07 Sep 2011) | 1 line CAMEL-4392. PropertyEditorTypeConverter should not be a Service ........ Modified: camel/branches/camel-2.8.x/ (props changed) camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/impl/converter/BaseTypeConverterRegistry.java camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/impl/converter/PropertyEditorTypeConverter.java camel/branches/camel-2.8.x/camel-core/src/test/java/org/apache/camel/converter/PropertyEditorTypeConverterIssueTest.java Propchange: camel/branches/camel-2.8.x/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/impl/converter/BaseTypeConverterRegistry.java URL: http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/impl/converter/BaseTypeConverterRegistry.java?rev=1172924&r1=1172923&r2=1172924&view=diff ============================================================================== --- camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/impl/converter/BaseTypeConverterRegistry.java (original) +++ camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/impl/converter/BaseTypeConverterRegistry.java Tue Sep 20 00:39:36 2011 @@ -431,15 +431,14 @@ public abstract class BaseTypeConverterR @Override protected void doStart() throws Exception { - ServiceHelper.startService(propertyEditorTypeConverter); + // noop } @Override protected void doStop() throws Exception { typeMappings.clear(); misses.clear(); - // let property editor type converter stop and cleanup resources - ServiceHelper.stopService(propertyEditorTypeConverter); + propertyEditorTypeConverter.clear(); } /** @@ -511,5 +510,4 @@ public abstract class BaseTypeConverterR return fallbackTypeConverter; } } - } Modified: camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/impl/converter/PropertyEditorTypeConverter.java URL: http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/impl/converter/PropertyEditorTypeConverter.java?rev=1172924&r1=1172923&r2=1172924&view=diff ============================================================================== --- camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/impl/converter/PropertyEditorTypeConverter.java (original) +++ camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/impl/converter/PropertyEditorTypeConverter.java Tue Sep 20 00:39:36 2011 @@ -22,7 +22,6 @@ import java.util.HashMap; import java.util.Map; import org.apache.camel.Exchange; -import org.apache.camel.Service; import org.apache.camel.TypeConverter; import org.apache.camel.util.LRUSoftCache; import org.apache.camel.util.ObjectHelper; @@ -35,7 +34,7 @@ import org.slf4j.LoggerFactory; * * @version */ -public class PropertyEditorTypeConverter implements TypeConverter, Service { +public class PropertyEditorTypeConverter implements TypeConverter { private static final Logger LOG = LoggerFactory.getLogger(PropertyEditorTypeConverter.class); // use a soft bound cache to avoid using too much memory in case a lot of different classes @@ -44,6 +43,11 @@ public class PropertyEditorTypeConverter // we don't anticipate so many property editors so we have unbounded map private final Map, PropertyEditor> cache = new HashMap, PropertyEditor>(); + public void clear() { + cache.clear(); + misses.clear(); + } + public T convertTo(Class type, Object value) { // We can't convert null values since we can't figure out a property // editor for it. @@ -114,15 +118,4 @@ public class PropertyEditorTypeConverter public T mandatoryConvertTo(Class type, Exchange exchange, Object value) { return convertTo(type, value); } - - public void start() throws Exception { - // noop - } - - public void stop() throws Exception { - // clear caches so we dont leak - cache.clear(); - misses.clear(); - } - } Modified: camel/branches/camel-2.8.x/camel-core/src/test/java/org/apache/camel/converter/PropertyEditorTypeConverterIssueTest.java URL: http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/camel-core/src/test/java/org/apache/camel/converter/PropertyEditorTypeConverterIssueTest.java?rev=1172924&r1=1172923&r2=1172924&view=diff ============================================================================== --- camel/branches/camel-2.8.x/camel-core/src/test/java/org/apache/camel/converter/PropertyEditorTypeConverterIssueTest.java (original) +++ camel/branches/camel-2.8.x/camel-core/src/test/java/org/apache/camel/converter/PropertyEditorTypeConverterIssueTest.java Tue Sep 20 00:39:36 2011 @@ -37,5 +37,4 @@ public class PropertyEditorTypeConverter } log.info("Time taken: " + watch.stop()); } - }