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 -
Method Summary
Modifier and TypeMethodDescriptionprotected com.sonymobile.tools.gerrit.gerritevents.workers.EventThreadcreateEventThread(String threadName) Here we override the EventThread creation with one that impersonates System.voidnotifyListeners(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
-
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:
createEventThreadin classcom.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:
notifyListenersin interfacecom.sonymobile.tools.gerrit.gerritevents.workers.Coordinator- Overrides:
notifyListenersin classcom.sonymobile.tools.gerrit.gerritevents.GerritHandler
-