code: public void putListener(CallbackType callbackType, Method method) {
      if (callbacks == null) {
        callbacks = new EnumMap<>(CallbackType.class);
      }
      Method oldMethod = callbacks.put(callbackType, method);
      if (oldMethod != null) {
        String format = "Class %s has at least two methods, %s and %s, with annotation of %s. "
            + "At most one method is allowed for a given callback type. ";
        String message = String.format(format, listenerClass.getName(), oldMethod.getName(),
            method.getName(), callbackType.getAnnotationClass().getName());
        throw new EntityManagerException(message);
      }
    }
docs: Registers the given method as the callback method for the given event type.
  
  @param callbackType
  the callback type
  @param method
  the callback method
  @throws EntityManagerException
  if there was already a callback method for the given event type.