Class ReflectiveWorkOnChange
java.lang.Object
org.broadleafcommerce.common.util.ReflectiveWorkOnChange
- All Implemented Interfaces:
WorkOnChange
This WorkOnChange implementation is for a narrow case where the work to be done is simply calling a method on a target object
and passing to that method the changed collection. Of course, there must be a method with the correct signature on
the target object. This implementation also uses caching to optimize repeat searches for the same method and minimize
reflection time.
- Author:
- Jeff Fischer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
doWork
(Collection changed) An implementation of this method will be called whenever a change is detected on a change aware collection.protected Method
searchForMethod
(Class<?> targetClass, Object test)
-
Constructor Details
-
ReflectiveWorkOnChange
-
-
Method Details
-
doWork
Description copied from interface:WorkOnChange
An implementation of this method will be called whenever a change is detected on a change aware collection. The implementation should contain whatever code is necessary to respond to the collection change.- Specified by:
doWork
in interfaceWorkOnChange
- Parameters:
changed
- the un-proxied collection that was modified
-
searchForMethod
-