Class AccessGuard


  • public class AccessGuard
    extends java.lang.Object
    Utility class that provides convenient methods to wrap method calls and support locking before actual method call.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> T execute​(org.eclipse.emf.ecore.EObject owner, Operation<T> operation)
      Executes operation.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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.