Class JenkinsAwareGerritHandler

java.lang.Object
com.sonymobile.tools.gerrit.gerritevents.GerritHandler
com.sonyericsson.hudson.plugins.gerrit.trigger.JenkinsAwareGerritHandler
All Implemented Interfaces:
com.sonymobile.tools.gerrit.gerritevents.Handler, com.sonymobile.tools.gerrit.gerritevents.workers.Coordinator

public class JenkinsAwareGerritHandler extends com.sonymobile.tools.gerrit.gerritevents.GerritHandler
Specialization of GerritHandler that supports gerrit event's lifecycle and takes care of custom EventThread creation.
Author:
Hugo Arès <hugo.ares@ericsson.com>
  • Constructor Summary

    Constructors
    Constructor
    Description
    JenkinsAwareGerritHandler(int numberOfWorkerThreads)
    Standard Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected com.sonymobile.tools.gerrit.gerritevents.workers.EventThread
    Here we override the EventThread creation with one that impersonates System.
    void
    notifyListeners(com.sonymobile.tools.gerrit.gerritevents.dto.GerritEvent event)
     

    Methods inherited from class com.sonymobile.tools.gerrit.gerritevents.GerritHandler

    addEventListeners, addEventListeners, addListener, getEventListenersCount, getGerritEventListenersView, getIgnoreEMail, getNumberOfWorkerThreads, getQueueSize, getThreadFactory, getThreadKeepAliveTime, getWhitelist, getWorkQueue, post, post, post, post, post, removeAllEventListeners, removeListener, scheduleGerritWhitelistRead, scheduleGerritWhitelistRead, setIgnoreEMail, setNumberOfWorkerThreads, setThreadKeepAliveTime, shutdown, startQueue, triggerEvent

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • JenkinsAwareGerritHandler

      public JenkinsAwareGerritHandler(int numberOfWorkerThreads)
      Standard Constructor.
      Parameters:
      numberOfWorkerThreads - the number of event threads.
  • Method Details

    • createEventThread

      protected com.sonymobile.tools.gerrit.gerritevents.workers.EventThread createEventThread(String threadName)
      Here we override the EventThread creation with one that impersonates System.
      Overrides:
      createEventThread in class com.sonymobile.tools.gerrit.gerritevents.GerritHandler
      Parameters:
      threadName - name of thread.
      Returns:
      new EventThread.
    • notifyListeners

      public void notifyListeners(com.sonymobile.tools.gerrit.gerritevents.dto.GerritEvent event)
      Specified by:
      notifyListeners in interface com.sonymobile.tools.gerrit.gerritevents.workers.Coordinator
      Overrides:
      notifyListeners in class com.sonymobile.tools.gerrit.gerritevents.GerritHandler