Interface IContextTransactionManager

All Known Implementing Classes:
DerivedDataContextManager

public interface IContextTransactionManager
Internal interface of the IDerivedDataContextManager used to communicate with context collecting transactions during their lifecycle.
  • Method Details

    • commit

      void commit(Object transactionHandle)
      Commits the transaction.
      Parameters:
      transactionHandle - The handle of the context manipulaton transaction. Cannot be null.
    • getObjectContext

      IObjectDerivedDataContext getObjectContext(IBmObject bmObject, String segmentId, Object computationCause, Object transactionHandle)
      Gathers object context for the given object (if any).
      Parameters:
      bmObject - Target BM object. Cannot be null.
      segmentId - The identifier of the target DD segment. Cannot be null.
      transactionHandle - The handle of the context manipulaton transaction. Cannot be null.
      Returns:
      The target context (if any available or possible for the object).
    • getObjectContext

      IObjectDerivedDataContext getObjectContext(Object objectId, org.eclipse.emf.ecore.EClass objectEClass, String segmentId, Object computationCause, Object transactionHandle)
      Gathers object context for the given object (if any).
      Parameters:
      objectId - Target object, cannot be null.
      segmentId - The identifier of the target DD segment, cannot be null.
      objectEClass - The EClass of the object, cannot be null.
      transactionHandle - The handle of the context manipulaton transaction, cannot be null.
      Returns:
      The target context (if any available or possible for the object), never null.
    • getExistingObjectContext

      IObjectDerivedDataContext getExistingObjectContext(Object objectId, String segmentId, Object computationCause, Object transactionHandle)
      Returns the existing object context.
      Parameters:
      objectId - Target object, cannot be null.
      segmentId - The identifier of the target DD segment, cannot be null.
      computationCause - The computation cause, cannot be null.
      transactionHandle - The handle of the context manipulaton transaction, cannot be null.
      Returns:
      The target context (if any available or possible for the object), never null.
    • getObjectContext

      IObjectDerivedDataContext getObjectContext(long bmObjectId, org.eclipse.emf.ecore.EClass objectEClass, String segmentId, Object object, Object transactionHandle)
      Gathers object context for the given object (if any).
      Parameters:
      bmObjectId - The identifier of the object to get the context for for.
      objectEClass - The EClass of the object to get the context for. Cannot be null
      segmentId - The identifier of the target DD segment. Cannot be null.
      object - The object, cannot be null.
      transactionHandle - The handle of the context manipulaton transaction. Cannot be null.
      Returns:
      The target context (if any available or possible for the object).
    • markAsComputed

      void markAsComputed(IObjectDerivedDataContext context, Object transactionHandle)
      Marks the context as a computed. Will be re-set on a commit.
      Parameters:
      context - Transaction context. Cannot be null.
      transactionHandle - The handle of the context manipulaton transaction. Cannot be null.
    • markAsFailed

      void markAsFailed(IObjectDerivedDataContext context, Object transactionHandle)
      Marks a specified context as failed to compute.
      Parameters:
      context - The context to mark as failed. Cannot be null.
      transactionHandle - The handle of the context manipulaton transaction. Cannot be null.
    • registerTransaction

      Object registerTransaction(boolean computation, boolean forcedUpdate, Object computationCause, boolean trackWaitingScope)
      Registers a transaction in the lock manager. Throws an exception if there are too many concurrent transactions.
      Parameters:
      computation - True in case if this a DD context computation transaction; false otherwise.
      forcedUpdate - Forces update of contexts, even if they aren't changed
      trackWaitingScope - Enables tracking of implicit waiting context if true
      Returns:
      the registered transaction handle, never null.
    • rollback

      void rollback(Object transactionHandle)
      Rolls the transaction back, cancelling all collected context changes.
      Parameters:
      transactionHandle - The handle of the context manipulaton transaction. Cannot be null.
    • isContextExists

      boolean isContextExists(IBmObject bmObject, String segmentId)
      Checks if the DD context exists(supported) for the given object and segment
      Parameters:
      bmObject - The object to get the context for. May not be null
      segmentId - The DD segment identifier. May not be null
      Returns:
      True if the context exists/may be created
    • isContextExists

      boolean isContextExists(org.eclipse.emf.ecore.EClass topObjectEClass, long topObjectId, String segmentId)
      Checks if the DD context exists(supported) for the given object and segment
      Parameters:
      topObjectEClass - Top object EClass. May not be null
      topObjectId - Top object identifier. May not be null
      segmentId - The DD segment identifier. May not be null
      Returns:
      True if the context exists/may be created
    • scheduleOperation

      IObjectDerivedDataContext scheduleOperation(Consumer<org.eclipse.core.runtime.IProgressMonitor> operation, OperationType operationType, boolean important, String segmentId, Object transactionHandle)
      Schedules an operation context. Always creates a new one as an operation is non-identifiable
      Parameters:
      operation - The operation executable. May not be null
      operationType - The operation type. May not be null
      important -
      segmentId - The target async pipeline operation segment. May not be null
      transactionHandle - The handle of the context manipulaton transaction. Cannot be null.
      Returns:
      The operation context. May not be null
    • scheduleOperationRemoval

      void scheduleOperationRemoval(IObjectDerivedDataContext handle, Object transactionHandle)
      Schedules the operation removal
      Parameters:
      handle - The handle of the previously scheduled operation. May not be null
      transactionHandle - The handle of the context manipulaton transaction. Cannot be null.
    • confirmOperationComputation

      void confirmOperationComputation(OperationContext operationContext, Object transactionHandle)
      Confirms the computation of the given operation
      Parameters:
      operationContext - The context of the operation. May not be null
      transactionHandle - The handle of the context manipulaton transaction. Cannot be null.
    • scheduleModalOperation

      IObjectDerivedDataContext scheduleModalOperation(Consumer<org.eclipse.core.runtime.IProgressMonitor> operation, String operationSegment, IModalOperationController modalOperationController, Object transactionHandle)
      Schedules a new modal operation
      Parameters:
      operation - The operation logic to schedule. May not be null
      stage - The target stage for the scheduling. May not be null
      modalOperationController - The modal operation controller. May not be null
      Returns:
      The operation handle for external operation referencing, may not be null