You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by dk...@apache.org on 2011/09/20 02:39:37 UTC
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/
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<Class<?>, PropertyEditor> cache = new HashMap<Class<?>, PropertyEditor>();
+ public void clear() {
+ cache.clear();
+ misses.clear();
+ }
+
public <T> T convertTo(Class<T> 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> 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();
- }
-
}
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());
}
-
}