code: private void validateExternalCallback(Method method, CallbackType callbackType) {
      Class<?>[] parameters = method.getParameterTypes();
      if (!parameters[0].isAssignableFrom(entityClass)) {
        String message = String.format("Method %s in class %s is not valid for entity %s",
            method.getName(), method.getDeclaringClass().getName(), entityClass.getName());
        throw new EntityManagerException(message);
      }
      CallbackMetadata callbackMetadata = new CallbackMetadata(EntityListenerType.EXTERNAL,
          callbackType, method);
      metadata.put(callbackType, callbackMetadata);
    }
docs: Validates and registers the given callback method.
  
  @param method
  the callback method
  @param callbackType
  the callback type