|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IFencedArea
An interface which allows us to control the access of threads to a certain code area. This includes the possibility:
| Nested Class Summary | |
|---|---|
static class |
IFencedArea.GateState
The states the gate can have. |
| Method Summary | |
|---|---|
void |
await(IFencedArea.GateState state)
Waits till the specified state is reached. |
boolean |
await(IFencedArea.GateState state,
long timeout,
TimeUnit unit)
Waits till the specified state is reached. |
com.kuka.common.concurrent.IWaitToken |
closeGate()
Closes the gate. |
void |
dispose()
Does the following: closes the gate, interrupts all threads which are currently waiting at the gate. |
void |
enterArea()
This method has to be called when a thread wants to enter the area. |
boolean |
isGateClosed()
States if the gate is closed while the threads are made to wait at the gate. |
void |
leaveArea()
This method has to be called as soon as a threads leaves the area. |
void |
openGate()
Open the gate and allow all new arriving and waiting threads to enter the area. |
| Method Detail |
|---|
void openGate()
com.kuka.common.concurrent.IWaitToken closeGate()
Please note:
The gate is only closed if it is currently open.
IWaitToken which can be used to wait till the area is empty. If the gate is not open when the
method is called, null is returned.
void enterArea()
throws InterruptedException
InterruptedException - Exception which is thrown when the thread is interrupted while waiting for the permission to enter
the area.void leaveArea()
void await(IFencedArea.GateState state)
throws InterruptedException
state - to wait for.
InterruptedException - if the waiting process was interrupted.
boolean await(IFencedArea.GateState state,
long timeout,
TimeUnit unit)
throws InterruptedException
state - to wait for.timeout - States how long to wait for the state to reach.unit - of the timeout argument.
true if the state is reached and false if the time is up before the state is reached.
InterruptedException - if the waiting process was interrupted.boolean isGateClosed()
true if gate is closed while the threads have to wait at the gate, otherwise false.void dispose()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||