hudson.init
Annotation Type Initializer


@Indexed
@Documented
@Retention(value=RUNTIME)
@Target(value=METHOD)
public @interface Initializer

Placed on static methods to indicate that this method is to be run during the Jenkins start up to perform some sort of initialization tasks.

Example

   @Initializer(after=JOB_LOADED)
   public static void init() throws IOException {
       ....
   }
 

Author:
Kohsuke Kawaguchi

Optional Element Summary
 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.
 

after

public abstract InitMilestone after
Indicates that the specified milestone is necessary before executing this initializer.

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.)

Default:
hudson.init.InitMilestone.STARTED

before

public abstract InitMilestone before
Indicates that this initializer is a necessary step before achieving the specified milestone.

This has the identical purpose as attains(). See after() for why there are two things to achieve the same goal.

Default:
hudson.init.InitMilestone.COMPLETED

requires

public abstract String[] requires
Indicates the milestones necessary before executing this initializer.

Default:
{}

attains

public abstract String[] attains
Indicates the milestones that this initializer contributes to. A milestone is considered attained if all the initializers that attains the given milestone completes. So it works as a kind of join.

Default:
{}

displayName

public abstract String displayName
Key in Messages.properties that represents what this task is about. Used for rendering the progress. Defaults to "${short class name}.${method Name}".

Default:
""

fatal

public abstract boolean fatal
Should the failure in this task prevent Hudson from starting up?

See Also:
Task.failureIsFatal()
Default:
true


Copyright © 2004-2013. All Rights Reserved.