com.kuka.roboticsAPI.controllerModel.sunrise
Interface IFencedArea

All Known Implementing Classes:
FencedArea

public interface IFencedArea

An interface which allows us to control the access of threads to a certain code area. This includes the possibility:

This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

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

openGate

void openGate()
Open the gate and allow all new arriving and waiting threads to enter the area.


closeGate

com.kuka.common.concurrent.IWaitToken closeGate()
Closes the gate. New arriving threads have to wait at the gate.

Please note:
The gate is only closed if it is currently open.

Returns:
a 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.

enterArea

void enterArea()
               throws InterruptedException
This method has to be called when a thread wants to enter the area.

Throws:
InterruptedException - Exception which is thrown when the thread is interrupted while waiting for the permission to enter the area.

leaveArea

void leaveArea()
This method has to be called as soon as a threads leaves the area.


await

void await(IFencedArea.GateState state)
           throws InterruptedException
Waits till the specified state is reached.

Parameters:
state - to wait for.
Throws:
InterruptedException - if the waiting process was interrupted.

await

boolean await(IFencedArea.GateState state,
              long timeout,
              TimeUnit unit)
              throws InterruptedException
Waits till the specified state is reached.

Parameters:
state - to wait for.
timeout - States how long to wait for the state to reach.
unit - of the timeout argument.
Returns:
true if the state is reached and false if the time is up before the state is reached.
Throws:
InterruptedException - if the waiting process was interrupted.

isGateClosed

boolean isGateClosed()
States if the gate is closed while the threads are made to wait at the gate.

Returns:
true if gate is closed while the threads have to wait at the gate, otherwise false.

dispose

void dispose()
Does the following:
  1. closes the gate,
  2. interrupts all threads which are currently waiting at the gate.



Copyright © 2019. All rights reserved.