Package hudson.model
Class Resource
- java.lang.Object
-
- hudson.model.Resource
-
public final class Resource extends Object
Represents things thatQueue.Executableuses while running.This is used in
Queueto support basic mutual exclusion/locks. If twoQueue.Tasks require the sameResource, they will not be run at the same time.Resources are compared by using their
names, and need not have the "same object" semantics.- Since:
- 1.121
-
-
Field Summary
Fields Modifier and Type Field Description StringdisplayNameHuman-readable name of this resource.intnumConcurrentWriteMaximum number of concurrent write.ResourceparentParent resource.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)inthashCode()booleanisCollidingWith(Resource that, int count)Checks the resource collision.StringtoString()
-
-
-
Field Detail
-
displayName
@NonNull public final String displayName
Human-readable name of this resource. Used for rendering HTML.
-
parent
@CheckForNull public final Resource parent
Parent resource.A child resource is considered a part of the parent resource, so acquiring the parent resource always imply acquiring all the child resources.
-
numConcurrentWrite
public final int numConcurrentWrite
Maximum number of concurrent write.
-
-
Method Detail
-
isCollidingWith
public boolean isCollidingWith(Resource that, int count)
Checks the resource collision.- Parameters:
count- If we are testing W/W conflict, total # of write counts. For R/W conflict test, this value should be set toInteger.MAX_VALUE.
-
-