Class AgentBuilder.CircularityLock.Global
java.lang.Object
net.bytebuddy.agent.builder.AgentBuilder.CircularityLock.WithInnerClassLoadingLock
net.bytebuddy.agent.builder.AgentBuilder.CircularityLock.Global
- All Implemented Interfaces:
AgentBuilder.CircularityLock
- Enclosing interface:
AgentBuilder.CircularityLock
@Enhance
public static class AgentBuilder.CircularityLock.Global
extends AgentBuilder.CircularityLock.WithInnerClassLoadingLock
A circularity lock that holds a global monitor and does not permit concurrent access.
-
Nested Class Summary
Nested classes/interfaces inherited from class AgentBuilder.CircularityLock.WithInnerClassLoadingLock
AgentBuilder.CircularityLock.WithInnerClassLoadingLock.TrivialLockNested classes/interfaces inherited from interface AgentBuilder.CircularityLock
AgentBuilder.CircularityLock.Default, AgentBuilder.CircularityLock.Global, AgentBuilder.CircularityLock.Inactive, AgentBuilder.CircularityLock.WithInnerClassLoadingLock -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final LockThe lock to hold.private final longThe time to wait for the lock.private final TimeUnitThe time's time unit.Fields inherited from class AgentBuilder.CircularityLock.WithInnerClassLoadingLock
DEFAULT_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionGlobal()Creates a new global circularity lock that does not wait for a release and a default size for the amount of global locks.Global(int size) Creates a new global circularity lock that does not wait for a release.Creates a new global circularity lock.Creates a new global circularity lock with a default size for the amount of global locks. -
Method Summary
Methods inherited from class AgentBuilder.CircularityLock.WithInnerClassLoadingLock
acquire
-
Field Details
-
lock
The lock to hold. -
time
private final long timeThe time to wait for the lock. -
timeUnit
The time's time unit.
-
-
Constructor Details
-
Global
public Global()Creates a new global circularity lock that does not wait for a release and a default size for the amount of global locks. -
Global
Creates a new global circularity lock with a default size for the amount of global locks.- Parameters:
time- The time to wait for the lock.timeUnit- The time's time unit.
-
Global
public Global(int size) Creates a new global circularity lock that does not wait for a release.- Parameters:
size- The amount of locks used in parallel or0if no global locks should be used.
-
Global
Creates a new global circularity lock.- Parameters:
size- The amount of locks used in parallel or0if no global locks should be used.time- The time to wait for the lock.timeUnit- The time's time unit.
-
-
Method Details
-
doAcquire
protected boolean doAcquire()Description copied from class:AgentBuilder.CircularityLock.WithInnerClassLoadingLockAcquires the actual lock for the current thread.- Specified by:
doAcquirein classAgentBuilder.CircularityLock.WithInnerClassLoadingLock- Returns:
trueif the lock was acquired successfully,falseif it is already hold.
-
release
public void release()Releases the circularity lock if it is currently acquired.
-