com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger
Class GerritItemListener
java.lang.Object
hudson.model.listeners.ItemListener
com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritItemListener
- All Implemented Interfaces:
- hudson.ExtensionPoint
@Extension
public class GerritItemListener
- extends hudson.model.listeners.ItemListener
Listens for onDeleted and onLoaded events.
If the deleted project has a Gerrit trigger, it will be stopped
If all project have been loaded, start the connections to Gerrit servers.
Since this class has no member variables, and doesn't need any
initialization, there is no constructor.
- Author:
- Fredrik Abrahamson <fredrik.abrahamson@sonymobile.com>
Nested classes/interfaces inherited from interface hudson.ExtensionPoint |
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson |
Method Summary |
void |
onDeleted(hudson.model.Item item)
Called by Jenkins when an item is about to be deleted. |
void |
onLoaded()
Called by Jenkins when all items are loaded. |
Methods inherited from class hudson.model.listeners.ItemListener |
all, fireOnCopied, fireOnCreated, fireOnUpdated, onBeforeShutdown, onCopied, onCreated, onRenamed, onUpdated, register |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GerritItemListener
public GerritItemListener()
onDeleted
public void onDeleted(hudson.model.Item item)
- Called by Jenkins when an item is about to be deleted. If this item is a project
(AbstractProject or any of its subclasses), then we check if it has a GerritTrigger
among its triggers. If so, call the trigger's stop() method.
This class is unfortunately needed because Jenkins doesn't call Trigger.stop() when
a project is deleted, only when a project is reconfigured. Thus we need this class
to remove the listener and cancel the timer when a project is deleted.
- Overrides:
onDeleted
in class hudson.model.listeners.ItemListener
- Parameters:
item
- the item that will be deleted, it is interesting if it is
a subclass of an AbstractProject
onLoaded
public void onLoaded()
- Called by Jenkins when all items are loaded.
- Overrides:
onLoaded
in class hudson.model.listeners.ItemListener
Copyright © 2004-2014. All Rights Reserved.