com.kuka.roboticsAPI.controllerModel.sunrise
Class FencedArea

java.lang.Object
  extended by com.kuka.roboticsAPI.controllerModel.sunrise.FencedArea
All Implemented Interfaces:
IFencedArea

public class FencedArea
extends Object
implements IFencedArea

See IFencedArea.

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
 
Nested classes/interfaces inherited from interface com.kuka.roboticsAPI.controllerModel.sunrise.IFencedArea
IFencedArea.GateState
 
Constructor Summary
FencedArea()
           
 
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.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FencedArea

public FencedArea()
Method Detail

openGate

public void openGate()
Description copied from interface: IFencedArea
Open the gate and allow all new arriving and waiting threads to enter the area.

Specified by:
openGate in interface IFencedArea

closeGate

public com.kuka.common.concurrent.IWaitToken closeGate()
Description copied from interface: IFencedArea
Closes the gate. New arriving threads have to wait at the gate.

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

Specified by:
closeGate in interface IFencedArea
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

public void enterArea()
               throws InterruptedException
Description copied from interface: IFencedArea
This method has to be called when a thread wants to enter the area.

Specified by:
enterArea in interface IFencedArea
Throws:
InterruptedException - Exception which is thrown when the thread is interrupted while waiting for the permission to enter the area.

leaveArea

public void leaveArea()
Description copied from interface: IFencedArea
This method has to be called as soon as a threads leaves the area.

Specified by:
leaveArea in interface IFencedArea

await

public void await(IFencedArea.GateState state)
           throws InterruptedException
Description copied from interface: IFencedArea
Waits till the specified state is reached.

Specified by:
await in interface IFencedArea
Parameters:
state - to wait for.
Throws:
InterruptedException - if the waiting process was interrupted.

await

public boolean await(IFencedArea.GateState state,
                     long timeout,
                     TimeUnit unit)
              throws InterruptedException
Description copied from interface: IFencedArea
Waits till the specified state is reached.

Specified by:
await in interface IFencedArea
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

public boolean isGateClosed()
Description copied from interface: IFencedArea
States if the gate is closed while the threads are made to wait at the gate.

Specified by:
isGateClosed in interface IFencedArea
Returns:
true if gate is closed while the threads have to wait at the gate, otherwise false.

dispose

public void dispose()
Description copied from interface: IFencedArea
Does the following:
  1. closes the gate,
  2. interrupts all threads which are currently waiting at the gate.

Specified by:
dispose in interface IFencedArea

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2019. All rights reserved.