|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthudson.model.Resource
public final class Resource
Represents things that Queue.Executable
uses while running.
This is used in Queue
to support basic mutual exclusion/locks. If two
Queue.Task
s require the same Resource
, they will not
be run at the same time.
Resources are compared by using their names
, and
need not have the "same object" semantics.
Field Summary | |
---|---|
String |
displayName
Human-readable name of this resource. |
int |
numConcurrentWrite
Maximum number of concurrent write. |
Resource |
parent
Parent resource. |
Constructor Summary | |
---|---|
Resource(Resource parent,
String displayName)
|
|
Resource(Resource parent,
String displayName,
int numConcurrentWrite)
|
|
Resource(String displayName)
|
Method Summary | |
---|---|
boolean |
equals(Object o)
|
int |
hashCode()
|
boolean |
isCollidingWith(Resource that,
int count)
Checks the resource collision. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final String displayName
public final Resource parent
A child resource is considered a part of the parent resource, so acquiring the parent resource always imply acquiring all the child resources.
public final int numConcurrentWrite
Constructor Detail |
---|
public Resource(Resource parent, String displayName)
public Resource(Resource parent, String displayName, int numConcurrentWrite)
public Resource(String displayName)
Method Detail |
---|
public boolean isCollidingWith(Resource that, int count)
count
- If we are testing W/W conflict, total # of write counts.
For R/W conflict test, this value should be set to Integer.MAX_VALUE
.public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |