You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Aaron Zeckoski (JIRA)" <ji...@apache.org> on 2008/05/05 12:04:55 UTC
[jira] Created: (BEANUTILS-312) Expose the caches in
PropertyBeanUtils so they can be controlled if needed
Expose the caches in PropertyBeanUtils so they can be controlled if needed
--------------------------------------------------------------------------
Key: BEANUTILS-312
URL: https://issues.apache.org/jira/browse/BEANUTILS-312
Project: Commons BeanUtils
Issue Type: Improvement
Components: Bean / Property Utils
Affects Versions: 1.8.0-BETA
Reporter: Aaron Zeckoski
Fix For: 1.8.0
Attachments: beanutils-add-cache-setters-getters-remove-fasthashmap.patch
We have an extension to commons beanutils which allows us to make it
work with public fields as well (and a few other improvements we
needed like deep cloning). In 1.8.0-BETA it is easier to handle this
extension (thanks!) but it could be even easier if there was a way to
get and set the caches which are used for storing the
PropertyDescriptors. Just switching the type from FastHashMap to Map
and making a setter and getter which are publicly visible would be
enough to reduce our the work in extending this significantly.
The attached patch exposes the caches in PropertyBeanUtils and sets them to be Map instead of FastHashMap. This also involves a change to PropertyUtils (also changing FastHashMap to Map). The patch is fairly small and was built again the trunk.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (BEANUTILS-312) Expose the caches in
PropertyBeanUtils so they can be controlled if needed
Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BEANUTILS-312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12594865#action_12594865 ]
Niall Pemberton commented on BEANUTILS-312:
-------------------------------------------
I will review this properly when I get time - but from a quick peek the problem for 1.8.0 is going to be the API changes - since we're aiming for binary compatibility with BeanUtils 1.7.0 for the next release
> Expose the caches in PropertyBeanUtils so they can be controlled if needed
> --------------------------------------------------------------------------
>
> Key: BEANUTILS-312
> URL: https://issues.apache.org/jira/browse/BEANUTILS-312
> Project: Commons BeanUtils
> Issue Type: Improvement
> Components: Bean / Property Utils
> Affects Versions: 1.8.0-BETA
> Reporter: Aaron Zeckoski
> Fix For: 1.8.0
>
> Attachments: beanutils-add-cache-setters-getters-remove-fasthashmap.patch
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> We have an extension to commons beanutils which allows us to make it
> work with public fields as well (and a few other improvements we
> needed like deep cloning). In 1.8.0-BETA it is easier to handle this
> extension (thanks!) but it could be even easier if there was a way to
> get and set the caches which are used for storing the
> PropertyDescriptors. Just switching the type from FastHashMap to Map
> and making a setter and getter which are publicly visible would be
> enough to reduce our the work in extending this significantly.
> The attached patch exposes the caches in PropertyBeanUtils and sets them to be Map instead of FastHashMap. This also involves a change to PropertyUtils (also changing FastHashMap to Map). The patch is fairly small and was built again the trunk.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (BEANUTILS-312) Expose the caches in
PropertyBeanUtils so they can be controlled if needed
Posted by "Paul Benedict (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BEANUTILS-312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12603143#action_12603143 ]
Paul Benedict commented on BEANUTILS-312:
-----------------------------------------
Yes. An interface will allow extensibility without sacrificing internal changes.
> Expose the caches in PropertyBeanUtils so they can be controlled if needed
> --------------------------------------------------------------------------
>
> Key: BEANUTILS-312
> URL: https://issues.apache.org/jira/browse/BEANUTILS-312
> Project: Commons BeanUtils
> Issue Type: Improvement
> Components: Bean / Property Utils
> Affects Versions: 1.8.0-BETA
> Reporter: Aaron Zeckoski
> Fix For: 1.8.0
>
> Attachments: beanutils-add-cache-setters-getters-remove-fasthashmap.patch
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> We have an extension to commons beanutils which allows us to make it
> work with public fields as well (and a few other improvements we
> needed like deep cloning). In 1.8.0-BETA it is easier to handle this
> extension (thanks!) but it could be even easier if there was a way to
> get and set the caches which are used for storing the
> PropertyDescriptors. Just switching the type from FastHashMap to Map
> and making a setter and getter which are publicly visible would be
> enough to reduce our the work in extending this significantly.
> The attached patch exposes the caches in PropertyBeanUtils and sets them to be Map instead of FastHashMap. This also involves a change to PropertyUtils (also changing FastHashMap to Map). The patch is fairly small and was built again the trunk.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (BEANUTILS-312) Expose the caches in
PropertyBeanUtils so they can be controlled if needed
Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BEANUTILS-312?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Niall Pemberton updated BEANUTILS-312:
--------------------------------------
Fix Version/s: (was: 1.8.0)
LATER THAN 1.8.0
> Expose the caches in PropertyBeanUtils so they can be controlled if needed
> --------------------------------------------------------------------------
>
> Key: BEANUTILS-312
> URL: https://issues.apache.org/jira/browse/BEANUTILS-312
> Project: Commons BeanUtils
> Issue Type: Improvement
> Components: Bean / Property Utils
> Affects Versions: 1.8.0-BETA
> Reporter: Aaron Zeckoski
> Fix For: LATER THAN 1.8.0
>
> Attachments: beanutils-add-cache-setters-getters-remove-fasthashmap.patch
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> We have an extension to commons beanutils which allows us to make it
> work with public fields as well (and a few other improvements we
> needed like deep cloning). In 1.8.0-BETA it is easier to handle this
> extension (thanks!) but it could be even easier if there was a way to
> get and set the caches which are used for storing the
> PropertyDescriptors. Just switching the type from FastHashMap to Map
> and making a setter and getter which are publicly visible would be
> enough to reduce our the work in extending this significantly.
> The attached patch exposes the caches in PropertyBeanUtils and sets them to be Map instead of FastHashMap. This also involves a change to PropertyUtils (also changing FastHashMap to Map). The patch is fairly small and was built again the trunk.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (BEANUTILS-312) Expose the caches in
PropertyBeanUtils so they can be controlled if needed
Posted by "Aaron Zeckoski (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BEANUTILS-312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12594889#action_12594889 ]
Aaron Zeckoski commented on BEANUTILS-312:
------------------------------------------
Ah, I did not realize binary compatibility was a requirement...
I can only see one way to handle that and that is create a FastHashMap at the points where a FastHashMap is required doing something like:
if (! (existingMap instanceof FastHashMap)) {
existingMap = new FastHashMap(existingMap);
}
That is pseudo coded but you get the idea. This would also incur very little overhead (just the check) if the legacy FastHashMap is being used but would still allow for putting in and getting out whatever map or caching object (that implements Map) that you like.
If this is acceptable then I will recode the patch. If not, please suggest an alternative and I will recode the patch.
> Expose the caches in PropertyBeanUtils so they can be controlled if needed
> --------------------------------------------------------------------------
>
> Key: BEANUTILS-312
> URL: https://issues.apache.org/jira/browse/BEANUTILS-312
> Project: Commons BeanUtils
> Issue Type: Improvement
> Components: Bean / Property Utils
> Affects Versions: 1.8.0-BETA
> Reporter: Aaron Zeckoski
> Fix For: 1.8.0
>
> Attachments: beanutils-add-cache-setters-getters-remove-fasthashmap.patch
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> We have an extension to commons beanutils which allows us to make it
> work with public fields as well (and a few other improvements we
> needed like deep cloning). In 1.8.0-BETA it is easier to handle this
> extension (thanks!) but it could be even easier if there was a way to
> get and set the caches which are used for storing the
> PropertyDescriptors. Just switching the type from FastHashMap to Map
> and making a setter and getter which are publicly visible would be
> enough to reduce our the work in extending this significantly.
> The attached patch exposes the caches in PropertyBeanUtils and sets them to be Map instead of FastHashMap. This also involves a change to PropertyUtils (also changing FastHashMap to Map). The patch is fairly small and was built again the trunk.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (BEANUTILS-312) Expose the caches in
PropertyBeanUtils so they can be controlled if needed
Posted by "Aaron Zeckoski (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BEANUTILS-312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12602623#action_12602623 ]
Aaron Zeckoski commented on BEANUTILS-312:
------------------------------------------
I have done this in the past with an API like this one:
{code}
public interface CacheProvider {
/**
* Create a cache by the given name (or if the cache already exists then reset it),
* the cache will be used to cache one type of persistent objects,
* the cache only needs to exist in your implementation as it will be accessed using the given name
* @param cacheName a string which uniquely identifies this cache
* @throws IllegalArgumentException if the cache name is invalid
* @throws IllegalStateException if the cache cannot be created
*/
public void createCache(String cacheName);
/**
* Puts an object in the specified cache
* @param cacheName a string which uniquely identifies this cache
* @param key the key for a persistent object (this will be the persistent id)
* @param value a persistent object (this can be a null to cache a miss)
* @throws IllegalArgumentException if the cache name is invalid or cacheName or key is null
*/
public void put(String cacheName, String key, Object value);
/**
* Gets an object from the cache if it can be found (maybe be a null),
* use the exists check to see if the object is in the cache before retrieving
* @param cacheName a string which uniquely identifies this cache
* @param key the key for a persistent object (this will be the persistent id)
* @return the cached persistent object (may be null)
* @throws IllegalArgumentException if the cache name is invalid or any arguments are null
* @throws CacheKeyNotFoundException if this key does not exist in the cache
*/
public Object get(String cacheName, String key);
/**
* Removes an object from the cache if it exists or does nothing
* @param cacheName a string which uniquely identifies this cache
* @param key the key for a persistent object (this will be the persistent id)
* @return true if the object was removed or false if it could not be found in the cache
* @throws IllegalArgumentException if the cache name is invalid or any arguments are null
*/
public boolean remove(String cacheName, String key);
/**
* Check if a key exists in the cache and return true if it does
* @param cacheName a string which uniquely identifies this cache
* @param key the key for a persistent object (this will be the persistent id)
* @return true if the object was removed or false if it could not be found in the cache
* @throws IllegalArgumentException if the cache name is invalid or any arguments are null
*/
public boolean exists(String cacheName, String key);
/**
* Clear out all cached items from this cache
* @param cacheName a string which uniquely identifies this cache
* @throws IllegalArgumentException if the cache name is invalid
*/
public void clear(String cacheName);
}
{code}
Is that what you were thinking of?
> Expose the caches in PropertyBeanUtils so they can be controlled if needed
> --------------------------------------------------------------------------
>
> Key: BEANUTILS-312
> URL: https://issues.apache.org/jira/browse/BEANUTILS-312
> Project: Commons BeanUtils
> Issue Type: Improvement
> Components: Bean / Property Utils
> Affects Versions: 1.8.0-BETA
> Reporter: Aaron Zeckoski
> Fix For: 1.8.0
>
> Attachments: beanutils-add-cache-setters-getters-remove-fasthashmap.patch
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> We have an extension to commons beanutils which allows us to make it
> work with public fields as well (and a few other improvements we
> needed like deep cloning). In 1.8.0-BETA it is easier to handle this
> extension (thanks!) but it could be even easier if there was a way to
> get and set the caches which are used for storing the
> PropertyDescriptors. Just switching the type from FastHashMap to Map
> and making a setter and getter which are publicly visible would be
> enough to reduce our the work in extending this significantly.
> The attached patch exposes the caches in PropertyBeanUtils and sets them to be Map instead of FastHashMap. This also involves a change to PropertyUtils (also changing FastHashMap to Map). The patch is fairly small and was built again the trunk.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (BEANUTILS-312) Expose the caches in
PropertyBeanUtils so they can be controlled if needed
Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BEANUTILS-312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12594866#action_12594866 ]
Niall Pemberton commented on BEANUTILS-312:
-------------------------------------------
I will review this properly but from a quick peek, the API changes will prevent this from being included in BeanUtils 1.8.0 since were aiming for binary compatibility with BeanUtils 1.7.0 for that release.
> Expose the caches in PropertyBeanUtils so they can be controlled if needed
> --------------------------------------------------------------------------
>
> Key: BEANUTILS-312
> URL: https://issues.apache.org/jira/browse/BEANUTILS-312
> Project: Commons BeanUtils
> Issue Type: Improvement
> Components: Bean / Property Utils
> Affects Versions: 1.8.0-BETA
> Reporter: Aaron Zeckoski
> Fix For: 1.8.0
>
> Attachments: beanutils-add-cache-setters-getters-remove-fasthashmap.patch
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> We have an extension to commons beanutils which allows us to make it
> work with public fields as well (and a few other improvements we
> needed like deep cloning). In 1.8.0-BETA it is easier to handle this
> extension (thanks!) but it could be even easier if there was a way to
> get and set the caches which are used for storing the
> PropertyDescriptors. Just switching the type from FastHashMap to Map
> and making a setter and getter which are publicly visible would be
> enough to reduce our the work in extending this significantly.
> The attached patch exposes the caches in PropertyBeanUtils and sets them to be Map instead of FastHashMap. This also involves a change to PropertyUtils (also changing FastHashMap to Map). The patch is fairly small and was built again the trunk.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Issue Comment Edited: (BEANUTILS-312) Expose the caches in
PropertyBeanUtils so they can be controlled if needed
Posted by "Paul Benedict (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BEANUTILS-312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12603143#action_12603143 ]
paul4christ79 edited comment on BEANUTILS-312 at 6/6/08 12:14 PM:
------------------------------------------------------------------
Yes. An interface will allow extensibility without sacrificing backwards changes.
was (Author: paul4christ79):
Yes. An interface will allow extensibility without sacrificing internal changes.
> Expose the caches in PropertyBeanUtils so they can be controlled if needed
> --------------------------------------------------------------------------
>
> Key: BEANUTILS-312
> URL: https://issues.apache.org/jira/browse/BEANUTILS-312
> Project: Commons BeanUtils
> Issue Type: Improvement
> Components: Bean / Property Utils
> Affects Versions: 1.8.0-BETA
> Reporter: Aaron Zeckoski
> Fix For: 1.8.0
>
> Attachments: beanutils-add-cache-setters-getters-remove-fasthashmap.patch
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> We have an extension to commons beanutils which allows us to make it
> work with public fields as well (and a few other improvements we
> needed like deep cloning). In 1.8.0-BETA it is easier to handle this
> extension (thanks!) but it could be even easier if there was a way to
> get and set the caches which are used for storing the
> PropertyDescriptors. Just switching the type from FastHashMap to Map
> and making a setter and getter which are publicly visible would be
> enough to reduce our the work in extending this significantly.
> The attached patch exposes the caches in PropertyBeanUtils and sets them to be Map instead of FastHashMap. This also involves a change to PropertyUtils (also changing FastHashMap to Map). The patch is fairly small and was built again the trunk.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (BEANUTILS-312) Expose the caches in
PropertyBeanUtils so they can be controlled if needed
Posted by "Aaron Zeckoski (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BEANUTILS-312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12595491#action_12595491 ]
Aaron Zeckoski commented on BEANUTILS-312:
------------------------------------------
I know you guys are busy but the reality is that we all are. I am just looking for a response here so I can recode the patch. If someone can take 5 minutes to reply to this it would be great. Thanks
> Expose the caches in PropertyBeanUtils so they can be controlled if needed
> --------------------------------------------------------------------------
>
> Key: BEANUTILS-312
> URL: https://issues.apache.org/jira/browse/BEANUTILS-312
> Project: Commons BeanUtils
> Issue Type: Improvement
> Components: Bean / Property Utils
> Affects Versions: 1.8.0-BETA
> Reporter: Aaron Zeckoski
> Fix For: 1.8.0
>
> Attachments: beanutils-add-cache-setters-getters-remove-fasthashmap.patch
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> We have an extension to commons beanutils which allows us to make it
> work with public fields as well (and a few other improvements we
> needed like deep cloning). In 1.8.0-BETA it is easier to handle this
> extension (thanks!) but it could be even easier if there was a way to
> get and set the caches which are used for storing the
> PropertyDescriptors. Just switching the type from FastHashMap to Map
> and making a setter and getter which are publicly visible would be
> enough to reduce our the work in extending this significantly.
> The attached patch exposes the caches in PropertyBeanUtils and sets them to be Map instead of FastHashMap. This also involves a change to PropertyUtils (also changing FastHashMap to Map). The patch is fairly small and was built again the trunk.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (BEANUTILS-312) Expose the caches in
PropertyBeanUtils so they can be controlled if needed
Posted by "Paul Benedict (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BEANUTILS-312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12602558#action_12602558 ]
Paul Benedict commented on BEANUTILS-312:
-----------------------------------------
Niall, did you consider exposing the caching functionality via an interface?
> Expose the caches in PropertyBeanUtils so they can be controlled if needed
> --------------------------------------------------------------------------
>
> Key: BEANUTILS-312
> URL: https://issues.apache.org/jira/browse/BEANUTILS-312
> Project: Commons BeanUtils
> Issue Type: Improvement
> Components: Bean / Property Utils
> Affects Versions: 1.8.0-BETA
> Reporter: Aaron Zeckoski
> Fix For: 1.8.0
>
> Attachments: beanutils-add-cache-setters-getters-remove-fasthashmap.patch
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> We have an extension to commons beanutils which allows us to make it
> work with public fields as well (and a few other improvements we
> needed like deep cloning). In 1.8.0-BETA it is easier to handle this
> extension (thanks!) but it could be even easier if there was a way to
> get and set the caches which are used for storing the
> PropertyDescriptors. Just switching the type from FastHashMap to Map
> and making a setter and getter which are publicly visible would be
> enough to reduce our the work in extending this significantly.
> The attached patch exposes the caches in PropertyBeanUtils and sets them to be Map instead of FastHashMap. This also involves a change to PropertyUtils (also changing FastHashMap to Map). The patch is fairly small and was built again the trunk.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (BEANUTILS-312) Expose the caches in
PropertyBeanUtils so they can be controlled if needed
Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BEANUTILS-312?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Niall Pemberton updated BEANUTILS-312:
--------------------------------------
Comment: was deleted
> Expose the caches in PropertyBeanUtils so they can be controlled if needed
> --------------------------------------------------------------------------
>
> Key: BEANUTILS-312
> URL: https://issues.apache.org/jira/browse/BEANUTILS-312
> Project: Commons BeanUtils
> Issue Type: Improvement
> Components: Bean / Property Utils
> Affects Versions: 1.8.0-BETA
> Reporter: Aaron Zeckoski
> Fix For: 1.8.0
>
> Attachments: beanutils-add-cache-setters-getters-remove-fasthashmap.patch
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> We have an extension to commons beanutils which allows us to make it
> work with public fields as well (and a few other improvements we
> needed like deep cloning). In 1.8.0-BETA it is easier to handle this
> extension (thanks!) but it could be even easier if there was a way to
> get and set the caches which are used for storing the
> PropertyDescriptors. Just switching the type from FastHashMap to Map
> and making a setter and getter which are publicly visible would be
> enough to reduce our the work in extending this significantly.
> The attached patch exposes the caches in PropertyBeanUtils and sets them to be Map instead of FastHashMap. This also involves a change to PropertyUtils (also changing FastHashMap to Map). The patch is fairly small and was built again the trunk.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (BEANUTILS-312) Expose the caches in
PropertyBeanUtils so they can be controlled if needed
Posted by "Aaron Zeckoski (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BEANUTILS-312?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Aaron Zeckoski updated BEANUTILS-312:
-------------------------------------
Attachment: beanutils-add-cache-setters-getters-remove-fasthashmap.patch
> Expose the caches in PropertyBeanUtils so they can be controlled if needed
> --------------------------------------------------------------------------
>
> Key: BEANUTILS-312
> URL: https://issues.apache.org/jira/browse/BEANUTILS-312
> Project: Commons BeanUtils
> Issue Type: Improvement
> Components: Bean / Property Utils
> Affects Versions: 1.8.0-BETA
> Reporter: Aaron Zeckoski
> Fix For: 1.8.0
>
> Attachments: beanutils-add-cache-setters-getters-remove-fasthashmap.patch
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> We have an extension to commons beanutils which allows us to make it
> work with public fields as well (and a few other improvements we
> needed like deep cloning). In 1.8.0-BETA it is easier to handle this
> extension (thanks!) but it could be even easier if there was a way to
> get and set the caches which are used for storing the
> PropertyDescriptors. Just switching the type from FastHashMap to Map
> and making a setter and getter which are publicly visible would be
> enough to reduce our the work in extending this significantly.
> The attached patch exposes the caches in PropertyBeanUtils and sets them to be Map instead of FastHashMap. This also involves a change to PropertyUtils (also changing FastHashMap to Map). The patch is fairly small and was built again the trunk.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.