@API(status=STABLE,
since="1.10")
public class ExclusiveResource
extends java.lang.Object
Node.getExecutionMode()| Modifier and Type | Class and Description |
|---|---|
static class |
ExclusiveResource.LockMode
LockMode translates to the respective ReadWriteLock
locks. |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
GLOBAL_KEY
Key of the global resource lock that all direct children of the engine
descriptor acquire in read mode by default:
"org.junit.platform.engine.support.hierarchical.ExclusiveResource.GLOBAL_KEY"
|
(package private) static ExclusiveResource |
GLOBAL_READ |
(package private) static ExclusiveResource |
GLOBAL_READ_WRITE |
private int |
hash |
private java.lang.String |
key |
private ExclusiveResource.LockMode |
lockMode |
| Constructor and Description |
|---|
ExclusiveResource(java.lang.String key,
ExclusiveResource.LockMode lockMode)
Create a new
ExclusiveResource. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
java.lang.String |
getKey()
Get the key of this resource.
|
ExclusiveResource.LockMode |
getLockMode()
Get the lock mode of this resource.
|
int |
hashCode() |
java.lang.String |
toString() |
@API(status=STABLE,
since="1.10")
public static final java.lang.String GLOBAL_KEY
If any node requires an exclusive resource with the same key in read-write mode, the lock will be coarsened to be acquired by the node's ancestor that is a direct child of the engine descriptor and all of the ancestor's descendants will be forced to run in the same thread.
static final ExclusiveResource GLOBAL_READ
static final ExclusiveResource GLOBAL_READ_WRITE
private final java.lang.String key
private final ExclusiveResource.LockMode lockMode
private int hash
public ExclusiveResource(java.lang.String key,
ExclusiveResource.LockMode lockMode)
ExclusiveResource.key - the identifier of the resource; never null or blanklockMode - the lock mode to use to synchronize access to the
resource; never nullpublic java.lang.String getKey()
public ExclusiveResource.LockMode getLockMode()
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object