@Component(value="tapirSharedResourcePool") public class SharedResourcePool extends Object
SharedResourcePool
provides the possibility to lock resources in order to synchronize them. Clients which need to
obtain a shared resource can query a lock by calling lockResource(Object)
.Constructor and Description |
---|
SharedResourcePool() |
Modifier and Type | Method and Description |
---|---|
void |
lockResource(Object resource)
Queries a resource.
|
void |
unlockResource(Object resource)
Unlocks a resource.
|
public void lockResource(Object resource)
RuntimeException
is thrown. The given resource is compared by its Object.equals(Object)
method.resource
- the resource to lockRuntimeException
- Thrown if the lock cannot be acquired within the time specified by timeOutInSeconds
.public void unlockResource(Object resource)
Object.equals(Object)
method has to return true if it's compared to the locked
resource.resource
- the resource to unlockCopyright © 2018–2020 b+m Informatik AG. All rights reserved.