Package com._1c.g5.v8.derived.context
Class PartBasedObjectContext
- java.lang.Object
-
- com._1c.g5.v8.derived.context.BasicObjectContext
-
- com._1c.g5.v8.derived.context.PartBasedObjectContext
-
- All Implemented Interfaces:
IObjectDerivedDataContext
,IPartBasedObjectContext
- Direct Known Subclasses:
FormExtContext
,ModelUpdaterContext
public class PartBasedObjectContext extends BasicObjectContext implements IPartBasedObjectContext
Standard implementation of thePartBasedObjectContext
based on the DD part concept. Each DD part corresponds to a single DD calculation procedure performed by a complex DD part computer.
-
-
Constructor Summary
Constructors Constructor Description PartBasedObjectContext(long bmObjectId, org.eclipse.emf.ecore.EClass eClass, String segmentId, boolean removal, Object computationCause, long baseVersion)
Creates a new instance of the context.PartBasedObjectContext(Object objectId, org.eclipse.emf.ecore.EClass eClass, String segmentId, boolean removal, Object computationCause, long baseVersion)
Creates a new instance of the context.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addParts(Collection<String> parts)
Adds new DD parts to the context.void
clear()
Clears the context.protected void
clearExtendedData()
Cleans extended data of the context on full rebuild to free the resourcesprotected void
copyExtendedDataForContainments(PartBasedContainmentContext sourceContext, PartBasedContainmentContext destinationContext)
Copies extended data of the containment contextprotected PartBasedContainmentContext
createPartBasedContainmentContext(long bmObjectId)
Creates a corresponding part-based containment context.protected PartBasedObjectContext
createTopObjectContextSnapshot()
Creates snapshot instance of the current context.PartBasedContainmentContext
getContainmentContext(long bmObjectId)
Gets context for the containment object.PartBasedContainmentContext
getContainmentContext(IBmObject bmObject)
Gets context for the containment object.Collection<PartBasedContainmentContext>
getContainmentContexts()
Gets the collection containment contexts associated with this context.Set<String>
getParts()
Gets the set of DD parts being collected within this context.IObjectDerivedDataContext
getSnapshot()
Gets the snapshot of the context.protected boolean
mergeContainmentExtendedDataUpdates(PartBasedContainmentContext sourceContext, PartBasedContainmentContext destinationContext)
Merges the containment context extended dataprotected boolean
mergeExtendedDataUpdates(IObjectDerivedDataContext context)
Merges extended data updates.boolean
mergeUpdates(IObjectDerivedDataContext context)
Merges updates into the context.void
setFullRebuild(boolean fullRebuild)
Sets/resets the full rebuild designator for the context object DD.-
Methods inherited from class com._1c.g5.v8.derived.context.BasicObjectContext
getBaseVersion, getBmObjectId, getComputationCause, getEClass, getObjectId, getSegmentId, getTransactionHandle, getVersion, isFullRebuild, isRemoval, setBaseVersion, setTransactionHandle
-
-
-
-
Constructor Detail
-
PartBasedObjectContext
public PartBasedObjectContext(long bmObjectId, org.eclipse.emf.ecore.EClass eClass, String segmentId, boolean removal, Object computationCause, long baseVersion)
Creates a new instance of the context.- Parameters:
bmObjectId
- The identifier of the top BM object this context corresponds toeClass
- The EClass of the of the top BM object this context corresponds tosegmentId
- The identifier of DD segment this context belongs tocomputationCause
- The identifier of the sync. sessionbaseVersion
- The base verison of the context
-
PartBasedObjectContext
public PartBasedObjectContext(Object objectId, org.eclipse.emf.ecore.EClass eClass, String segmentId, boolean removal, Object computationCause, long baseVersion)
Creates a new instance of the context.- Parameters:
bmObjectId
- The identifier of the top BM object this context corresponds toeClass
- The EClass of the of the top BM object this context corresponds tosegmentId
- The identifier of DD segment this context belongs tocomputationCause
- The identifier of the sync. sessionbaseVersion
- The base verison of the context
-
-
Method Detail
-
addParts
public void addParts(Collection<String> parts)
Adds new DD parts to the context.- Parameters:
parts
- The DD part set that should be calculated for the object.
-
clear
public void clear()
Description copied from interface:IObjectDerivedDataContext
Clears the context. Implemenentations aren't required to be safe, the thread safety during the snapshot creation is supported by the DD context management facilities (due to complexity and performance reasons).- Specified by:
clear
in interfaceIObjectDerivedDataContext
-
getContainmentContext
public PartBasedContainmentContext getContainmentContext(IBmObject bmObject)
Gets context for the containment object.- Parameters:
bmObject
- The object to get context for.- Returns:
- The specific containment context.
-
getContainmentContext
public PartBasedContainmentContext getContainmentContext(long bmObjectId)
Gets context for the containment object.- Parameters:
bmObjectId
- The BM object identifier to get context for.- Returns:
- The specific containment context.
-
getContainmentContexts
public Collection<PartBasedContainmentContext> getContainmentContexts()
Gets the collection containment contexts associated with this context.- Returns:
- The collection of containment contexts.
-
getParts
public Set<String> getParts()
Description copied from interface:IPartBasedObjectContext
Gets the set of DD parts being collected within this context.- Specified by:
getParts
in interfaceIPartBasedObjectContext
- Returns:
- The set of DD parts scheduled for the re-computation.
-
getSnapshot
public IObjectDerivedDataContext getSnapshot()
Description copied from interface:IObjectDerivedDataContext
Gets the snapshot of the context. Implemenentations aren't required to be safe, the thread safety during the snapshot creation is supported by the DD context management facilities (due to complexity and performance reasons).- Specified by:
getSnapshot
in interfaceIObjectDerivedDataContext
- Returns:
- The current snapshot of the context state.
-
mergeUpdates
public boolean mergeUpdates(IObjectDerivedDataContext context)
Description copied from interface:IObjectDerivedDataContext
Merges updates into the context. The base version of this context is being updated according to the verison of the provided context- Specified by:
mergeUpdates
in interfaceIObjectDerivedDataContext
- Parameters:
context
- The source of updates. Cannot benull
.
-
setFullRebuild
public void setFullRebuild(boolean fullRebuild)
Description copied from interface:IObjectDerivedDataContext
Sets/resets the full rebuild designator for the context object DD.- Specified by:
setFullRebuild
in interfaceIObjectDerivedDataContext
- Overrides:
setFullRebuild
in classBasicObjectContext
- Parameters:
fullRebuild
- Full rebuild flag.
-
clearExtendedData
protected void clearExtendedData()
Cleans extended data of the context on full rebuild to free the resources
-
copyExtendedDataForContainments
protected void copyExtendedDataForContainments(PartBasedContainmentContext sourceContext, PartBasedContainmentContext destinationContext)
Copies extended data of the containment context- Parameters:
sourceContext
- Source context to copy data from. May not benull
destinationContext
- Destination context to copy data to. May not benull
-
createPartBasedContainmentContext
protected PartBasedContainmentContext createPartBasedContainmentContext(long bmObjectId)
Creates a corresponding part-based containment context. May be used to customize containment contexts in client applications- Parameters:
bmObjectId
- The BM object identifier to get context for.- Returns:
- The context. May not be
null
-
createTopObjectContextSnapshot
protected PartBasedObjectContext createTopObjectContextSnapshot()
Creates snapshot instance of the current context. Do not create snapshot of containments within this method, only data of the top object context itself must be copied- Returns:
- The snapshot instance of the current context. May not be
null
-
mergeContainmentExtendedDataUpdates
protected boolean mergeContainmentExtendedDataUpdates(PartBasedContainmentContext sourceContext, PartBasedContainmentContext destinationContext)
Merges the containment context extended data- Parameters:
sourceContext
- The source containment context. May not benull
destinationContext
- The destination containment context. May not benull
- Returns:
- True if there are changes in the destination context as a result of merge
-
mergeExtendedDataUpdates
protected boolean mergeExtendedDataUpdates(IObjectDerivedDataContext context)
Merges extended data updates.- Parameters:
context
- The context to get data from. May not benull
- Returns:
- True if changes were made during the merge of the extended updates
-
-