public void fireEventListeners(EntityMetadata metadata, Object entity, Class<?> event)
    {

        // handle external listeners first
        List<? extends CallbackMethod> callBackMethods = metadata.getCallbackMethods(event);

        if (null != callBackMethods && !callBackMethods.isEmpty() && null != entity)
        {
            log.debug("Callback >> " + event.getSimpleName() + " on " + metadata.getEntityClazz().getName());
            for (CallbackMethod callback : callBackMethods)
            {
                log.debug("Firing >> " + callback);

                callback.invoke(entity);

            }
        }
    }
public void fireEventListeners ( EntityMetadata metadata , Object entity , Class < ? > event ) { List < ? extends CallbackMethod > callBackMethods = metadata . getCallbackMethods ( event ) ; if ( null != callBackMethods && ! callBackMethods . isEmpty ( ) && null != entity ) { log . debug ( "Callback >> " + event . getSimpleName ( ) + " on " + metadata . getEntityClazz ( ) . getName ( ) ) ; for ( CallbackMethod callback : callBackMethods ) { log . debug ( "Firing >> " + callback ) ; callback . invoke ( entity ) ; } } }
Fire event listeners.

@param metadata
the metadata
@param entity
the entity
@param event
the event
@throws PersistenceException
the persistence exception