hudson.model
Class ResourceList

java.lang.Object
  extended by hudson.model.ResourceList

public final class ResourceList
extends Object

List of Resources 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
static ResourceList EMPTY
          Empty resource list.
 
Constructor Summary
ResourceList()
           
 
Method Summary
 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(Collection<ResourceList> lists)
          Creates union of all resources.
static ResourceList union(ResourceList... lists)
          Creates union of all resources.
 ResourceList w(Resource r)
          Adds a resource for write access.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY

public static final ResourceList EMPTY
Empty resource list.

Constructor Detail

ResourceList

public ResourceList()
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.


toString

public String toString()
Overrides:
toString in class Object


Copyright © 2004-2013. All Rights Reserved.