Package hudson.model
Class ResourceList
- java.lang.Object
-
- hudson.model.ResourceList
-
public final class ResourceList extends Object
List ofResource
s that an activity needs.There are two ways to access resources. Read and write. As with usual reader/writer pattern, multiple read accesses can co-exist concurrently, but write access requires exclusive access (the number of allowed concurrent write activity is determined by
Resource.numConcurrentWrite
.- Since:
- 1.121
- Author:
- Kohsuke Kawaguchi
-
-
Field Summary
Fields Modifier and Type Field Description static ResourceList
EMPTY
Empty resource list.
-
Constructor Summary
Constructors Constructor Description ResourceList()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Resource
getConflict(ResourceList that)
Returns the resource in this list that's colliding with the given resource list.boolean
isCollidingWith(ResourceList that)
Checks if this resource list and that resource list has any conflicting resource access.ResourceList
r(Resource r)
Adds a resource for read access.String
toString()
static ResourceList
union(ResourceList... lists)
Creates union of all resources.static ResourceList
union(Collection<ResourceList> lists)
Creates union of all resources.ResourceList
w(Resource r)
Adds a resource for write access.
-
-
-
Field Detail
-
EMPTY
public static final ResourceList EMPTY
Empty resource list.
-
-
Method Detail
-
union
public static ResourceList union(ResourceList... lists)
Creates union of all resources.
-
union
public static ResourceList union(Collection<ResourceList> lists)
Creates union of all resources.
-
r
public ResourceList r(Resource r)
Adds a resource for read access.
-
w
public ResourceList w(Resource r)
Adds a resource for write access.
-
isCollidingWith
public boolean isCollidingWith(ResourceList that)
Checks if this resource list and that resource list has any conflicting resource access.
-
getConflict
public Resource getConflict(ResourceList that)
Returns the resource in this list that's colliding with the given resource list.
-
-