[
http://jira.jboss.com/jira/browse/JBCACHE-777?page=all ]
Galder Zamarreno updated JBCACHE-777:
-------------------------------------
Summary: Creating a custom cache loader which delegates to a standard cache
loader, can generate misleading WARN messages (was: FileCacheLoader can return null for
get(fqn) breaking the JavaDoc requirement for CacheLoader.get(fqn))
Description:
FileCacheLoader can return a null value for get(fqn) if the node does not exist.
/**
* Returns all keys and values from the persistent store, given a fully qualified
name.
*
* NOTE that the expected return value of this method has changed from JBossCache
1.2.x
* and before! This will affect cache loaders written prior to JBossCache 1.3.0 and
such
* implementations should be checked for compliance with the behaviour expected.
*
* @param name
* @return Map<Object,Object> keys and values for the given node. Returns
* null if the node is not found. If the node is found but has no
* attributes, this method returns an empty Map.
* @throws Exception
*/
If the customer creates a custom cache loader which delegates to a FileCacheLoader, the
following misleading warning message is logged:
10:52:10.839 WARN [MessageListenerThread - Belvedere/Desk/CacheLoaderInterceptor]
CacheLoader.get(Fqn) returned a null; assuming the node nodes not exist.
10:52:10.839 WARN [MessageListenerThread - Belvedere/Desk/CacheLoaderInterceptor] The
CacheLoader interface has changed since JBossCache 1.3.x
10:52:10.839 WARN [MessageListenerThread - Belvedere/Desk/CacheLoaderInterceptor] Please
see
http://jira.jboss.com/jira/browse/JBCACHE-118
10:52:10.849 WARN [MessageListenerThread - Belvedere/Desk/CacheLoaderInterceptor]
CacheLoader.get() should return an empty Map if the node does exist but doesn't have
any attributes.
This occurrs even though the FileCacheLoader is actually doing the job accordingly.
was:
FileCacheLoader can return a null value for get(fqn) which goes against the JavaDoc
requirements for that method:
/**
* Returns all keys and values from the persistent store, given a fully qualified
name.
*
* NOTE that the expected return value of this method has changed from JBossCache
1.2.x
* and before! This will affect cache loaders written prior to JBossCache 1.3.0 and
such
* implementations should be checked for compliance with the behaviour expected.
*
* @param name
* @return Map<Object,Object> keys and values for the given node. Returns
* null if the node is not found. If the node is found but has no
* attributes, this method returns an empty Map.
* @throws Exception
*/
If a get(fqn) operation occurrs before a put and the node (directory) does not exist, FCL
returns
null when it should return an empty Map.
If the customer creates a custom cache loader which delegates to a FileCacheLoader, the
following misleading warning message is logged:
10:52:10.839 WARN [MessageListenerThread - Belvedere/Desk/CacheLoaderInterceptor]
CacheLoader.get(Fqn) returned a null; assuming the node nodes not exist.
10:52:10.839 WARN [MessageListenerThread - Belvedere/Desk/CacheLoaderInterceptor] The
CacheLoader interface has changed since JBossCache 1.3.x
10:52:10.839 WARN [MessageListenerThread - Belvedere/Desk/CacheLoaderInterceptor] Please
see
http://jira.jboss.com/jira/browse/JBCACHE-118
10:52:10.849 WARN [MessageListenerThread - Belvedere/Desk/CacheLoaderInterceptor]
CacheLoader.get() should return an empty Map if the node does exist but doesn't have
any attributes.
Update the case comment and title due to misunderstanding of the javadoc.
FileCacheLoader fullfills the javadoc, but in the special occasion of having a custom
cache loader that delegates on a org.jboss.cache CacheLoader, this WARN messages
would be log thinking that the newly create custom cache loader is breaking the contract.
Creating a custom cache loader which delegates to a standard cache
loader, can generate misleading WARN messages
----------------------------------------------------------------------------------------------------------------
Key: JBCACHE-777
URL:
http://jira.jboss.com/jira/browse/JBCACHE-777
Project: JBoss Cache
Issue Type: Bug
Security Level: Public(Everyone can see)
Affects Versions: 1.3.0.SP3, 1.4.0.SP1
Reporter: Galder Zamarreno
Assigned To: Galder Zamarreno
Priority: Minor
FileCacheLoader can return a null value for get(fqn) if the node does not exist.
/**
* Returns all keys and values from the persistent store, given a fully qualified
name.
*
* NOTE that the expected return value of this method has changed from JBossCache
1.2.x
* and before! This will affect cache loaders written prior to JBossCache 1.3.0 and
such
* implementations should be checked for compliance with the behaviour expected.
*
* @param name
* @return Map<Object,Object> keys and values for the given node. Returns
* null if the node is not found. If the node is found but has no
* attributes, this method returns an empty Map.
* @throws Exception
*/
If the customer creates a custom cache loader which delegates to a FileCacheLoader, the
following misleading warning message is logged:
10:52:10.839 WARN [MessageListenerThread - Belvedere/Desk/CacheLoaderInterceptor]
CacheLoader.get(Fqn) returned a null; assuming the node nodes not exist.
10:52:10.839 WARN [MessageListenerThread - Belvedere/Desk/CacheLoaderInterceptor] The
CacheLoader interface has changed since JBossCache 1.3.x
10:52:10.839 WARN [MessageListenerThread - Belvedere/Desk/CacheLoaderInterceptor] Please
see
http://jira.jboss.com/jira/browse/JBCACHE-118
10:52:10.849 WARN [MessageListenerThread - Belvedere/Desk/CacheLoaderInterceptor]
CacheLoader.get() should return an empty Map if the node does exist but doesn't have
any attributes.
This occurrs even though the FileCacheLoader is actually doing the job accordingly.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira