|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthudson.ivy.IvyReporter
public abstract class IvyReporter
Listens to the build execution of IvyBuild,
and normally records some information and exposes thoses
in IvyBuild later.
IvyReporter is first instanciated on the master.
Then during the build, it is serialized and sent over into
the Ant process by serialization. Reporters will then receive
event callbacks as Ant build events. Those event callbacks
are the ones that take IvyBuildProxy.
Once the Ant build completes normally or abnormally, the reporters
will be sent back to the master by serialization again, then
have its end(IvyBuild, Launcher, BuildListener) method invoked.
This is a good opportunity to perform the post-build action.
This is the IvyBuild equivalent of BuildStep. Instances
of IvyReporters are persisted with IvyModule/IvyModuleSet,
possibly with configuration specific to that job.
The callback methods are invoked in the following order:
SEQUENCE := preBuild MODULE* postBuild end MODULE := enterModule leaveModule
When an error happens, the call sequence could be terminated at any point and no further callback methods may be invoked.
IvyReporter can contribute
Action to IvyBuild so that the report can be displayed
in the web UI.
Such action can also implement AggregatableAction if it further
wishes to contribute a separate action to IvyModuleSetBuild.
This mechanism is usually used to provide aggregated report for all the
module builds.
IvyReporters,
Serialized Form| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface hudson.ExtensionPoint |
|---|
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson |
| Constructor Summary | |
|---|---|
IvyReporter()
|
|
| Method Summary | |
|---|---|
boolean |
end(IvyBuild build,
hudson.Launcher launcher,
hudson.model.BuildListener listener)
Called after the Ant/Ivy execution finished and the result is determined. |
boolean |
enterModule(IvyBuildProxy build,
org.apache.tools.ant.BuildEvent event,
hudson.model.BuildListener listener)
Called when the build enters a next IvyProject. |
hudson.model.Action |
getAggregatedProjectAction(IvyModuleSet project)
Works like getProjectAction(IvyModule) but
works at IvyModuleSet level. |
IvyReporterDescriptor |
getDescriptor()
|
hudson.model.Action |
getProjectAction(IvyModule module)
Equivalent of BuildStep.getProjectAction(AbstractProject)
for IvyReporter. |
boolean |
leaveModule(IvyBuildProxy build,
org.apache.tools.ant.BuildEvent event,
hudson.model.BuildListener listener)
Called when the build leaves the current IvyProject. |
boolean |
postBuild(IvyBuildProxy build,
org.apache.tools.ant.BuildEvent event,
hudson.model.BuildListener listener)
Called after a build of one Ivy module is completed. |
boolean |
preBuild(IvyBuildProxy build,
org.apache.tools.ant.BuildEvent event,
hudson.model.BuildListener listener)
Called before the actual ant execution begins. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public IvyReporter()
| Method Detail |
|---|
public boolean preBuild(IvyBuildProxy build,
org.apache.tools.ant.BuildEvent event,
hudson.model.BuildListener listener)
throws java.lang.InterruptedException,
java.io.IOException
moduleDescriptor - Represents the Ivy module to be executed.
java.lang.InterruptedException - If the build is interrupted by the user (in an attempt to abort the build.)
Normally the IvyReporter implementations may simply forward the exception
it got from its lower-level functions.
java.io.IOException - If the implementation wants to abort the processing when an IOException
happens, it can simply propagate the exception to the caller. This will cause
the build to fail, with the default error message.
Implementations are encouraged to catch IOException on its own to
provide a better error message, if it can do so, so that users have better
understanding on why it failed.
public boolean enterModule(IvyBuildProxy build,
org.apache.tools.ant.BuildEvent event,
hudson.model.BuildListener listener)
throws java.lang.InterruptedException,
java.io.IOException
IvyProject.
When the current build is a multi-module reactor build, every time the build moves on to the next module, this method will be invoked.
preBuild(hudson.ivy.IvyBuildProxy, org.apache.tools.ant.BuildEvent, hudson.model.BuildListener)
java.lang.InterruptedException - See preBuild(hudson.ivy.IvyBuildProxy, org.apache.tools.ant.BuildEvent, hudson.model.BuildListener)
java.io.IOException - See preBuild(hudson.ivy.IvyBuildProxy, org.apache.tools.ant.BuildEvent, hudson.model.BuildListener)
public boolean leaveModule(IvyBuildProxy build,
org.apache.tools.ant.BuildEvent event,
hudson.model.BuildListener listener)
throws java.lang.InterruptedException,
java.io.IOException
IvyProject.
java.lang.InterruptedException
java.io.IOExceptionenterModule(hudson.ivy.IvyBuildProxy, org.apache.tools.ant.BuildEvent, hudson.model.BuildListener)
public boolean postBuild(IvyBuildProxy build,
org.apache.tools.ant.BuildEvent event,
hudson.model.BuildListener listener)
throws java.lang.InterruptedException,
java.io.IOException
Note that at this point the build result is still not determined.
preBuild(hudson.ivy.IvyBuildProxy, org.apache.tools.ant.BuildEvent, hudson.model.BuildListener)
java.lang.InterruptedException - See preBuild(hudson.ivy.IvyBuildProxy, org.apache.tools.ant.BuildEvent, hudson.model.BuildListener)
java.io.IOException - See preBuild(hudson.ivy.IvyBuildProxy, org.apache.tools.ant.BuildEvent, hudson.model.BuildListener)
public boolean end(IvyBuild build,
hudson.Launcher launcher,
hudson.model.BuildListener listener)
throws java.lang.InterruptedException,
java.io.IOException
This method fires after #postBuild(IvyBuildProxy, ModuleDescriptor, BuildListener).
Works like BuildStepCompatibilityLayer.perform(Build, Launcher, BuildListener).
java.lang.InterruptedException
java.io.IOExceptionpublic hudson.model.Action getProjectAction(IvyModule module)
BuildStep.getProjectAction(AbstractProject)
for IvyReporter.
Registers a transient action to IvyModule when it's rendered.
This is useful if you'd like to display an action at the module level.
Since this contributes a transient action, the returned Action
will not be serialized.
For this method to be invoked, your IvyReporter has to invoke
IvyBuildProxy.registerAsProjectAction(IvyReporter) during the build.
public hudson.model.Action getAggregatedProjectAction(IvyModuleSet project)
getProjectAction(IvyModule) but
works at IvyModuleSet level.
For this method to be invoked, your IvyReporter has to invoke
IvyBuildProxy.registerAsAggregatedProjectAction(IvyReporter) during the build.
public IvyReporterDescriptor getDescriptor()
getDescriptor in interface hudson.model.Describable<IvyReporter>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||