|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthudson.model.listeners.SCMListener
public abstract class SCMListener
Receives notifications about SCM activities in Hudson.
This is an abstract class so that methods added in the future won't break existing listeners.
Once instanciated, use the register()
method to start receiving events.
Jenkins.getSCMListeners()
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface hudson.ExtensionPoint |
---|
ExtensionPoint.LegacyInstancesAreScopedToHudson |
Constructor Summary | |
---|---|
SCMListener()
|
Method Summary | |
---|---|
void |
onChangeLogParsed(AbstractBuild<?,?> build,
BuildListener listener,
ChangeLogSet<?> changelog)
Called once the changelog is determined. |
void |
register()
Registers this SCMListener so that it will start receiving events. |
boolean |
unregister()
Unregisters this SCMListener so that it will never receive further events. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SCMListener()
Method Detail |
---|
public void onChangeLogParsed(AbstractBuild<?,?> build, BuildListener listener, ChangeLogSet<?> changelog) throws Exception
During a build, Jenkins fetches the update of the workspace from SCM,
and determines the changelog (see SCM.checkout(hudson.model.AbstractBuild, ?>, hudson.Launcher, hudson.FilePath, hudson.model.BuildListener, java.io.File)
). Immediately
after that, a build will invoke this method on all registered
SCMListener
s.
If a build failed before we successfully determine changelog, this method will not be invoked (for example, if "cvs update" failed.) OTOH, this method is invoked before the actual build (like ant invocation) happens.
This is an opportunity for SCM-related plugins to act on changelog.
A typical usage includes parsing commit messages and do cross-referencing
between other systems. Implementations can also contribute Action
to AbstractBuild
(by build.getActions().add(...)
to
display additional data on build views.
TODO: once we have cvsnews plugin, refer to its usage.
build
- The build in progress, which just finished determining changelog.
At this point this build is still in progress. Never null.listener
- BuildListener
for on-going build. This can be used to report
any errors or the general logging of what's going on. This will show
up in the "console output" of the build. Never null.changelog
- Set of changes detected in this build. This is the same value
returned from AbstractBuild.getChangeSet()
but passed
separately for convenience.
Exception
- If any exception is thrown from this method, it will be recorded
and causes the build to fail.public final void register()
SCMListener
so that it will start receiving events.
public final boolean unregister()
SCMListener
so that it will never receive further events.
Unless SCMListener
is unregistered, it will never be a subject of GC.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |