camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1164515 - /camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/PropertyEditorTypeConverter.java
Date Fri, 02 Sep 2011 12:51:58 GMT
Author: davsclaus
Date: Fri Sep  2 12:51:57 2011
New Revision: 1164515

URL: http://svn.apache.org/viewvc?rev=1164515&view=rev
Log:
CAMEL-4392. Clear cache maps when stopping Camel to avoid leaks

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/PropertyEditorTypeConverter.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/PropertyEditorTypeConverter.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/PropertyEditorTypeConverter.java?rev=1164515&r1=1164514&r2=1164515&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/PropertyEditorTypeConverter.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/PropertyEditorTypeConverter.java
Fri Sep  2 12:51:57 2011
@@ -22,6 +22,7 @@ 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;
@@ -34,7 +35,7 @@ import org.slf4j.LoggerFactory;
  *
  * @version 
  */
-public class PropertyEditorTypeConverter implements TypeConverter {
+public class PropertyEditorTypeConverter implements TypeConverter, Service {
 
     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
@@ -113,4 +114,15 @@ public class PropertyEditorTypeConverter
     public <T> T mandatoryConvertTo(Class<T> 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();
+    }
+
 }



Mime
View raw message