|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthudson.triggers.Trigger<J>
public abstract class Trigger<J extends Item>
Triggers a Build
.
To register a custom Trigger
from a plugin,
put Extension
on your TriggerDescriptor
class.
Nested Class Summary | |
---|---|
static class |
Trigger.Cron
Runs every minute to check TimerTrigger and schedules build. |
Nested classes/interfaces inherited from interface hudson.ExtensionPoint |
---|
ExtensionPoint.LegacyInstancesAreScopedToHudson |
Field Summary | |
---|---|
protected J |
job
|
protected String |
spec
|
protected CronTabList |
tabs
|
static Timer |
timer
This timer is available for all the components inside Hudson to schedule some work. |
Constructor Summary | |
---|---|
protected |
Trigger()
Creates a new Trigger without using cron. |
protected |
Trigger(String cronTabSpec)
Creates a new Trigger that gets run
periodically. |
Method Summary | |
---|---|
static DescriptorExtensionList<Trigger<?>,TriggerDescriptor> |
all()
Returns all the registered Trigger descriptors. |
static void |
checkTriggers(Calendar cal)
|
static List<TriggerDescriptor> |
for_(Item i)
Returns a subset of TriggerDescriptor s that applys to the given item. |
TriggerDescriptor |
getDescriptor()
Gets the descriptor for this instance. |
Action |
getProjectAction()
Deprecated. as of 1.341 Use getProjectActions() instead. |
Collection<? extends Action> |
getProjectActions()
Action s to be displayed in the job page. |
String |
getSpec()
Gets the crontab specification. |
static void |
init()
|
protected Object |
readResolve()
|
void |
run()
Executes the triggered task. |
void |
start(J project,
boolean newInstance)
Called when a Trigger is loaded into memory and started. |
void |
stop()
Called before a Trigger is removed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final String spec
protected transient CronTabList tabs
protected transient J extends Item job
@CheckForNull public static Timer timer
Jenkins
, but value kept here for compatibility.
If plugins want to run periodic jobs, they should implement PeriodicWork
.
Constructor Detail |
---|
protected Trigger(String cronTabSpec) throws antlr.ANTLRException
Trigger
that gets run
periodically. This is useful when your trigger does
some polling work.
antlr.ANTLRException
protected Trigger()
Trigger
without using cron.
Method Detail |
---|
public void start(J project, boolean newInstance)
Trigger
is loaded into memory and started.
project
- given so that the persisted form of this object won't have to have a back pointer.newInstance
- True if this may be a newly created trigger first attached to the Project
(generally if the project is being created or configured).
False if this is invoked for a Project
loaded from disk.public void run()
Trigger(String)
is used
to create an instance, and the crontab matches the current time.
public void stop()
Trigger
is removed.
Under some circumstances, this may be invoked more than once for
a given Trigger
, so be prepared for that.
When the configuration is changed for a project, all triggers are removed once and then added back.
public Action getProjectAction()
getProjectActions()
instead.
Trigger
has an action
to contribute to a Project
.
public Collection<? extends Action> getProjectActions()
Action
s to be displayed in the job page.
public TriggerDescriptor getDescriptor()
Describable
Descriptor
is a singleton for every concrete Describable
implementation, so if a.getClass()==b.getClass() then
a.getDescriptor()==b.getDescriptor() must hold.
getDescriptor
in interface Describable<Trigger<?>>
public final String getSpec()
protected Object readResolve() throws ObjectStreamException
ObjectStreamException
public static void checkTriggers(Calendar cal)
@Initializer(after=JOB_LOADED) public static void init()
public static DescriptorExtensionList<Trigger<?>,TriggerDescriptor> all()
Trigger
descriptors.
public static List<TriggerDescriptor> for_(Item i)
TriggerDescriptor
s that applys to the given item.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |