Class WrappingOperation

  • All Implemented Interfaces:
    Consumer<org.eclipse.core.runtime.IProgressMonitor>

    public class WrappingOperation
    extends Object
    implements Consumer<org.eclipse.core.runtime.IProgressMonitor>
    Special operation which allow to create inline operation boundaries in the code directly. The operation finish is controlled via the code itself.
    • Constructor Detail

      • WrappingOperation

        public WrappingOperation​(Consumer<Object> operation,
                                 OperationType type,
                                 String name,
                                 boolean implicitDerivedDataWait,
                                 IDerivedDataManager derivedDataManager)
        Constructs an operation
        Parameters:
        operation - The operation executable. It's called after the operation's start is confirmed by the system. May not be null
        type - the type of the operation. May not be null
        name - The name of the operation. May not be null
        implicitDerivedDataWait - Perform an implicit wait of the
        derivedDataManager - The reference to the corresponding IDerivedDataManager. May not be null
      • WrappingOperation

        public WrappingOperation​(Consumer<Object> operation,
                                 OperationType type,
                                 String name,
                                 IDerivedDataManager derivedDataManager)
        Constructs an operation
        Parameters:
        operation - The operation executable. It's called after the operation's start is confirmed by the system. May not be null
        type - The type of the operation. May not be null
        name - The name of the operation. May not be null
        derivedDataManager - The reference to the corresponding IDerivedDataManager. May not be null
    • Method Detail

      • accept

        public void accept​(org.eclipse.core.runtime.IProgressMonitor progressMonitor)
        Specified by:
        accept in interface Consumer<org.eclipse.core.runtime.IProgressMonitor>
      • finish

        public Runnable finish()
        Finishes the operation. If necessary - waits for an async. data that are related to BM task being executed inside the operation
        Returns:
        Post-finish actions, may not be null
      • getHandle

        public Object getHandle()
        Gets the handle of the associated operation
        Returns:
        The handle of the operation. May be null if the operation isn't scheduled yet
      • getType

        public OperationType getType()
        Gets the type of the operation
        Returns:
        The type of the operation. May not be null
      • isFinished

        public boolean isFinished()
        Checks if the operation is finihed already
        Returns:
        True if the operation is finished
      • isStarted

        public boolean isStarted()
        Checks if the operation is already started by the engine
        Returns:
        True if the operation is started
      • setAsyncEventScheduler

        public void setAsyncEventScheduler​(Runnable asyncEventScheduler)
        Sets the scheduler process of the async. event sending to the wrapping operation This method is called by the DD engine and shouldn't be called in the client code
        Parameters:
        asyncEventScheduler - The async event sending sheduler. May not be null
      • setHandle

        public void setHandle​(Object handle)
        Sets the operation handle This method is called by the DD engine and shouldn't be called in the client code
        Parameters:
        handle - The handle to set. May not be null
      • setImplicitWaitingContext

        public void setImplicitWaitingContext​(Collection<IObjectDerivedDataContext> waitingScope)
        Sets the context of data being changed within this operation to wait in on the exit from the operation. This method is called by the DD engine and shouldn't be called in the client code
        Parameters:
        waitingScope - The scope to wait. May not be null