Class AccessGuard
- java.lang.Object
-
- com.nomagic.magicdraw.foundation.util.AccessGuard
-
public class AccessGuard extends java.lang.ObjectUtility class that provides convenient methods to wrap method calls and support locking before actual method call.- Version:
- 1.0
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> Texecute(org.eclipse.emf.ecore.EObject owner, Operation<T> operation)Executes operation.
-
-
-
Method Detail
-
execute
public static <T> T execute(org.eclipse.emf.ecore.EObject owner, Operation<T> operation)Executes operation. Model lock (if it is supported) will be acquired before calling the specified operation. The lock will be released immediately after operation call end.- Type Parameters:
T- type of operation parameter.- Parameters:
owner- EObject that should be used to acquire lock.operation- operation that should be executed.- Returns:
- operation call result.
- Throws:
OperationTimeoutException- if the lock can not be acquired during specified time period.
-
-