Package com._1c.g5.v8.derived.context
Interface IContextCollectingSession
-
public interface IContextCollectingSession
Context collecting session is used as a convenience wrapper around the context management facility during operations of context collection. The session tracks down used contexts and performs transparent blocking/unblocking of target contexts.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
commit()
Commits the session, unlocking context objects being locked during the context collecting session.<T extends IObjectDerivedDataContext>
TgetExistingObjectContext(Object objectId, String segmentId)
Gets existing (previously scheduled and not yet computed) contextIObjectDerivedDataContext
getObjectContext(IBmObject bmObject, String segmentId)
Gets the object context of the provided object.Object
getServiceId()
Gets the identifier of the service that initiated the context collecting session.<T extends IObjectDerivedDataContext>
TgetTypedObjectContext(long bmObjectId, org.eclipse.emf.ecore.EClass objectEClass, String segmentId, Class<T> contextType)
Convenience method that checks the type of the internal context and casts it to the given type.<T extends IObjectDerivedDataContext>
TgetTypedObjectContext(IBmObject bmObject, String segmentId)
Convenience method that checks the type of the internal context and casts it to the given type.<T extends IObjectDerivedDataContext>
TgetTypedObjectContext(IBmObject bmObject, String segmentId, Class<T> contextType)
Convenience method that checks the type of the internal context and casts it to the given type.<T extends IObjectDerivedDataContext>
TgetTypedObjectContext(Object objectId, org.eclipse.emf.ecore.EClass objectEClass, String segmentId, Class<T> contextType)
Convenience method that checks the type of the internal context and casts it to the given type.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 segmentboolean
isEmpty()
Checks if the session has no collected contexts.void
removeOperation(IObjectDerivedDataContext handle)
Removes previously scheduled operationdefault Object
scheduleModalOperation(Consumer<org.eclipse.core.runtime.IProgressMonitor> operation, DerivedDataSegmentBucket stage, IModalOperationController modalOperationController)
Schedules a new modal operation with corresponding controllerdefault IObjectDerivedDataContext
scheduleOperation(Consumer<org.eclipse.core.runtime.IProgressMonitor> operation, OperationType operationType, boolean important, DerivedDataSegmentBucket stage)
Schedules managed operation
-
-
-
Method Detail
-
commit
void commit()
Commits the session, unlocking context objects being locked during the context collecting session.
-
getObjectContext
IObjectDerivedDataContext getObjectContext(IBmObject bmObject, String segmentId)
Gets the object context of the provided object. Effectively locks the provided context from changes via other context collecting sessions. Creates a new context if no context was collected since the last processing- Parameters:
bmObject
- The object to get the context for.segmentId
- The DD segment identifier.- Returns:
- The corresponding context for the object.
-
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 benull
segmentId
- The DD segment identifier. May not benull
- Returns:
- True if the context is exist/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 is exist/may be created
-
getServiceId
Object getServiceId()
Gets the identifier of the service that initiated the context collecting session. This identifier is used to implement complex scearios, like selective computation of DD based on events raised as a result of another DD modification.- Returns:
- The identifier of the service to check the equality against. Can be
null
,
-
getTypedObjectContext
<T extends IObjectDerivedDataContext> T getTypedObjectContext(IBmObject bmObject, String segmentId, Class<T> contextType)
Convenience method that checks the type of the internal context and casts it to the given type. Creates a new context if no context was collected since the last processing- Parameters:
bmObject
- The object to get the context for. Cannot benull
or proxysegmentId
- The DD segment identifier. May not benull
contextType
- The target type of the context. May not benull
- Returns:
- The corresponding context for the object. May not be
null
- Throws:
IllegalArgumentException
- ThrowsIllegalArgumentException
in case of type mismatch.
-
getTypedObjectContext
<T extends IObjectDerivedDataContext> T getTypedObjectContext(IBmObject bmObject, String segmentId)
Convenience method that checks the type of the internal context and casts it to the given type. Creates a new context if no context was collected since the last processing- Type Parameters:
T
- A required type of the context- Parameters:
bmObject
- A target object. May not benull
segmentId
- A target DD segment identifier. May not benull
- Returns:
- Required context if any. May not be
null
-
getTypedObjectContext
<T extends IObjectDerivedDataContext> T getTypedObjectContext(long bmObjectId, org.eclipse.emf.ecore.EClass objectEClass, String segmentId, Class<T> contextType)
Convenience method that checks the type of the internal context and casts it to the given type. ThrowsIllegalArgumentException
in case of type mismatch.- Parameters:
bmObjectId
- The identifier of the object to get the context for.objectEClass
- TheEClass
of the object to get the context for. Cannot benull
segmentId
- The DD segment identifier. Cannot benull
contextType
- The target type of the context. Cannot benull
- Returns:
- The corresponding context for the object.
-
getTypedObjectContext
<T extends IObjectDerivedDataContext> T getTypedObjectContext(Object objectId, org.eclipse.emf.ecore.EClass objectEClass, String segmentId, Class<T> contextType)
Convenience method that checks the type of the internal context and casts it to the given type. Creates a new context if no context was collected since the last processing- Parameters:
bmObjectId
- The identifier of the object to get the context for.objectEClass
- TheEClass
of the object to get the context for. Cannot benull
segmentId
- The DD segment identifier. May not benull
contextType
- The target type of the context. May not benull
- Returns:
- The corresponding context for the object. May not be
null
- Throws:
IllegalArgumentException
- ThrowsIllegalArgumentException
in case of type mismatch.
-
getExistingObjectContext
<T extends IObjectDerivedDataContext> T getExistingObjectContext(Object objectId, String segmentId)
Gets existing (previously scheduled and not yet computed) context- Type Parameters:
T
- A required type of the context- Parameters:
objectId
- A target object identifier. May not benull
segmentId
- A target DD segment identifier. May not benull
- Returns:
- Required context if any.
null
if no object exists
-
isEmpty
boolean isEmpty()
Checks if the session has no collected contexts.- Returns:
- True if the session has no collected contexts; false otherwise.
-
scheduleOperation
default IObjectDerivedDataContext scheduleOperation(Consumer<org.eclipse.core.runtime.IProgressMonitor> operation, OperationType operationType, boolean important, DerivedDataSegmentBucket stage)
Schedules managed operation- Parameters:
operation
- The oepration executable logic to schedule. May not benull
operationType
- The type of the operation. May not benull
important
-stage
- The target stage of the async pipeline. May not benull
-
removeOperation
void removeOperation(IObjectDerivedDataContext handle)
Removes previously scheduled operation- Parameters:
handle
- The operation handle. May not benull
-
scheduleModalOperation
default Object scheduleModalOperation(Consumer<org.eclipse.core.runtime.IProgressMonitor> operation, DerivedDataSegmentBucket stage, IModalOperationController modalOperationController)
Schedules a new modal operation with corresponding controller- Parameters:
operation
- The operation executable to schedule. May not benull
stage
- The target stage of the operation. May not benull
modalOperationController
- The modal operation controller. May not benull
- Returns:
- The handle of the scheduled operation. May not be
null
-
-