private static void invokeCallbackMethod(Method callbackMethod, Object listener, Object entity) {
    try {
      callbackMethod.invoke(listener, entity);
    } catch (Exception exp) {
      String message = String.format("Failed to execute callback method %s of class %s",
          callbackMethod.getName(), callbackMethod.getDeclaringClass().getName());
      throw new EntityManagerException(message, exp);
    }

  }
private static void invokeCallbackMethod ( Method callbackMethod , Object listener , Object entity ) { try { callbackMethod . invoke ( listener , entity ) ; } catch ( Exception exp ) { String message = String . format ( "Failed to execute callback method %s of class %s" , callbackMethod . getName ( ) , callbackMethod . getDeclaringClass ( ) . getName ( ) ) ; throw new EntityManagerException ( message , exp ) ; } }
Invokes the given callback method on the given target object.

@param callbackMethod
the callback method
@param listener
the listener object on which to invoke the method
@param entity
the entity for which the callback is being invoked.