You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Mark Ford (JIRA)" <ji...@apache.org> on 2010/10/19 22:20:40 UTC

[jira] Updated: (CAMEL-3255) Add property to DefaultCamelContext to allow for lazy loading of the DefaultTypeConverter

     [ https://issues.apache.org/activemq/browse/CAMEL-3255?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Ford updated CAMEL-3255:
-----------------------------

    Attachment: patch.txt

Patch adds the property to the context and encapsulates the loading of the type converters using the strategy pattern. Unit test is included.

For example:

    protected static interface LoadTypeConvertersStrategy {
        public void starting() throws Exception;
        public void accessing();
        public void stopping();
    }

The default implementation of loading up front loads the type converters when the DefaultTypeConverter is started and is a no-op for the accessing method. The stopping method clears the type mappings. The benefit of the up front loading is that there are no synchronization points at runtime. The cost is that it takes longer to initialize the context.

The lazy load implementation defers the loading until the synchronized accessing method is invoked. The benefit of the lazy loading is that the context initializes faster. The cost is that there are synchronization points at runtime.


> Add property to DefaultCamelContext to allow for lazy loading of the DefaultTypeConverter
> -----------------------------------------------------------------------------------------
>
>                 Key: CAMEL-3255
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-3255
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-core
>    Affects Versions: 2.2.0, 2.3.0, 2.4.0
>            Reporter: Mark Ford
>            Priority: Minor
>         Attachments: patch.txt
>
>
> The loading of type converters was changed from a lazy loading to an up front loading in a Camel 2.2. See issue CAMEL-2392 for details. Accordingly to the logging, it takes approximately 300 millis for this process to complete. 
> The proposal is to allow the configuration of this loading strategy for cases where the initialization time of contexts is more important than the loading of type converters. The "lazyLoadTypeConverters" property on the context will default to false to preserve the current up front loading behavior as the default. If this value is set to true, then the loading of the type converters will happen when accessed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.