gerrit-events/src/main/java/com/sonyericsson/hudson/plugins/gerrit/gerritevents/dto/events/lifecycle/GerritEventLifecycle.java
/**
     * Fires an event with the help of a visitor.
     * It iterates through all the listeners, and for each listener asks the visitor to do stuff.
     * @param visitor the visitor that calls the correct method.
     */
Fires an event with the help of a visitor.
It iterates through all the listeners, and for each listener asks the visitor to do stuff.
@param visitor the visitor that calls the correct method.
Fires an event with the help of a visitor . It iterates through all the listeners and for each listener asks the visitor to do stuff . @param visitor the visitor that calls the correct method .
private synchronized void fireEvent(ListenerVisitor visitor) {
        if (listeners != null) {
            PatchsetCreated event = null;
            if (this instanceof PatchsetCreated) {
                event = (PatchsetCreated)this;
            }
            List<GerritEventLifecycleListener> list = getListeners();
            for (GerritEventLifecycleListener listener : list) {
                visitor.visit(listener, event);
            }
        }
    }
private synchronized void fireEvent ( ListenerVisitor visitor ) { if ( listeners != null ) { PatchsetCreated event = null ; if ( this instanceof PatchsetCreated ) { event = ( PatchsetCreated ) this ; } List < GerritEventLifecycleListener > list = getListeners ( ) ; for ( GerritEventLifecycleListener listener : list ) { visitor . visit ( listener , event ) ; } } }
Fires an event with the help of a visitor.
Fires an event with the help of a visitor .
//Get a cloned list so we don't risk modifying it on the same thread.