[
https://issues.apache.org/jira/browse/CAMEL-5940?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13616110#comment-13616110
]
Claus Ibsen commented on CAMEL-5940:
------------------------------------
After looking at the patch. There is some feedback
1. you should not alter the state of the cache manager factory when creating an
endpoint. This means the state changes when a new endpoint is created, eg in
{code}
cacheManager.setCacheManagerName(uri.getScheme());
{code}
2. In the component create a default cacahe manger factory in the doStart if
none has been explicit configured.
3. Use that cache manager when creating endpoints (do not alter its state)
4. Avoid using synchronized getters. Instead use doStart / doStop to
initlialize your objects.
5. Do not override stop() but override doStop()
6. And it would be a good idea to close the configInputStram after your are
done reading it, instead of deffering that to doStop. eg so we close the
resource asap. in the DefaultCacheManagerFactory class.
> camel-cache - Add option to cache component to easily configure ehcache XML
> file to load by default
> ---------------------------------------------------------------------------------------------------
>
> Key: CAMEL-5940
> URL: https://issues.apache.org/jira/browse/CAMEL-5940
> Project: Camel
> Issue Type: Improvement
> Components: camel-cache
> Reporter: Claus Ibsen
> Assignee: Claus Ibsen
> Fix For: 2.11.1
>
> Attachments: 0001-CAMEL-5940-implementation.patch
>
>
> See
> By default ehache.xml is loaded from classpath. We should make it possible to
> configure CacheComponent with a string option that refers to the resource to
> load.
> Then people can do something a like:
> {code}
> <bean id="cache" class="...CacheComponent">
> <property name="configurationFile" value="classpath:com/foo/mycache.xml"/>
> </bean>
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira