You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Reinhard Prechtl (JIRA)" <ji...@apache.org> on 2012/09/18 12:12:07 UTC

[jira] [Created] (CAMEL-5623) Cache-Component doesn't work with decorated Caches

Reinhard Prechtl created CAMEL-5623:
---------------------------------------

             Summary: Cache-Component doesn't work with decorated Caches
                 Key: CAMEL-5623
                 URL: https://issues.apache.org/jira/browse/CAMEL-5623
             Project: Camel
          Issue Type: Bug
          Components: camel-cache
    Affects Versions: 2.10.1
            Reporter: Reinhard Prechtl


The camel-cache component uses cacheManager.getCache(cacheName) in org.apache.camel.component.cache.CacheEndpoint.initializeCache():114
This method call does not return decorated caches.

If you want to use a SelfPopulatingCache or a BlockingCache with EhCache and you call cacheManager.replaceCacheWithDecoratedCache(oldCache, decoratedCache), then the CachedEndpoint will return a <null> cache instead of the decorated cache. This happens because the preceeding cacheManager.cacheExists(cacheName) check will not check if a cache is a decorated cache.

My suggestion is replace the getCache() call with getEhcache() call, which will return decorated caches as well.

--
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

[jira] [Updated] (CAMEL-5623) Cache-Component doesn't work with decorated Caches

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5623?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen updated CAMEL-5623:
-------------------------------

    Fix Version/s: 2.10.3
    
> Cache-Component doesn't work with decorated Caches
> --------------------------------------------------
>
>                 Key: CAMEL-5623
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5623
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-cache
>    Affects Versions: 2.10.1, 2.10.2
>            Reporter: Reinhard Prechtl
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.10.3, 2.11.0
>
>         Attachments: camel-cache-5623-part2.patch, camel-cache-5623.patch
>
>
> The camel-cache component uses cacheManager.getCache(cacheName) in org.apache.camel.component.cache.CacheEndpoint.initializeCache():114
> This method call does not return decorated caches.
> If you want to use a SelfPopulatingCache or a BlockingCache with EhCache and you call cacheManager.replaceCacheWithDecoratedCache(oldCache, decoratedCache), then the CachedEndpoint will return a <null> cache instead of the decorated cache. This happens because the preceeding cacheManager.cacheExists(cacheName) check will not check if a cache is a decorated cache.
> My suggestion is to replace the getCache() call with getEhcache() call, which will return decorated caches as well.
> Update: With the above issue resolved, there's a follow-up error in the CacheProducer class. In line 98 it checks if there is content for the given key in the cache. This prevents the use of SelfPopulatingCaches as well, since it is expected that there is no element in the Cache at some point - a CacheEntryFactory will then populate the Cache.
> I've attached a patch to address this issue (camel-cache-5623-part2.patch)

--
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

[jira] [Commented] (CAMEL-5623) Cache-Component doesn't work with decorated Caches

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13460293#comment-13460293 ] 

Claus Ibsen commented on CAMEL-5623:
------------------------------------

Patches is welcome and it would be great with unit tests 
                
> Cache-Component doesn't work with decorated Caches
> --------------------------------------------------
>
>                 Key: CAMEL-5623
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5623
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-cache
>    Affects Versions: 2.10.1
>            Reporter: Reinhard Prechtl
>             Fix For: 2.11.0
>
>
> The camel-cache component uses cacheManager.getCache(cacheName) in org.apache.camel.component.cache.CacheEndpoint.initializeCache():114
> This method call does not return decorated caches.
> If you want to use a SelfPopulatingCache or a BlockingCache with EhCache and you call cacheManager.replaceCacheWithDecoratedCache(oldCache, decoratedCache), then the CachedEndpoint will return a <null> cache instead of the decorated cache. This happens because the preceeding cacheManager.cacheExists(cacheName) check will not check if a cache is a decorated cache.
> My suggestion is to replace the getCache() call with getEhcache() call, which will return decorated caches as well.

--
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

[jira] [Updated] (CAMEL-5623) Cache-Component doesn't work with decorated Caches

Posted by "Reinhard Prechtl (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5623?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Reinhard Prechtl updated CAMEL-5623:
------------------------------------

    Description: 
The camel-cache component uses cacheManager.getCache(cacheName) in org.apache.camel.component.cache.CacheEndpoint.initializeCache():114
This method call does not return decorated caches.

If you want to use a SelfPopulatingCache or a BlockingCache with EhCache and you call cacheManager.replaceCacheWithDecoratedCache(oldCache, decoratedCache), then the CachedEndpoint will return a <null> cache instead of the decorated cache. This happens because the preceeding cacheManager.cacheExists(cacheName) check will not check if a cache is a decorated cache.

My suggestion is to replace the getCache() call with getEhcache() call, which will return decorated caches as well.

Update: With the above issue resolved, there's a follow-up error in the CacheProducer class. In line 98 it checks if there is content for the given key in the cache. This prevents the use of SelfPopulatingCaches as well, since it is expected that there is no element in the Cache at some point - a CacheEntryFactory will then populate the Cache.
I've attached a patch to address this issue (camel-cache-5623-part2.patch)

  was:
The camel-cache component uses cacheManager.getCache(cacheName) in org.apache.camel.component.cache.CacheEndpoint.initializeCache():114
This method call does not return decorated caches.

If you want to use a SelfPopulatingCache or a BlockingCache with EhCache and you call cacheManager.replaceCacheWithDecoratedCache(oldCache, decoratedCache), then the CachedEndpoint will return a <null> cache instead of the decorated cache. This happens because the preceeding cacheManager.cacheExists(cacheName) check will not check if a cache is a decorated cache.

My suggestion is to replace the getCache() call with getEhcache() call, which will return decorated caches as well.

Update: With the above issue resolved, there's a follow-up error in the CacheProducer class. In line 98 it checks if there is content for the given key in the cache. This prevents the use of SelfPopulatingCaches as well, since it is expected that there is no element in the Cache at some point - a CacheEntryFactory will then populate the Cache.

    
> Cache-Component doesn't work with decorated Caches
> --------------------------------------------------
>
>                 Key: CAMEL-5623
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5623
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-cache
>    Affects Versions: 2.10.1, 2.10.2
>            Reporter: Reinhard Prechtl
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.11.0
>
>         Attachments: camel-cache-5623-part2.patch, camel-cache-5623.patch
>
>
> The camel-cache component uses cacheManager.getCache(cacheName) in org.apache.camel.component.cache.CacheEndpoint.initializeCache():114
> This method call does not return decorated caches.
> If you want to use a SelfPopulatingCache or a BlockingCache with EhCache and you call cacheManager.replaceCacheWithDecoratedCache(oldCache, decoratedCache), then the CachedEndpoint will return a <null> cache instead of the decorated cache. This happens because the preceeding cacheManager.cacheExists(cacheName) check will not check if a cache is a decorated cache.
> My suggestion is to replace the getCache() call with getEhcache() call, which will return decorated caches as well.
> Update: With the above issue resolved, there's a follow-up error in the CacheProducer class. In line 98 it checks if there is content for the given key in the cache. This prevents the use of SelfPopulatingCaches as well, since it is expected that there is no element in the Cache at some point - a CacheEntryFactory will then populate the Cache.
> I've attached a patch to address this issue (camel-cache-5623-part2.patch)

--
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

[jira] [Updated] (CAMEL-5623) Cache-Component doesn't work with decorated Caches

Posted by "Reinhard Prechtl (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5623?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Reinhard Prechtl updated CAMEL-5623:
------------------------------------

    Attachment: camel-cache-5623.patch

This patch changes retrieving a cache from using the getCache() method to the getEhcache() method, thus enabling the CacheEndpoint to retrieve decorating caches.
                
> Cache-Component doesn't work with decorated Caches
> --------------------------------------------------
>
>                 Key: CAMEL-5623
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5623
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-cache
>    Affects Versions: 2.10.1
>            Reporter: Reinhard Prechtl
>            Priority: Minor
>             Fix For: 2.11.0
>
>         Attachments: camel-cache-5623.patch
>
>
> The camel-cache component uses cacheManager.getCache(cacheName) in org.apache.camel.component.cache.CacheEndpoint.initializeCache():114
> This method call does not return decorated caches.
> If you want to use a SelfPopulatingCache or a BlockingCache with EhCache and you call cacheManager.replaceCacheWithDecoratedCache(oldCache, decoratedCache), then the CachedEndpoint will return a <null> cache instead of the decorated cache. This happens because the preceeding cacheManager.cacheExists(cacheName) check will not check if a cache is a decorated cache.
> My suggestion is to replace the getCache() call with getEhcache() call, which will return decorated caches as well.

--
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

[jira] [Commented] (CAMEL-5623) Cache-Component doesn't work with decorated Caches

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13464545#comment-13464545 ] 

Claus Ibsen commented on CAMEL-5623:
------------------------------------

Timeframes for releases is discussed on the @dev mailinglis.

Looks like there is a recent snapshot here
https://repository.apache.org/content/repositories/snapshots/org/apache/camel/camel-cache/2.10.2-SNAPSHOT/
                
> Cache-Component doesn't work with decorated Caches
> --------------------------------------------------
>
>                 Key: CAMEL-5623
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5623
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-cache
>    Affects Versions: 2.10.1
>            Reporter: Reinhard Prechtl
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.11.0, 2.10.2
>
>         Attachments: camel-cache-5623.patch
>
>
> The camel-cache component uses cacheManager.getCache(cacheName) in org.apache.camel.component.cache.CacheEndpoint.initializeCache():114
> This method call does not return decorated caches.
> If you want to use a SelfPopulatingCache or a BlockingCache with EhCache and you call cacheManager.replaceCacheWithDecoratedCache(oldCache, decoratedCache), then the CachedEndpoint will return a <null> cache instead of the decorated cache. This happens because the preceeding cacheManager.cacheExists(cacheName) check will not check if a cache is a decorated cache.
> My suggestion is to replace the getCache() call with getEhcache() call, which will return decorated caches as well.

--
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

[jira] [Updated] (CAMEL-5623) Cache-Component doesn't work with decorated Caches

Posted by "Reinhard Prechtl (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5623?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Reinhard Prechtl updated CAMEL-5623:
------------------------------------

    Description: 
The camel-cache component uses cacheManager.getCache(cacheName) in org.apache.camel.component.cache.CacheEndpoint.initializeCache():114
This method call does not return decorated caches.

If you want to use a SelfPopulatingCache or a BlockingCache with EhCache and you call cacheManager.replaceCacheWithDecoratedCache(oldCache, decoratedCache), then the CachedEndpoint will return a <null> cache instead of the decorated cache. This happens because the preceeding cacheManager.cacheExists(cacheName) check will not check if a cache is a decorated cache.

My suggestion is to replace the getCache() call with getEhcache() call, which will return decorated caches as well.

  was:
The camel-cache component uses cacheManager.getCache(cacheName) in org.apache.camel.component.cache.CacheEndpoint.initializeCache():114
This method call does not return decorated caches.

If you want to use a SelfPopulatingCache or a BlockingCache with EhCache and you call cacheManager.replaceCacheWithDecoratedCache(oldCache, decoratedCache), then the CachedEndpoint will return a <null> cache instead of the decorated cache. This happens because the preceeding cacheManager.cacheExists(cacheName) check will not check if a cache is a decorated cache.

My suggestion is replace the getCache() call with getEhcache() call, which will return decorated caches as well.

    
> Cache-Component doesn't work with decorated Caches
> --------------------------------------------------
>
>                 Key: CAMEL-5623
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5623
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-cache
>    Affects Versions: 2.10.1
>            Reporter: Reinhard Prechtl
>
> The camel-cache component uses cacheManager.getCache(cacheName) in org.apache.camel.component.cache.CacheEndpoint.initializeCache():114
> This method call does not return decorated caches.
> If you want to use a SelfPopulatingCache or a BlockingCache with EhCache and you call cacheManager.replaceCacheWithDecoratedCache(oldCache, decoratedCache), then the CachedEndpoint will return a <null> cache instead of the decorated cache. This happens because the preceeding cacheManager.cacheExists(cacheName) check will not check if a cache is a decorated cache.
> My suggestion is to replace the getCache() call with getEhcache() call, which will return decorated caches as well.

--
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

[jira] [Resolved] (CAMEL-5623) Cache-Component doesn't work with decorated Caches

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5623?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-5623.
--------------------------------

    Resolution: Fixed

Thanks for the 2nd patch.
                
> Cache-Component doesn't work with decorated Caches
> --------------------------------------------------
>
>                 Key: CAMEL-5623
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5623
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-cache
>    Affects Versions: 2.10.1, 2.10.2
>            Reporter: Reinhard Prechtl
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.11.0
>
>         Attachments: camel-cache-5623-part2.patch, camel-cache-5623.patch
>
>
> The camel-cache component uses cacheManager.getCache(cacheName) in org.apache.camel.component.cache.CacheEndpoint.initializeCache():114
> This method call does not return decorated caches.
> If you want to use a SelfPopulatingCache or a BlockingCache with EhCache and you call cacheManager.replaceCacheWithDecoratedCache(oldCache, decoratedCache), then the CachedEndpoint will return a <null> cache instead of the decorated cache. This happens because the preceeding cacheManager.cacheExists(cacheName) check will not check if a cache is a decorated cache.
> My suggestion is to replace the getCache() call with getEhcache() call, which will return decorated caches as well.
> Update: With the above issue resolved, there's a follow-up error in the CacheProducer class. In line 98 it checks if there is content for the given key in the cache. This prevents the use of SelfPopulatingCaches as well, since it is expected that there is no element in the Cache at some point - a CacheEntryFactory will then populate the Cache.
> I've attached a patch to address this issue (camel-cache-5623-part2.patch)

--
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

[jira] [Resolved] (CAMEL-5623) Cache-Component doesn't work with decorated Caches

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5623?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-5623.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 2.10.2
         Assignee: Claus Ibsen

Thanks for the patch.
                
> Cache-Component doesn't work with decorated Caches
> --------------------------------------------------
>
>                 Key: CAMEL-5623
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5623
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-cache
>    Affects Versions: 2.10.1
>            Reporter: Reinhard Prechtl
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.11.0, 2.10.2
>
>         Attachments: camel-cache-5623.patch
>
>
> The camel-cache component uses cacheManager.getCache(cacheName) in org.apache.camel.component.cache.CacheEndpoint.initializeCache():114
> This method call does not return decorated caches.
> If you want to use a SelfPopulatingCache or a BlockingCache with EhCache and you call cacheManager.replaceCacheWithDecoratedCache(oldCache, decoratedCache), then the CachedEndpoint will return a <null> cache instead of the decorated cache. This happens because the preceeding cacheManager.cacheExists(cacheName) check will not check if a cache is a decorated cache.
> My suggestion is to replace the getCache() call with getEhcache() call, which will return decorated caches as well.

--
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

[jira] [Updated] (CAMEL-5623) Cache-Component doesn't work with decorated Caches

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5623?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen updated CAMEL-5623:
-------------------------------

    Issue Type: Improvement  (was: Bug)
    
> Cache-Component doesn't work with decorated Caches
> --------------------------------------------------
>
>                 Key: CAMEL-5623
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5623
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-cache
>    Affects Versions: 2.10.1
>            Reporter: Reinhard Prechtl
>
> The camel-cache component uses cacheManager.getCache(cacheName) in org.apache.camel.component.cache.CacheEndpoint.initializeCache():114
> This method call does not return decorated caches.
> If you want to use a SelfPopulatingCache or a BlockingCache with EhCache and you call cacheManager.replaceCacheWithDecoratedCache(oldCache, decoratedCache), then the CachedEndpoint will return a <null> cache instead of the decorated cache. This happens because the preceeding cacheManager.cacheExists(cacheName) check will not check if a cache is a decorated cache.
> My suggestion is to replace the getCache() call with getEhcache() call, which will return decorated caches as well.

--
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

[jira] [Updated] (CAMEL-5623) Cache-Component doesn't work with decorated Caches

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5623?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen updated CAMEL-5623:
-------------------------------

         Priority: Minor  (was: Major)
    Fix Version/s: 2.11.0
    
> Cache-Component doesn't work with decorated Caches
> --------------------------------------------------
>
>                 Key: CAMEL-5623
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5623
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-cache
>    Affects Versions: 2.10.1
>            Reporter: Reinhard Prechtl
>            Priority: Minor
>             Fix For: 2.11.0
>
>
> The camel-cache component uses cacheManager.getCache(cacheName) in org.apache.camel.component.cache.CacheEndpoint.initializeCache():114
> This method call does not return decorated caches.
> If you want to use a SelfPopulatingCache or a BlockingCache with EhCache and you call cacheManager.replaceCacheWithDecoratedCache(oldCache, decoratedCache), then the CachedEndpoint will return a <null> cache instead of the decorated cache. This happens because the preceeding cacheManager.cacheExists(cacheName) check will not check if a cache is a decorated cache.
> My suggestion is to replace the getCache() call with getEhcache() call, which will return decorated caches as well.

--
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

[jira] [Reopened] (CAMEL-5623) Cache-Component doesn't work with decorated Caches

Posted by "Reinhard Prechtl (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5623?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Reinhard Prechtl reopened CAMEL-5623:
-------------------------------------


With the above issue resolved, there's a follow-up error in the CacheProducer class. In line 98 it checks if there is content for the given key in the cache. This prevents the use of SelfPopulatingCaches as well, since it is expected that there is no element in the Cache at some point - a CacheEntryFactory will then populate the Cache.
                
> Cache-Component doesn't work with decorated Caches
> --------------------------------------------------
>
>                 Key: CAMEL-5623
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5623
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-cache
>    Affects Versions: 2.10.1, 2.10.2
>            Reporter: Reinhard Prechtl
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.11.0
>
>         Attachments: camel-cache-5623-part2.patch, camel-cache-5623.patch
>
>
> The camel-cache component uses cacheManager.getCache(cacheName) in org.apache.camel.component.cache.CacheEndpoint.initializeCache():114
> This method call does not return decorated caches.
> If you want to use a SelfPopulatingCache or a BlockingCache with EhCache and you call cacheManager.replaceCacheWithDecoratedCache(oldCache, decoratedCache), then the CachedEndpoint will return a <null> cache instead of the decorated cache. This happens because the preceeding cacheManager.cacheExists(cacheName) check will not check if a cache is a decorated cache.
> My suggestion is to replace the getCache() call with getEhcache() call, which will return decorated caches as well.
> Update: With the above issue resolved, there's a follow-up error in the CacheProducer class. In line 98 it checks if there is content for the given key in the cache. This prevents the use of SelfPopulatingCaches as well, since it is expected that there is no element in the Cache at some point - a CacheEntryFactory will then populate the Cache.

--
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

[jira] [Commented] (CAMEL-5623) Cache-Component doesn't work with decorated Caches

Posted by "Reinhard Prechtl (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13464541#comment-13464541 ] 

Reinhard Prechtl commented on CAMEL-5623:
-----------------------------------------

Claus, do you have any estimates when the patch will be available in the 2.10.2-SNAPSHOT release? Also do you maybe have a timeframe for the 2.10.2 version to be released? Cheers!
                
> Cache-Component doesn't work with decorated Caches
> --------------------------------------------------
>
>                 Key: CAMEL-5623
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5623
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-cache
>    Affects Versions: 2.10.1
>            Reporter: Reinhard Prechtl
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.11.0, 2.10.2
>
>         Attachments: camel-cache-5623.patch
>
>
> The camel-cache component uses cacheManager.getCache(cacheName) in org.apache.camel.component.cache.CacheEndpoint.initializeCache():114
> This method call does not return decorated caches.
> If you want to use a SelfPopulatingCache or a BlockingCache with EhCache and you call cacheManager.replaceCacheWithDecoratedCache(oldCache, decoratedCache), then the CachedEndpoint will return a <null> cache instead of the decorated cache. This happens because the preceeding cacheManager.cacheExists(cacheName) check will not check if a cache is a decorated cache.
> My suggestion is to replace the getCache() call with getEhcache() call, which will return decorated caches as well.

--
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

[jira] [Updated] (CAMEL-5623) Cache-Component doesn't work with decorated Caches

Posted by "Reinhard Prechtl (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5623?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Reinhard Prechtl updated CAMEL-5623:
------------------------------------

          Description: 
The camel-cache component uses cacheManager.getCache(cacheName) in org.apache.camel.component.cache.CacheEndpoint.initializeCache():114
This method call does not return decorated caches.

If you want to use a SelfPopulatingCache or a BlockingCache with EhCache and you call cacheManager.replaceCacheWithDecoratedCache(oldCache, decoratedCache), then the CachedEndpoint will return a <null> cache instead of the decorated cache. This happens because the preceeding cacheManager.cacheExists(cacheName) check will not check if a cache is a decorated cache.

My suggestion is to replace the getCache() call with getEhcache() call, which will return decorated caches as well.

Update: With the above issue resolved, there's a follow-up error in the CacheProducer class. In line 98 it checks if there is content for the given key in the cache. This prevents the use of SelfPopulatingCaches as well, since it is expected that there is no element in the Cache at some point - a CacheEntryFactory will then populate the Cache.

  was:
The camel-cache component uses cacheManager.getCache(cacheName) in org.apache.camel.component.cache.CacheEndpoint.initializeCache():114
This method call does not return decorated caches.

If you want to use a SelfPopulatingCache or a BlockingCache with EhCache and you call cacheManager.replaceCacheWithDecoratedCache(oldCache, decoratedCache), then the CachedEndpoint will return a <null> cache instead of the decorated cache. This happens because the preceeding cacheManager.cacheExists(cacheName) check will not check if a cache is a decorated cache.

My suggestion is to replace the getCache() call with getEhcache() call, which will return decorated caches as well.

           Patch Info: Patch Available
    Affects Version/s: 2.10.2
        Fix Version/s:     (was: 2.10.2)
    
> Cache-Component doesn't work with decorated Caches
> --------------------------------------------------
>
>                 Key: CAMEL-5623
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5623
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-cache
>    Affects Versions: 2.10.1, 2.10.2
>            Reporter: Reinhard Prechtl
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.11.0
>
>         Attachments: camel-cache-5623.patch
>
>
> The camel-cache component uses cacheManager.getCache(cacheName) in org.apache.camel.component.cache.CacheEndpoint.initializeCache():114
> This method call does not return decorated caches.
> If you want to use a SelfPopulatingCache or a BlockingCache with EhCache and you call cacheManager.replaceCacheWithDecoratedCache(oldCache, decoratedCache), then the CachedEndpoint will return a <null> cache instead of the decorated cache. This happens because the preceeding cacheManager.cacheExists(cacheName) check will not check if a cache is a decorated cache.
> My suggestion is to replace the getCache() call with getEhcache() call, which will return decorated caches as well.
> Update: With the above issue resolved, there's a follow-up error in the CacheProducer class. In line 98 it checks if there is content for the given key in the cache. This prevents the use of SelfPopulatingCaches as well, since it is expected that there is no element in the Cache at some point - a CacheEntryFactory will then populate the Cache.

--
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

[jira] [Updated] (CAMEL-5623) Cache-Component doesn't work with decorated Caches

Posted by "Reinhard Prechtl (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5623?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Reinhard Prechtl updated CAMEL-5623:
------------------------------------

    Attachment: camel-cache-5623-part2.patch

patch that will enable SelfPopulatingCaches with the CacheComponent
                
> Cache-Component doesn't work with decorated Caches
> --------------------------------------------------
>
>                 Key: CAMEL-5623
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5623
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-cache
>    Affects Versions: 2.10.1, 2.10.2
>            Reporter: Reinhard Prechtl
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.11.0
>
>         Attachments: camel-cache-5623-part2.patch, camel-cache-5623.patch
>
>
> The camel-cache component uses cacheManager.getCache(cacheName) in org.apache.camel.component.cache.CacheEndpoint.initializeCache():114
> This method call does not return decorated caches.
> If you want to use a SelfPopulatingCache or a BlockingCache with EhCache and you call cacheManager.replaceCacheWithDecoratedCache(oldCache, decoratedCache), then the CachedEndpoint will return a <null> cache instead of the decorated cache. This happens because the preceeding cacheManager.cacheExists(cacheName) check will not check if a cache is a decorated cache.
> My suggestion is to replace the getCache() call with getEhcache() call, which will return decorated caches as well.
> Update: With the above issue resolved, there's a follow-up error in the CacheProducer class. In line 98 it checks if there is content for the given key in the cache. This prevents the use of SelfPopulatingCaches as well, since it is expected that there is no element in the Cache at some point - a CacheEntryFactory will then populate the Cache.

--
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