Package io.jenkins.plugins.util
Klasse BuildAction<T>
java.lang.Object
io.jenkins.plugins.util.BuildAction<T>
- Typparameter:
T
- type of the results
- Alle implementierten Schnittstellen:
Action
,ModelObject
,Serializable
,RunAction2
,SimpleBuildStep.LastBuildAction
public abstract class BuildAction<T>
extends Object
implements SimpleBuildStep.LastBuildAction, RunAction2, Serializable
Controls the life cycle of the results in a build. This action persists the results of a build and displays a summary
on the build page. The actual visualization of the results is defined in the matching
summary.jelly
file.
This action also provides access to the detail views: these are rendered using a new view instance.- Autor:
- Ullrich Hafner
- Siehe auch:
-
Konstruktorübersicht
ModifiziererKonstruktorBeschreibungprotected
BuildAction
(Run<?, ?> owner, T result) Creates a new instance ofBuildAction
.BuildAction
(Run<?, ?> owner, T result, boolean canSerialize) Creates a new instance ofBuildAction
. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungprotected abstract JobAction
<? extends BuildAction<T>> protected abstract AbstractXmlStream
<T> Creates the XML stream to read the results.static <T extends BuildAction<?>>
Optional<T> getBuildActionFromHistoryStartingFrom
(Run<?, ?> baseline, Class<T> buildActionClass) Returns aBuildAction
of the specified baseline build.protected abstract String
Run
<?, ?> getOwner()
Collection
<? extends Action> Returns the repository statistics.void
onAttached
(Run<?, ?> r) void
protected Object
Called after de-serialization to improve the memory usage.Von Klasse geerbte Methoden java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Von Schnittstelle geerbte Methoden hudson.model.Action
getDisplayName, getIconFileName, getUrlName
-
Konstruktordetails
-
BuildAction
Creates a new instance ofBuildAction
.- Parameter:
owner
- the associated build that created the resultresult
- the result to persist with this action
-
BuildAction
Creates a new instance ofBuildAction
.- Parameter:
owner
- the associated build that created the resultresult
- the result to persist with this actioncanSerialize
- determines whether the result should be persisted in the build folder
-
-
Methodendetails
-
createXmlStream
Creates the XML stream to read the results. This method is invoked by the constructor in thisBuildAction
so this instance is not yet fully initialized when this factory method is called. So just return the stream instance without accessing any fields.- Gibt zurück:
- the XML stream
-
getOwner
-
onAttached
- Angegeben von:
onAttached
in SchnittstelleRunAction2
-
onLoad
- Angegeben von:
onLoad
in SchnittstelleRunAction2
-
readResolve
Called after de-serialization to improve the memory usage.- Gibt zurück:
- this
-
getProjectActions
- Angegeben von:
getProjectActions
in SchnittstelleSimpleBuildStep.LastBuildAction
-
createProjectAction
-
getResult
Returns the repository statistics. Since the object requires some amount of memory, it is stored in aWeakReference
. So if the current instance has been destroyed by the garbage collector then a new instance will be automatically created by reading the persisted XML data from Jenkins build folder.- Gibt zurück:
- the statistics
-
getBuildResultBaseName
-
getBuildActionFromHistoryStartingFrom
public static <T extends BuildAction<?>> Optional<T> getBuildActionFromHistoryStartingFrom(@CheckForNull Run<?, ?> baseline, Class<T> buildActionClass) Returns aBuildAction
of the specified baseline build. If there is no such action for the baseline then the previous build is inspected, and so on. If no previous build contains aBuildAction
then an empty result is returned.- Typparameter:
T
- type of the results- Parameter:
baseline
- the baseline to start the search withbuildActionClass
- the type of the action to find- Gibt zurück:
- the next available
BuildAction
, or an empty result if there is no such action
-