com.kuka.roboticsAPI.concurrencyModel
Class SyncManager

java.lang.Object
  extended by com.kuka.roboticsAPI.AbstractEngine
      extended by com.kuka.roboticsAPI.concurrencyModel.SyncManager
All Implemented Interfaces:
ISyncManager, IEngine

public final class SyncManager
extends AbstractEngine
implements ISyncManager

This class provides access to context-global critial areas and sync handles. Each area or handle is identified through a name. If any other thread tries to access the same area, it has to wait until no other thread is in this area.

Be careful because if you do not type the correct name for each thread trying to access to lock, the locking will not work.

This element is not in its final state and might change in future versions.

Constructor Summary
SyncManager(RoboticsAPIContext context)
          Creates a new SyncManager.
 
Method Summary
 CriticalArea getCriticalArea(String name)
          Gets the critical area identified by the given name.
 Class<? extends IEngine> getEngineType()
          Gets the type of the engine.
 SyncHandle getSyncHandle(String name)
          Gets a sync handle with the specified name.
 SyncHandle initSyncHandle(String syncHandleName, int count)
          Initializes a sync handle.
 void removeCriticalArea(String name)
          Removes the critical area with the given name.
 void removeSyncHandle(String syncHandleName)
          Removes the sync handle with the given name.
 
Methods inherited from class com.kuka.roboticsAPI.AbstractEngine
dispose, getContext, initialize, setParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.kuka.roboticsAPI.IEngine
dispose, getContext, initialize, setParameters
 

Constructor Detail

SyncManager

public SyncManager(RoboticsAPIContext context)
Creates a new SyncManager.

Parameters:
context - The context of the manager.
This element is not in its final state and might change in future versions.
Method Detail

initSyncHandle

public SyncHandle initSyncHandle(String syncHandleName,
                                 int count)
Initializes a sync handle. If there is no sync handle with this name yet - creates it.

Specified by:
initSyncHandle in interface ISyncManager
Parameters:
syncHandleName - name for the new handle.
count - number of threads that the new handle can block.
Returns:
a initialized SyncHandle object with this name.
This element is not in its final state and might change in future versions.

getSyncHandle

public SyncHandle getSyncHandle(String name)
Gets a sync handle with the specified name.

Specified by:
getSyncHandle in interface ISyncManager
Parameters:
name - name of a handle.
Returns:
a sync handle with the specified name or null.
This element is not in its final state and might change in future versions.

removeSyncHandle

public void removeSyncHandle(String syncHandleName)
Removes the sync handle with the given name. Be careful: Removing the sync handle will not free any threads waiting on that handle. You have to do that on your own.

Specified by:
removeSyncHandle in interface ISyncManager
Parameters:
syncHandleName - The name of the sync handle.
This element is not in its final state and might change in future versions.

getCriticalArea

public CriticalArea getCriticalArea(String name)
Gets the critical area identified by the given name.

Specified by:
getCriticalArea in interface ISyncManager
Parameters:
name - The name of the critical area.
Returns:
The critical area object.
This element is not in its final state and might change in future versions.

removeCriticalArea

public void removeCriticalArea(String name)
Removes the critical area with the given name. Be careful: Removing the area will not free any threads waiting for enter that area. You have to do that on your own.

Specified by:
removeCriticalArea in interface ISyncManager
Parameters:
name - The name of the critical area.
This element is not in its final state and might change in future versions.

getEngineType

public Class<? extends IEngine> getEngineType()
Gets the type of the engine. This should be the concrete IEngine interface which the engine is implementing.

Specified by:
getEngineType in interface IEngine
Specified by:
getEngineType in class AbstractEngine
Returns:
The type of the engine. This should be the concrete IEngine interface which the engine is implementing.
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.


Copyright © 2019. All rights reserved.