hudson.matrix
Class MatrixConfiguration

java.lang.Object
  extended by hudson.model.AbstractModelObject
      extended by hudson.model.Actionable
          extended by hudson.model.AbstractItem
              extended by hudson.model.Job<P,R>
                  extended by hudson.model.AbstractProject<P,B>
                      extended by hudson.model.Project<MatrixConfiguration,MatrixRun>
                          extended by hudson.matrix.MatrixConfiguration
All Implemented Interfaces:
ExtensionPoint, BuildableItem, BuildableItemWithBuildWrappers, DescriptorByNameOwner, Item, ModelObject, PersistenceRoot, Queue.NonBlockingTask, SubTask, Queue.Task, ResourceActivity, Saveable, SCMedItem, SearchableModelObject, SearchItem, AccessControlled, Maven.ProjectWithMaven, ModelObjectWithContextMenu, OnMaster, org.kohsuke.stapler.HttpDeletable, org.kohsuke.stapler.StaplerOverridable

public class MatrixConfiguration
extends Project<MatrixConfiguration,MatrixRun>
implements SCMedItem, Queue.NonBlockingTask

One configuration of MatrixProject.

Author:
Kohsuke Kawaguchi

Nested Class Summary
static class MatrixConfiguration.ParentBuildAction
           
 
Nested classes/interfaces inherited from class hudson.model.AbstractProject
AbstractProject.AbstractProjectDescriptor, AbstractProject.BecauseOfBuildInProgress, AbstractProject.BecauseOfDownstreamBuildInProgress, AbstractProject.BecauseOfUpstreamBuildInProgress
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Nested classes/interfaces inherited from interface jenkins.model.ModelObjectWithContextMenu
ModelObjectWithContextMenu.ContextMenu, ModelObjectWithContextMenu.MenuItem
 
Field Summary
static boolean useShortWorkspaceName
          On Cygwin, path names cannot be longer than 256 chars.
 
Fields inherited from class hudson.model.AbstractProject
ABORT, blockBuildWhenDownstreamBuilding, blockBuildWhenUpstreamBuilding, BUILD_NOW_TEXT, builds, disabled, transientActions, triggers
 
Fields inherited from class hudson.model.Job
HISTORY_ADAPTER, nextBuildNumber, properties
 
Fields inherited from class hudson.model.AbstractItem
description, displayName, name, PRONOUN
 
Fields inherited from interface hudson.model.Item
BUILD, CANCEL, CONFIGURE, CREATE, DELETE, DISCOVER, EXTENDED_READ, PERMISSIONS, READ, WIPEOUT, WORKSPACE
 
Fields inherited from interface hudson.model.Saveable
NOOP
 
Constructor Summary
MatrixConfiguration(MatrixProject parent, Combination c)
           
 
Method Summary
 MatrixConfiguration asProject()
          SCMedItem needs to be an instance of AbstractProject.
 int assignBuildNumber()
          Allocates a new buildCommand number.
protected  void buildDependencyGraph(DependencyGraph graph)
          Builds the dependency graph.
 Label getAssignedLabel()
          If this project is configured to be always built on this node, return that Node.
protected  Class<MatrixRun> getBuildClass()
          Determines Class<R>.
 BuildDiscarder getBuildDiscarder()
          Returns the configured build discarder for this job, or null if none.
 List<Builder> getBuilders()
           
 DescribableList<Builder,Descriptor<Builder>> getBuildersList()
           
 Map<Descriptor<BuildWrapper>,BuildWrapper> getBuildWrappers()
           
 DescribableList<BuildWrapper,Descriptor<BuildWrapper>> getBuildWrappersList()
          BuildWrappers associated with this AbstractProject.
 Combination getCombination()
          Get the actual combination of the axes values for this MatrixConfiguration
 String getDisplayName()
          Gets the human readable short name of this item.
 EnvVars getEnvironment(Node node, TaskListener listener)
          Creates an environment variable override for launching processes for this project.
 JDK getJDK()
          Gets the JDK that this project is configured with, or null.
 int getNextBuildNumber()
          Build numbers are always synchronized with the parent.
 MatrixProject getParent()
          This bridge method is to maintain binary compatibility with Item.getParent().
 String getPronoun()
          Get the term used in the UI to represent this kind of AbstractProject.
 Publisher getPublisher(Descriptor<Publisher> descriptor)
           
 Map<Descriptor<Publisher>,Publisher> getPublishers()
           
 DescribableList<Publisher,Descriptor<Publisher>> getPublishersList()
          Returns the live list of all Publishers configured for this project.
 int getQuietPeriod()
          Since MatrixConfiguration is always invoked from MatrixRun once and just once, there's no point in having a quiet period.
 SCM getScm()
          Gets the SCM for this item.
 int getScmCheckoutRetryCount()
          Inherit the value from the parent.
 SCMCheckoutStrategy getScmCheckoutStrategy()
          Inherit the value from the parent.
 boolean isActiveConfiguration()
          Returns true if this configuration is a configuration currently in use today (as opposed to the ones that are there only to keep the past record.)
 boolean isConcurrentBuild()
          Does this project perform concurrent builds?
 boolean isConfigurable()
          Used in sidepanel.jelly to decide whether to display the config/delete/build links.
protected  MatrixRun newBuild()
          Creates a new build of this project for immediate execution.
 void onLoad(ItemGroup<? extends Item> parent, String name)
          Called right after when a Item is loaded from disk.
 boolean scheduleBuild(List<? extends Action> actions, Cause c)
          Starts the build with the actions that are passed in.
 boolean scheduleBuild(ParametersAction parameters)
          Deprecated. Use scheduleBuild(ParametersAction, Cause). Since 1.283
 boolean scheduleBuild(ParametersAction parameters, Cause c)
          Deprecated. Use scheduleBuild(List, Cause). Since 1.480
 void setBuildDiscarder(BuildDiscarder logRotator)
          Deprecated. Value is controlled by MatrixProject.
 void setConcurrentBuild(boolean b)
           
 void setJDK(JDK jdk)
          Deprecated. Not supported.
protected  void updateTransientActions()
          effectively deprecated.
 
Methods inherited from class hudson.model.Project
addPublisher, createTransientActions, getResourceActivities, inferMavenInstallation, isFingerprintConfigured, removePublisher, submit
 
Methods inherited from class hudson.model.AbstractProject
_getRuns, addProperty, addToList, addTrigger, blockBuildWhenDownstreamBuilding, blockBuildWhenUpstreamBuilding, buildDescribable, buildDescribable, checkAbortPermission, checkout, createExecutable, createHistoryWidget, disable, doBuild, doBuildWithParameters, doCancelQueue, doCheckRetryCount, doConfigSubmit, doDisable, doDoDelete, doDoWipeOutWorkspace, doEnable, doPolling, doRssChangelog, doWs, enable, findNearest, findNearest, getActions, getAssignedLabelString, getAuthToken, getBuild, getBuildByNumber, getBuildingDownstream, getBuildingUpstream, getBuildNowText, getBuildTriggerUpstreamProjects, getCauseOfBlockage, getCustomWorkspace, getDelay, getDownstreamProjects, getFirstBuild, getHasCustomQuietPeriod, getIconColor, getLastBuild, getLastBuiltOn, getModuleRoot, getModuleRoots, getNearestBuild, getNearestOldBuild, getOwnerTask, getProminentActions, getQueueItem, getRelationship, getRelevantLabels, getResourceList, getRootProject, getSameNodeConstraint, getSomeBuildWithWorkspace, getSomeWorkspace, getSubTasks, getTransitiveDownstreamProjects, getTransitiveUpstreamProjects, getTrigger, getTriggers, getUpstreamProjects, getWhyBlocked, getWorkspace, getWorkspaceResource, hasAbortPermission, hasCustomScmCheckoutRetryCount, hasParticipant, isBuildable, isBuildBlocked, isDisabled, isInQueue, isParameterized, loadBuild, makeDisabled, makeSearchIndex, onCreatedFromScratch, performDelete, poll, pollSCMChanges, removeFromList, removeRun, removeTrigger, resolveForCLI, save, scheduleBuild, scheduleBuild, scheduleBuild, scheduleBuild, scheduleBuild, scheduleBuild2, scheduleBuild2, scheduleBuild2, scheduleBuild2, schedulePolling, setAssignedLabel, setAssignedNode, setBlockBuildWhenDownstreamBuilding, setBlockBuildWhenUpstreamBuilding, setCustomWorkspace, setQuietPeriod, setScm, setScmCheckoutStrategy, supportsMakeDisabled
 
Methods inherited from class hudson.model.Job
delete, doBuildStatus, doDescription, doDoRename, doRssAll, doRssFailed, getACL, getAllJobs, getAllProperties, getBuildDir, getBuildForCLI, getBuildHealth, getBuildHealthReports, getBuilds, getBuilds, getBuildsAsMap, getBuildsByTimestamp, getBuildStatusUrl, getBuildTimeGraph, getCharacteristicEnvVars, getDynamic, getEstimatedDuration, getLastBuildsOverThreshold, getLastCompletedBuild, getLastFailedBuild, getLastStableBuild, getLastSuccessfulBuild, getLastUnstableBuild, getLastUnsuccessfulBuild, getLogRotator, getNewBuilds, getOverrides, getPermalinks, getProperties, getProperty, getProperty, getTimeline, getWidgets, isBuilding, isHoldOffBuildUntilSave, isKeepDependencies, isLogUpdated, isNameEditable, logRotate, onCopiedFrom, removeProperty, removeProperty, renameTo, saveNextBuildNumber, setLogRotator, supportsLogRotator, updateNextBuildNumber
 
Methods inherited from class hudson.model.AbstractItem
checkPermission, delete, doConfigDotXml, doSetName, doSubmitDescription, getAbsoluteUrl, getApi, getConfigFile, getDescription, getDescriptorByName, getDisplayNameOrNull, getFullDisplayName, getFullName, getName, getRelativeNameFrom, getRelativeNameFrom, getRelativeNameFromGroup, getRootDir, getSearchName, getSearchUrl, getShortUrl, getUrl, hasPermission, setDescription, setDisplayName, setDisplayNameOrNull, toString, updateByXml, updateByXml
 
Methods inherited from class hudson.model.Actionable
addAction, doContextMenu, getAction, getAction, getActions
 
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface hudson.model.SCMedItem
poll, pollSCMChanges
 
Methods inherited from interface hudson.model.BuildableItem
scheduleBuild, scheduleBuild, scheduleBuild, scheduleBuild
 
Methods inherited from interface hudson.model.Item
delete, getAbsoluteUrl, getAllJobs, getFullDisplayName, getFullName, getName, getRelativeNameFrom, getRelativeNameFrom, getShortUrl, getUrl, onCopiedFrom, onCreatedFromScratch, save
 
Methods inherited from interface hudson.model.PersistenceRoot
getRootDir
 
Methods inherited from interface hudson.search.SearchableModelObject
getSearch
 
Methods inherited from interface hudson.search.SearchItem
getSearchIndex, getSearchName, getSearchUrl
 
Methods inherited from interface hudson.security.AccessControlled
checkPermission, getACL, hasPermission
 
Methods inherited from interface hudson.model.Queue.Task
checkAbortPermission, getCauseOfBlockage, getFullDisplayName, getName, getSubTasks, getUrl, getWhyBlocked, hasAbortPermission, isBuildBlocked
 
Methods inherited from interface hudson.model.queue.SubTask
createExecutable, getEstimatedDuration, getLastBuiltOn, getOwnerTask, getSameNodeConstraint
 
Methods inherited from interface hudson.model.ResourceActivity
getResourceList
 

Field Detail

useShortWorkspaceName

public static boolean useShortWorkspaceName
On Cygwin, path names cannot be longer than 256 chars. See http://cygwin.com/ml/cygwin/2005-04/msg00395.html and http://www.nabble.com/Windows-Filename-too-long-errors-t3161089.html for the background of this issue. Setting this flag to true would cause Jenkins to use cryptic but short path name, giving more room for jobs to use longer path names.

Constructor Detail

MatrixConfiguration

public MatrixConfiguration(MatrixProject parent,
                           Combination c)
Method Detail

onLoad

public void onLoad(ItemGroup<? extends Item> parent,
                   String name)
            throws IOException
Description copied from class: AbstractItem
Called right after when a Item is loaded from disk. This is an opporunity to do a post load processing.

Specified by:
onLoad in interface Item
Overrides:
onLoad in class Project<MatrixConfiguration,MatrixRun>
name - Name of the directory (not a path --- just the name portion) from which the configuration was loaded. This usually becomes the name of this item.
Throws:
IOException

getEnvironment

public EnvVars getEnvironment(Node node,
                              TaskListener listener)
                       throws IOException,
                              InterruptedException
Description copied from class: Job
Creates an environment variable override for launching processes for this project.

This is for process launching outside the build execution (such as polling, tagging, deployment, etc.) that happens in a context of a specific job.

Overrides:
getEnvironment in class AbstractProject<MatrixConfiguration,MatrixRun>
Parameters:
node - Node to eventually run a process on. The implementation must cope with this parameter being null (in which case none of the node specific properties would be reflected in the resulting override.)
Throws:
IOException
InterruptedException

updateTransientActions

protected void updateTransientActions()
Description copied from class: AbstractProject
effectively deprecated. Since using updateTransientActions correctly under concurrent environment requires a lock that can too easily cause deadlocks.

Override AbstractProject.createTransientActions() instead.

Overrides:
updateTransientActions in class AbstractProject<MatrixConfiguration,MatrixRun>

isConcurrentBuild

public boolean isConcurrentBuild()
Description copied from class: AbstractProject
Does this project perform concurrent builds?

Specified by:
isConcurrentBuild in interface Queue.Task
Overrides:
isConcurrentBuild in class AbstractProject<MatrixConfiguration,MatrixRun>

setConcurrentBuild

public void setConcurrentBuild(boolean b)
                        throws IOException
Overrides:
setConcurrentBuild in class AbstractProject<MatrixConfiguration,MatrixRun>
Throws:
IOException

getNextBuildNumber

public int getNextBuildNumber()
Build numbers are always synchronized with the parent.

Computing this is bit tricky. Several considerations:

  1. A new configuration build #N is started while the parent build #N is building, and when that happens we want to return N.
  2. But the configuration build #N is done before the parent build #N finishes, and when that happens we want to return N+1 because that's going to be the next one.
  3. Configuration builds might skip some numbers if the parent build is aborted before this configuration is built.
  4. If nothing is building right now and the last build of the parent is #N, then we want to return N+1.

Overrides:
getNextBuildNumber in class Job<MatrixConfiguration,MatrixRun>

assignBuildNumber

public int assignBuildNumber()
                      throws IOException
Description copied from class: Job
Allocates a new buildCommand number.

Overrides:
assignBuildNumber in class Job<MatrixConfiguration,MatrixRun>
Throws:
IOException

getDisplayName

public String getDisplayName()
Description copied from interface: Item
Gets the human readable short name of this item.

This method should try to return a short concise human readable string that describes this item. The string need not be unique.

The returned string should not include the display names of ancestor items.

Specified by:
getDisplayName in interface Item
Specified by:
getDisplayName in interface ModelObject
Specified by:
getDisplayName in interface ResourceActivity
Overrides:
getDisplayName in class AbstractItem

getParent

public MatrixProject getParent()
Description copied from class: AbstractItem
This bridge method is to maintain binary compatibility with Item.getParent().

Specified by:
getParent in interface Item
Overrides:
getParent in class AbstractItem

getCombination

public Combination getCombination()
Get the actual combination of the axes values for this MatrixConfiguration


getQuietPeriod

public int getQuietPeriod()
Since MatrixConfiguration is always invoked from MatrixRun once and just once, there's no point in having a quiet period.

Overrides:
getQuietPeriod in class AbstractProject<MatrixConfiguration,MatrixRun>

getScmCheckoutRetryCount

public int getScmCheckoutRetryCount()
Inherit the value from the parent.

Overrides:
getScmCheckoutRetryCount in class AbstractProject<MatrixConfiguration,MatrixRun>

getScmCheckoutStrategy

public SCMCheckoutStrategy getScmCheckoutStrategy()
Inherit the value from the parent.

Overrides:
getScmCheckoutStrategy in class AbstractProject<MatrixConfiguration,MatrixRun>

isConfigurable

public boolean isConfigurable()
Description copied from class: AbstractProject
Used in sidepanel.jelly to decide whether to display the config/delete/build links.

Overrides:
isConfigurable in class AbstractProject<MatrixConfiguration,MatrixRun>

getBuildClass

protected Class<MatrixRun> getBuildClass()
Description copied from class: AbstractProject
Determines Class<R>.

Specified by:
getBuildClass in class AbstractProject<MatrixConfiguration,MatrixRun>

newBuild

protected MatrixRun newBuild()
                      throws IOException
Description copied from class: AbstractProject
Creates a new build of this project for immediate execution.

Overrides:
newBuild in class AbstractProject<MatrixConfiguration,MatrixRun>
Throws:
IOException

buildDependencyGraph

protected void buildDependencyGraph(DependencyGraph graph)
Description copied from class: AbstractProject
Builds the dependency graph.

Overrides:
buildDependencyGraph in class Project<MatrixConfiguration,MatrixRun>
See Also:
DependencyGraph

asProject

public MatrixConfiguration asProject()
Description copied from interface: SCMedItem
SCMedItem needs to be an instance of AbstractProject.

This method must be always implemented as (AbstractProject)this, but defining this method emphasizes the fact that this cast must be doable.

Specified by:
asProject in interface BuildableItemWithBuildWrappers
Specified by:
asProject in interface SCMedItem
Overrides:
asProject in class Project<MatrixConfiguration,MatrixRun>

getAssignedLabel

public Label getAssignedLabel()
Description copied from class: AbstractProject
If this project is configured to be always built on this node, return that Node. Otherwise null.

Specified by:
getAssignedLabel in interface SubTask
Overrides:
getAssignedLabel in class AbstractProject<MatrixConfiguration,MatrixRun>

getPronoun

public String getPronoun()
Description copied from class: AbstractProject
Get the term used in the UI to represent this kind of AbstractProject. Must start with a capital letter.

Overrides:
getPronoun in class AbstractProject<MatrixConfiguration,MatrixRun>

getJDK

public JDK getJDK()
Description copied from class: AbstractProject
Gets the JDK that this project is configured with, or null.

Overrides:
getJDK in class AbstractProject<MatrixConfiguration,MatrixRun>

getBuilders

public List<Builder> getBuilders()
Overrides:
getBuilders in class Project<MatrixConfiguration,MatrixRun>

getPublishers

public Map<Descriptor<Publisher>,Publisher> getPublishers()
Overrides:
getPublishers in class Project<MatrixConfiguration,MatrixRun>

getBuildersList

public DescribableList<Builder,Descriptor<Builder>> getBuildersList()
Overrides:
getBuildersList in class Project<MatrixConfiguration,MatrixRun>

getPublishersList

public DescribableList<Publisher,Descriptor<Publisher>> getPublishersList()
Description copied from class: AbstractProject
Returns the live list of all Publishers configured for this project.

This method couldn't be called getPublishers() because existing methods in sub-classes return different inconsistent types.

Overrides:
getPublishersList in class Project<MatrixConfiguration,MatrixRun>

getBuildWrappers

public Map<Descriptor<BuildWrapper>,BuildWrapper> getBuildWrappers()
Overrides:
getBuildWrappers in class Project<MatrixConfiguration,MatrixRun>

getBuildWrappersList

public DescribableList<BuildWrapper,Descriptor<BuildWrapper>> getBuildWrappersList()
Description copied from interface: BuildableItemWithBuildWrappers
BuildWrappers associated with this AbstractProject.

Specified by:
getBuildWrappersList in interface BuildableItemWithBuildWrappers
Overrides:
getBuildWrappersList in class Project<MatrixConfiguration,MatrixRun>
Returns:
can be empty but never null. This list is live, and changes to it will be reflected to the project configuration.

getPublisher

public Publisher getPublisher(Descriptor<Publisher> descriptor)
Overrides:
getPublisher in class Project<MatrixConfiguration,MatrixRun>

getBuildDiscarder

public BuildDiscarder getBuildDiscarder()
Description copied from class: Job
Returns the configured build discarder for this job, or null if none.

Overrides:
getBuildDiscarder in class Job<MatrixConfiguration,MatrixRun>

getScm

public SCM getScm()
Description copied from interface: SCMedItem
Gets the SCM for this item.

Specified by:
getScm in interface SCMedItem
Overrides:
getScm in class AbstractProject<MatrixConfiguration,MatrixRun>
Returns:
may return null for indicating "no SCM".

setJDK

public void setJDK(JDK jdk)
            throws IOException
Deprecated. Not supported.

JDK cannot be set on MatrixConfiguration because it's controlled by MatrixProject.

Overrides:
setJDK in class AbstractProject<MatrixConfiguration,MatrixRun>
Throws:
IOException

setBuildDiscarder

public void setBuildDiscarder(BuildDiscarder logRotator)
Deprecated. Value is controlled by MatrixProject.

Overrides:
setBuildDiscarder in class Job<MatrixConfiguration,MatrixRun>

isActiveConfiguration

public boolean isActiveConfiguration()
Returns true if this configuration is a configuration currently in use today (as opposed to the ones that are there only to keep the past record.)

See Also:
MatrixProject.getActiveConfigurations()

scheduleBuild

public boolean scheduleBuild(ParametersAction parameters)
Deprecated. Use scheduleBuild(ParametersAction, Cause). Since 1.283


scheduleBuild

public boolean scheduleBuild(ParametersAction parameters,
                             Cause c)
Deprecated. Use scheduleBuild(List, Cause). Since 1.480

Starts the build with the ParametersAction that are passed in.

Parameters:
parameters - Can be null.

scheduleBuild

public boolean scheduleBuild(List<? extends Action> actions,
                             Cause c)
Starts the build with the actions that are passed in.

Parameters:
actions - Can be null.
cause - Reason for starting the build


Copyright © 2004-2013. All Rights Reserved.