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 Summary
Modifier and TypeMethodDescriptionvoid
Commits the transaction.void
confirmOperationComputation
(OperationContext operationContext, Object transactionHandle) Confirms the computation of the given operationgetExistingObjectContext
(Object objectId, String segmentId, Object computationCause, Object transactionHandle) Returns the existing object context.getObjectContext
(long bmObjectId, org.eclipse.emf.ecore.EClass objectEClass, String segmentId, Object object, Object transactionHandle) Gathers object context for the given object (if any).getObjectContext
(IBmObject bmObject, String segmentId, Object computationCause, Object transactionHandle) Gathers object context for the given object (if any).getObjectContext
(Object objectId, org.eclipse.emf.ecore.EClass objectEClass, String segmentId, Object computationCause, Object transactionHandle) Gathers object context for the given object (if any).boolean
isContextExists
(IBmObject bmObject, String segmentId) Checks if the DD context exists(supported) for the given object and segmentboolean
isContextExists
(org.eclipse.emf.ecore.EClass topObjectEClass, long topObjectId, String segmentId) Checks if the DD context exists(supported) for the given object and segmentvoid
markAsComputed
(IObjectDerivedDataContext context, Object transactionHandle) Marks the context as a computed.void
markAsFailed
(IObjectDerivedDataContext context, Object transactionHandle) Marks a specified context as failed to compute.registerTransaction
(boolean computation, boolean forcedUpdate, Object computationCause, boolean trackWaitingScope) Registers a transaction in the lock manager.void
Rolls the transaction back, cancelling all collected context changes.scheduleModalOperation
(Consumer<org.eclipse.core.runtime.IProgressMonitor> operation, String operationSegment, IModalOperationController modalOperationController, Object transactionHandle) Schedules a new modal operationscheduleOperation
(Consumer<org.eclipse.core.runtime.IProgressMonitor> operation, OperationType operationType, boolean important, String segmentId, Object transactionHandle) Schedules an operation context.void
scheduleOperationRemoval
(IObjectDerivedDataContext handle, Object transactionHandle) Schedules the operation removal
-
Method Details
-
commit
Commits the transaction.- Parameters:
transactionHandle
- The handle of the context manipulaton transaction. Cannot benull
.
-
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 benull
.segmentId
- The identifier of the target DD segment. Cannot benull
.transactionHandle
- The handle of the context manipulaton transaction. Cannot benull
.- 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 benull
.segmentId
- The identifier of the target DD segment, cannot benull
.objectEClass
- TheEClass
of the object, cannot benull
.transactionHandle
- The handle of the context manipulaton transaction, cannot benull
.- 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 benull
.segmentId
- The identifier of the target DD segment, cannot benull
.computationCause
- The computation cause, cannot benull
.transactionHandle
- The handle of the context manipulaton transaction, cannot benull
.- 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
- TheEClass
of the object to get the context for. Cannot benull
segmentId
- The identifier of the target DD segment. Cannot benull
.object
- The object, cannot benull
.transactionHandle
- The handle of the context manipulaton transaction. Cannot benull
.- Returns:
- The target context (if any available or possible for the object).
-
markAsComputed
Marks the context as a computed. Will be re-set on a commit.- Parameters:
context
- Transaction context. Cannot benull
.transactionHandle
- The handle of the context manipulaton transaction. Cannot benull
.
-
markAsFailed
Marks a specified context as failed to compute.- Parameters:
context
- The context to mark as failed. Cannot benull
.transactionHandle
- The handle of the context manipulaton transaction. Cannot benull
.
-
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 changedtrackWaitingScope
- Enables tracking of implicit waiting context if true- Returns:
- the registered transaction handle, never
null
.
-
rollback
Rolls the transaction back, cancelling all collected context changes.- Parameters:
transactionHandle
- The handle of the context manipulaton transaction. Cannot benull
.
-
isContextExists
Checks if the DD context exists(supported) for the given object and segment- Parameters:
bmObject
- The object to get the context for. May not benull
segmentId
- The DD segment identifier. May not benull
- 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 objectEClass
. May not benull
topObjectId
- Top object identifier. May not benull
segmentId
- The DD segment identifier. May not benull
- 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 benull
operationType
- The operation type. May not benull
important
-segmentId
- The target async pipeline operation segment. May not benull
transactionHandle
- The handle of the context manipulaton transaction. Cannot benull
.- Returns:
- The operation context. May not be
null
-
scheduleOperationRemoval
Schedules the operation removal- Parameters:
handle
- The handle of the previously scheduled operation. May not benull
transactionHandle
- The handle of the context manipulaton transaction. Cannot benull
.
-
confirmOperationComputation
Confirms the computation of the given operation- Parameters:
operationContext
- The context of the operation. May not benull
transactionHandle
- The handle of the context manipulaton transaction. Cannot benull
.
-
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 benull
stage
- The target stage for the scheduling. May not benull
modalOperationController
- The modal operation controller. May not benull
- Returns:
- The operation handle for external operation referencing, may not be
null
-