[hibernate-dev] CGLIB proxy policy

Shahiduzzaman shahid21st at gmail.com
Wed May 21 23:49:10 EDT 2008


In the CGLIBLazyInitializer class callbacks are created for the proxy
class. Two callback types are registered - InvocationHandler.class,
NoOp.class. And the callback filter is setup in the following way -


   private static final CallbackFilter FINALIZE_FILTER = new CallbackFilter() {
      public int accept(Method method) {
         if ( method.getParameterTypes().length == 0 &&
method.getName().equals("finalize") ){
            return 1;
         }
         else {
            return 0;
         }
      }
   };


This is not clear to me. Why the NoOp type callback is needed and its
selection from the callback filter? If anyone knows please give some
hint (or explanation).

Thanks.

Shahid

N.B. - First I post this to hibernate forum, later I realize that its
a more development related question, so re-posting here.



More information about the hibernate-dev mailing list