public abstract class ASimplePassiveResource extends Object
The state of a concrete example passive resource can be manually controlled.
| Constructor and Description |
|---|
ASimplePassiveResource(int size)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
acquire()
Aquires a resource from the passive resource.
|
boolean |
canAcquire()
States whether free resources are left within the passive resource.
|
int |
getFree()
Returns the number of currently free resources within this passive resource.
|
int |
getSize()
Returns the maximum size of this passive resource.
|
void |
release()
Releases a resource from the passive resource.
|
public ASimplePassiveResource(int size)
size - Size of the passive resource for resources.public void acquire()
public void release()
public boolean canAcquire()
true if free resources are left, false otherwise.public int getSize()
public int getFree()