@Indexed @Documented @Retention(value=RUNTIME) @Target(value=METHOD) public @interface Initializer
@Initializer(after=JOB_LOADED) public static void init() throws IOException { .... }
The method in question can be either static
or an instance method. When used with instance
methods, those methods have to be on a class annotated with Extension
and marked as
after()
InitMilestone.PLUGINS_PREPARED
.
Modifier and Type | Optional Element and Description |
---|---|
InitMilestone |
after
Indicates that the specified milestone is necessary before executing this initializer.
|
String[] |
attains
Indicates the milestones that this initializer contributes to.
|
InitMilestone |
before
Indicates that this initializer is a necessary step before achieving the specified milestone.
|
String |
displayName
Key in
Messages.properties that represents what this task is about. |
boolean |
fatal
Should the failure in this task prevent Hudson from starting up?
|
String[] |
requires
Indicates the milestones necessary before executing this initializer.
|
public abstract InitMilestone after
This has the identical purpose as requires()
, but it's separated to allow better type-safety
when using InitMilestone
as a requirement (since enum member definitions need to be constant).
public abstract InitMilestone before
This has the identical purpose as attains()
. See after()
for why there are two things
to achieve the same goal.
public abstract String[] requires
public abstract String[] attains
public abstract String displayName
Messages.properties
that represents what this task is about. Used for rendering the progress.
Defaults to "${short class name}.${method Name}".Copyright © 2004–2022. All rights reserved.