Class AccessGuard

java.lang.Object
com.nomagic.magicdraw.foundation.util.AccessGuard

public class AccessGuard extends Object
Utility class that provides convenient methods to wrap method calls and support locking before actual method call.
Version:
1.0
  • Method Details

    • 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.