Package org.springframework.cglib.proxy
Interface CallbackFilter
- All Known Implementing Classes:
CallbackHelper
public interface CallbackFilter
Map methods of subclasses generated by
Enhancer to a particular
callback. The type of the callbacks chosen for each method affects
the bytecode generated for that method in the subclass, and cannot
change for the life of the class.
Note: CallbackFilter implementations are supposed to be
lightweight as cglib might keep CallbackFilter objects
alive to enable caching of generated classes. Prefer using static
classes for implementation of CallbackFilter.
-
Method Summary
Modifier and TypeMethodDescriptionintMap a method to a callback.booleanTheCallbackFilterin use affects which cached class theEnhancerwill use, so this is a reminder that you should correctly implementequalsandhashCodefor customCallbackFilterimplementations in order to improve performance.
-
Method Details
-
accept
Map a method to a callback.- Parameters:
method- the intercepted method- Returns:
- the index into the array of callbacks (as specified by
Enhancer.setCallbacks(org.springframework.cglib.proxy.Callback[])) to use for the method,
-
equals
TheCallbackFilterin use affects which cached class theEnhancerwill use, so this is a reminder that you should correctly implementequalsandhashCodefor customCallbackFilterimplementations in order to improve performance.
-