You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2013/04/15 14:37:53 UTC

svn commit: r1467973 - in /camel/branches/camel-2.10.x: ./ camel-core/src/main/java/org/apache/camel/ camel-core/src/main/java/org/apache/camel/api/management/mbean/ camel-core/src/main/java/org/apache/camel/impl/ camel-core/src/main/java/org/apache/ca...

Author: davsclaus
Date: Mon Apr 15 12:37:52 2013
New Revision: 1467973

URL: http://svn.apache.org/r1467973
Log:
CAMEL-6282: TypeConverterRegistry - Allow to enable or disable utilization statistics. Is disabled by default.

Added:
    camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/impl/TypeConverterRegistryStatisticsEnabledTest.java
      - copied unchanged from r1467896, camel/trunk/camel-core/src/test/java/org/apache/camel/impl/TypeConverterRegistryStatisticsEnabledTest.java
    camel/branches/camel-2.10.x/components/camel-spring/src/test/java/org/apache/camel/spring/impl/SpringTypeConverterRegistryStatisticsEnabledTest.java
      - copied unchanged from r1467896, camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/impl/SpringTypeConverterRegistryStatisticsEnabledTest.java
    camel/branches/camel-2.10.x/components/camel-spring/src/test/resources/org/apache/camel/spring/impl/SpringTypeConverterRegistryStatisticsEnabledTest.xml
      - copied unchanged from r1467896, camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/impl/SpringTypeConverterRegistryStatisticsEnabledTest.xml
    camel/branches/camel-2.10.x/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/TypeConverterRegistryStatisticsEnabledTest.java
      - copied unchanged from r1467896, camel/trunk/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/TypeConverterRegistryStatisticsEnabledTest.java
    camel/branches/camel-2.10.x/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/typeConverterRegistryStatisticsEnabledTest.xml
      - copied unchanged from r1467896, camel/trunk/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/typeConverterRegistryStatisticsEnabledTest.xml
Modified:
    camel/branches/camel-2.10.x/   (props changed)
    camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/CamelContext.java
    camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedTypeConverterRegistryMBean.java
    camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
    camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/impl/converter/BaseTypeConverterRegistry.java
    camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedTypeConverterRegistry.java
    camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/spi/TypeConverterRegistry.java
    camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/management/ManagedTypeConverterRegistryTest.java
    camel/branches/camel-2.10.x/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/CamelContextFactoryBean.java
    camel/branches/camel-2.10.x/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java
    camel/branches/camel-2.10.x/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java

Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
  Merged /camel/trunk:r1467896

Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/CamelContext.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/CamelContext.java?rev=1467973&r1=1467972&r2=1467973&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/CamelContext.java (original)
+++ camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/CamelContext.java Mon Apr 15 12:37:52 2013
@@ -1090,6 +1090,30 @@ public interface CamelContext extends Su
     void setLazyLoadTypeConverters(Boolean lazyLoadTypeConverters);
 
     /**
+     * Whether or not type converter statistics is enabled.
+     * <p/>
+     * By default the type converter utilization statistics is disabled.
+     * <b>Notice:</b> If enabled then there is a slight performance impact under very heavy load.
+     *
+     * @return <tt>true</tt> if enabled, <tt>false</tt> if disabled (default).
+     */
+    Boolean isTypeConverterStatisticsEnabled();
+
+    /**
+     * Sets whether or not type converter statistics is enabled.
+     * <p/>
+     * By default the type converter utilization statistics is disabled.
+     * <b>Notice:</b> If enabled then there is a slight performance impact under very heavy load.
+     * <p/>
+     * You can enable/disable the statistics at runtime using the
+     * {@link org.apache.camel.spi.TypeConverterRegistry#getStatistics()#setTypeConverterStatisticsEnabled(Boolean)} method,
+     * or from JMX on the {@link org.apache.camel.api.management.mbean.ManagedTypeConverterRegistryMBean} mbean.
+     *
+     * @param typeConverterStatisticsEnabled <tt>true</tt> to enable, <tt>false</tt> to disable
+     */
+    void setTypeConverterStatisticsEnabled(Boolean typeConverterStatisticsEnabled);
+
+    /**
      * Whether or not <a href="http://www.slf4j.org/api/org/slf4j/MDC.html">MDC</a> logging is being enabled.
      *
      * @return <tt>true</tt> if MDC logging is enabled

Modified: camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedTypeConverterRegistryMBean.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedTypeConverterRegistryMBean.java?rev=1467973&r1=1467972&r2=1467973&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedTypeConverterRegistryMBean.java (original)
+++ camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedTypeConverterRegistryMBean.java Mon Apr 15 12:37:52 2013
@@ -25,23 +25,24 @@ import org.apache.camel.api.management.M
 public interface ManagedTypeConverterRegistryMBean extends ManagedServiceMBean {
 
     @ManagedAttribute(description = "Number of type conversion attempts")
-    @Deprecated
     long getAttemptCounter();
 
     @ManagedAttribute(description = "Number of type conversion hits (successful conversions)")
-    @Deprecated
     long getHitCounter();
 
     @ManagedAttribute(description = "Number of type conversion misses (no suitable type converter)")
-    @Deprecated
     long getMissCounter();
 
     @ManagedAttribute(description = "Number of type conversion failures (failed conversions)")
-    @Deprecated
     long getFailedCounter();
 
     @ManagedOperation(description = "Resets the type conversion counters")
-    @Deprecated
     void resetTypeConversionCounters();
 
+    @ManagedAttribute(description = "Utilization statistics enabled")
+    boolean isStatisticsEnabled();
+
+    @ManagedAttribute(description = "Utilization statistics enabled")
+    void setStatisticsEnabled(boolean statisticsEnabled);
+
 }

Modified: camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java?rev=1467973&r1=1467972&r2=1467973&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java (original)
+++ camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java Mon Apr 15 12:37:52 2013
@@ -173,6 +173,7 @@ public class DefaultCamelContext extends
     private Boolean handleFault = Boolean.FALSE;
     private Boolean disableJMX = Boolean.FALSE;
     private Boolean lazyLoadTypeConverters = Boolean.FALSE;
+    private Boolean typeConverterStatisticsEnabled = Boolean.FALSE;
     private Boolean useMDCLogging = Boolean.FALSE;
     private Boolean useBreadcrumb = Boolean.TRUE;
     private Long delay;
@@ -2122,6 +2123,10 @@ public class DefaultCamelContext extends
         getLanguageResolver();
         getTypeConverterRegistry();
         getTypeConverter();
+
+        if (isTypeConverterStatisticsEnabled() != null) {
+            getTypeConverterRegistry().getStatistics().setStatisticsEnabled(isTypeConverterStatisticsEnabled());
+        }
     }
 
     /**
@@ -2145,6 +2150,7 @@ public class DefaultCamelContext extends
             answer = new DefaultTypeConverter(packageScanClassResolver, getInjector(), getDefaultFactoryFinder());
         }
         setTypeConverterRegistry(answer);
+        answer.getStatistics().setStatisticsEnabled(isTypeConverterStatisticsEnabled());
         return answer;
     }
 
@@ -2373,6 +2379,14 @@ public class DefaultCamelContext extends
         this.lazyLoadTypeConverters = lazyLoadTypeConverters;
     }
 
+    public Boolean isTypeConverterStatisticsEnabled() {
+        return typeConverterStatisticsEnabled != null && typeConverterStatisticsEnabled;
+    }
+
+    public void setTypeConverterStatisticsEnabled(Boolean typeConverterStatisticsEnabled) {
+        this.typeConverterStatisticsEnabled = typeConverterStatisticsEnabled;
+    }
+
     public Boolean isUseMDCLogging() {
         return useMDCLogging != null && useMDCLogging;
     }

Modified: camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/impl/converter/BaseTypeConverterRegistry.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/impl/converter/BaseTypeConverterRegistry.java?rev=1467973&r1=1467972&r2=1467973&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/impl/converter/BaseTypeConverterRegistry.java (original)
+++ camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/impl/converter/BaseTypeConverterRegistry.java Mon Apr 15 12:37:52 2013
@@ -27,6 +27,7 @@ import java.util.concurrent.ConcurrentHa
 import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.concurrent.ExecutionException;
+import java.util.concurrent.atomic.AtomicLong;
 
 import org.apache.camel.CamelExecutionException;
 import org.apache.camel.Exchange;
@@ -63,6 +64,10 @@ public abstract class BaseTypeConverterR
     protected Injector injector;
     protected final FactoryFinder factoryFinder;
     protected final Statistics statistics = new UtilizationStatistics();
+    protected final AtomicLong attemptCounter = new AtomicLong();
+    protected final AtomicLong missCounter = new AtomicLong();
+    protected final AtomicLong hitCounter = new AtomicLong();
+    protected final AtomicLong failedCounter = new AtomicLong();
 
     public BaseTypeConverterRegistry(PackageScanClassResolver resolver, Injector injector, FactoryFinder factoryFinder) {
         this.resolver = resolver;
@@ -102,8 +107,14 @@ public abstract class BaseTypeConverterR
 
         Object answer;
         try {
+            if (statistics.isStatisticsEnabled()) {
+                attemptCounter.incrementAndGet();
+            }
             answer = doConvertTo(type, exchange, value, false);
         } catch (Exception e) {
+            if (statistics.isStatisticsEnabled()) {
+                failedCounter.incrementAndGet();
+            }
             // if its a ExecutionException then we have rethrow it as its not due to failed conversion
             // this is special for FutureTypeConverter
             boolean execution = ObjectHelper.getException(ExecutionException.class, e) != null
@@ -120,9 +131,15 @@ public abstract class BaseTypeConverterR
             }
         }
         if (answer == Void.TYPE) {
+            if (statistics.isStatisticsEnabled()) {
+                missCounter.incrementAndGet();
+            }
             // Could not find suitable conversion
             return null;
         } else {
+            if (statistics.isStatisticsEnabled()) {
+                hitCounter.incrementAndGet();
+            }
             return (T) answer;
         }
     }
@@ -141,8 +158,14 @@ public abstract class BaseTypeConverterR
 
         Object answer;
         try {
+            if (statistics.isStatisticsEnabled()) {
+                attemptCounter.incrementAndGet();
+            }
             answer = doConvertTo(type, exchange, value, false);
         } catch (Exception e) {
+            if (statistics.isStatisticsEnabled()) {
+                failedCounter.incrementAndGet();
+            }
             // error occurred during type conversion
             if (e instanceof TypeConversionException) {
                 throw (TypeConversionException) e;
@@ -151,9 +174,15 @@ public abstract class BaseTypeConverterR
             }
         }
         if (answer == Void.TYPE || value == null) {
+            if (statistics.isStatisticsEnabled()) {
+                missCounter.incrementAndGet();
+            }
             // Could not find suitable conversion
             throw new NoTypeConversionAvailableException(value, type);
         } else {
+            if (statistics.isStatisticsEnabled()) {
+                hitCounter.incrementAndGet();
+            }
             return (T) answer;
         }
     }
@@ -172,14 +201,26 @@ public abstract class BaseTypeConverterR
 
         Object answer;
         try {
+            if (statistics.isStatisticsEnabled()) {
+                attemptCounter.incrementAndGet();
+            }
             answer = doConvertTo(type, exchange, value, true);
         } catch (Exception e) {
+            if (statistics.isStatisticsEnabled()) {
+                failedCounter.incrementAndGet();
+            }
             return null;
         }
         if (answer == Void.TYPE) {
             // Could not find suitable conversion
+            if (statistics.isStatisticsEnabled()) {
+                missCounter.incrementAndGet();
+            }
             return null;
         } else {
+            if (statistics.isStatisticsEnabled()) {
+                hitCounter.incrementAndGet();
+            }
             return (T) answer;
         }
     }
@@ -497,6 +538,13 @@ public abstract class BaseTypeConverterR
 
     @Override
     protected void doStop() throws Exception {
+        // log utilization statistics when stopping, including mappings
+        if (statistics.isStatisticsEnabled()) {
+            String info = statistics.toString();
+            info += String.format(" mappings[total=%s, misses=%s]", typeMappings.size(), misses.size());
+            log.info(info);
+        }
+
         typeMappings.clear();
         misses.clear();
         statistics.reset();
@@ -505,32 +553,46 @@ public abstract class BaseTypeConverterR
     /**
      * Represents utilization statistics
      */
-    @Deprecated
     private final class UtilizationStatistics implements Statistics {
 
+        private boolean statisticsEnabled;
+
         @Override
         public long getAttemptCounter() {
-            return 0;
+            return attemptCounter.get();
         }
 
         @Override
         public long getHitCounter() {
-            return 0;
+            return hitCounter.get();
         }
 
         @Override
         public long getMissCounter() {
-            return 0;
+            return missCounter.get();
         }
 
         @Override
         public long getFailedCounter() {
-            return 0;
+            return failedCounter.get();
         }
 
         @Override
         public void reset() {
-            // noop
+            attemptCounter.set(0);
+            hitCounter.set(0);
+            missCounter.set(0);
+            failedCounter.set(0);
+        }
+
+        @Override
+        public boolean isStatisticsEnabled() {
+            return statisticsEnabled;
+        }
+
+        @Override
+        public void setStatisticsEnabled(boolean statisticsEnabled) {
+            this.statisticsEnabled = statisticsEnabled;
         }
 
         @Override

Modified: camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedTypeConverterRegistry.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedTypeConverterRegistry.java?rev=1467973&r1=1467972&r2=1467973&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedTypeConverterRegistry.java (original)
+++ camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedTypeConverterRegistry.java Mon Apr 15 12:37:52 2013
@@ -57,4 +57,12 @@ public class ManagedTypeConverterRegistr
     public void resetTypeConversionCounters() {
         registry.getStatistics().reset();
     }
+
+    public boolean isStatisticsEnabled() {
+        return registry.getStatistics().isStatisticsEnabled();
+    }
+
+    public void setStatisticsEnabled(boolean statisticsEnabled) {
+        registry.getStatistics().setStatisticsEnabled(statisticsEnabled);
+    }
 }

Modified: camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/spi/TypeConverterRegistry.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/spi/TypeConverterRegistry.java?rev=1467973&r1=1467972&r2=1467973&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/spi/TypeConverterRegistry.java (original)
+++ camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/spi/TypeConverterRegistry.java Mon Apr 15 12:37:52 2013
@@ -21,6 +21,9 @@ import org.apache.camel.TypeConverter;
 
 /**
  * Registry for type converters.
+ * <p/>
+ * The utilization {@link Statistics} is by default disabled, as it has a slight performance impact under very high
+ * concurrent load. The statistics can be enabled using {@link Statistics#setStatisticsEnabled(boolean)} method.
  *
  * @version 
  */
@@ -28,9 +31,7 @@ public interface TypeConverterRegistry e
 
     /**
      * Utilization statistics of the this registry.
-     * @deprecated the statistics has been disabled and the API will be removed in Camel 2.12
      */
-    @Deprecated
     interface Statistics {
 
         /**
@@ -57,6 +58,18 @@ public interface TypeConverterRegistry e
          * Reset the counters
          */
         void reset();
+
+        /**
+         * Whether statistics is enabled.
+         */
+        boolean isStatisticsEnabled();
+
+        /**
+         * Sets whether statistics is enabled.
+         *
+         * @param statisticsEnabled <tt>true</tt> to enable
+         */
+        void setStatisticsEnabled(boolean statisticsEnabled);
     }
 
     /**
@@ -103,9 +116,7 @@ public interface TypeConverterRegistry e
      * Gets the utilization statistics of this type converter registry
      *
      * @return the utilization statistics
-     * @deprecated the statistics has been disabled and the API will be removed in Camel 2.12
      */
-    @Deprecated
     Statistics getStatistics();
 
 }

Modified: camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/management/ManagedTypeConverterRegistryTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/management/ManagedTypeConverterRegistryTest.java?rev=1467973&r1=1467972&r2=1467973&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/management/ManagedTypeConverterRegistryTest.java (original)
+++ camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/management/ManagedTypeConverterRegistryTest.java Mon Apr 15 12:37:52 2013
@@ -17,6 +17,7 @@
 package org.apache.camel.management;
 
 import java.util.Set;
+import javax.management.Attribute;
 import javax.management.MBeanServer;
 import javax.management.ObjectName;
 
@@ -49,6 +50,39 @@ public class ManagedTypeConverterRegistr
             }
         }
         assertNotNull("Cannot find DefaultTypeConverter", name);
+
+        // is disabled by default
+        Boolean enabled = (Boolean) mbeanServer.getAttribute(name, "StatisticsEnabled");
+        assertEquals(Boolean.FALSE, enabled);
+
+        // need to enable statistics
+        mbeanServer.setAttribute(name, new Attribute("StatisticsEnabled", Boolean.TRUE));
+
+        Long failed = (Long) mbeanServer.getAttribute(name, "FailedCounter");
+        assertEquals(0, failed.intValue());
+        Long miss = (Long) mbeanServer.getAttribute(name, "MissCounter");
+        assertEquals(0, miss.intValue());
+
+        try {
+            template.sendBody("direct:start", "foo");
+            fail("Should have thrown exception");
+        } catch (Exception e) {
+            // expected
+        }
+
+        // should now have a failed
+        failed = (Long) mbeanServer.getAttribute(name, "FailedCounter");
+        assertEquals(1, failed.intValue());
+        miss = (Long) mbeanServer.getAttribute(name, "MissCounter");
+        assertEquals(0, miss.intValue());
+
+        // reset
+        mbeanServer.invoke(name, "resetTypeConversionCounters", null, null);
+
+        failed = (Long) mbeanServer.getAttribute(name, "FailedCounter");
+        assertEquals(0, failed.intValue());
+        miss = (Long) mbeanServer.getAttribute(name, "MissCounter");
+        assertEquals(0, miss.intValue());
     }
 
     @Override

Modified: camel/branches/camel-2.10.x/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/CamelContextFactoryBean.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/CamelContextFactoryBean.java?rev=1467973&r1=1467972&r2=1467973&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/CamelContextFactoryBean.java (original)
+++ camel/branches/camel-2.10.x/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/CamelContextFactoryBean.java Mon Apr 15 12:37:52 2013
@@ -104,6 +104,8 @@ public class CamelContextFactoryBean ext
     @XmlAttribute(required = false)
     @Deprecated
     private Boolean lazyLoadTypeConverters;
+    @XmlAttribute(required = false)
+    private Boolean typeConverterStatisticsEnabled;
     @XmlElement(name = "properties", required = false)
     private PropertiesDefinition properties;
     @XmlElement(name = "propertyPlaceholder", type = CamelPropertyPlaceholderDefinition.class, required = false)
@@ -342,6 +344,14 @@ public class CamelContextFactoryBean ext
         this.lazyLoadTypeConverters = lazyLoadTypeConverters;
     }
 
+    public Boolean getTypeConverterStatisticsEnabled() {
+        return typeConverterStatisticsEnabled;
+    }
+
+    public void setTypeConverterStatisticsEnabled(Boolean typeConverterStatisticsEnabled) {
+        this.typeConverterStatisticsEnabled = typeConverterStatisticsEnabled;
+    }
+
     public ShutdownRoute getShutdownRoute() {
         return shutdownRoute;
     }

Modified: camel/branches/camel-2.10.x/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java?rev=1467973&r1=1467972&r2=1467973&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java (original)
+++ camel/branches/camel-2.10.x/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java Mon Apr 15 12:37:52 2013
@@ -477,6 +477,8 @@ public abstract class AbstractCamelConte
     @Deprecated
     public abstract Boolean getLazyLoadTypeConverters();
 
+    public abstract Boolean getTypeConverterStatisticsEnabled();
+
     public abstract CamelJMXAgentDefinition getCamelJMXAgent();
 
     public abstract List<RouteBuilderDefinition> getBuilderRefs();
@@ -545,6 +547,9 @@ public abstract class AbstractCamelConte
         if (getDataFormats() != null) {
             ctx.setDataFormats(getDataFormats().asMap());
         }
+        if (getTypeConverterStatisticsEnabled() != null) {
+            ctx.setTypeConverterStatisticsEnabled(getTypeConverterStatisticsEnabled());
+        }
     }
 
     protected void initThreadPoolProfiles(T context) throws Exception {

Modified: camel/branches/camel-2.10.x/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java?rev=1467973&r1=1467972&r2=1467973&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java (original)
+++ camel/branches/camel-2.10.x/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java Mon Apr 15 12:37:52 2013
@@ -110,6 +110,8 @@ public class CamelContextFactoryBean ext
     @XmlAttribute(required = false)
     @Deprecated
     private Boolean lazyLoadTypeConverters;
+    @XmlAttribute(required = false)
+    private Boolean typeConverterStatisticsEnabled;
     @XmlElement(name = "properties", required = false)
     private PropertiesDefinition properties;
     @XmlElement(name = "propertyPlaceholder", type = CamelPropertyPlaceholderDefinition.class, required = false)
@@ -529,6 +531,14 @@ public class CamelContextFactoryBean ext
         this.lazyLoadTypeConverters = lazyLoadTypeConverters;
     }
 
+    public Boolean getTypeConverterStatisticsEnabled() {
+        return typeConverterStatisticsEnabled;
+    }
+
+    public void setTypeConverterStatisticsEnabled(Boolean typeConverterStatisticsEnabled) {
+        this.typeConverterStatisticsEnabled = typeConverterStatisticsEnabled;
+    }
+
     public CamelJMXAgentDefinition getCamelJMXAgent() {
         return camelJMXAgent;
     }