Class ComparisonManager
java.lang.Object
com._1c.g5.v8.dt.internal.compare.ComparisonManager
- All Implemented Interfaces:
IResourcePlan
,IComparisonManager
,ISymlinkTranslator
,IComparisonProcessController
,IBatchComparisonRunner
,IMergeProcessor
,IManagedService
@LifecycleService(name="COMPARISON_MANAGER")
public class ComparisonManager
extends Object
implements IComparisonManager, IComparisonProcessController, IBatchComparisonRunner, IMergeProcessor, ISymlinkTranslator, IResourcePlan
Default implementation of the comparison manager.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com._1c.g5.v8.dt.compare.core.IComparisonManager
IComparisonManager.ICompareMergeStatusListener
-
Field Summary
FieldsFields inherited from interface com._1c.g5.v8.dt.compare.core.IComparisonManager
SERVICE_NAME
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
ableToBreakCorrespondence
(ComparisonProcessHandle handle, ComparisonNode node) Checks if there is a participant able to break a correspondence stored in the specified node.void
activate()
addNewTopObjectToComparison
(IComparisonSession comparisonSession, String mainSymlink, org.eclipse.emf.ecore.EClass eClass) Adds a new object to the comparison.void
Adds a comparison status listener.org.eclipse.emf.ecore.EStructuralFeature
adoptMainSideFeature
(org.eclipse.emf.ecore.EStructuralFeature mainSideFeature, IComparisonSession session) Converts, if possible, the main side feature into a other supported by the other side object.void
breakCorrespondence
(ComparisonContext comparisonContext, ComparisonNode node) Breaks correspondence represented by the specified model node with the help of a participant supporting this operation.void
breakMainSideCorrespondence
(IComparisonSession comparisonSession, ComparisonNode node) Breaks main side correspondence represented by the specified model node with the help of a participant supporting this operation.void
cancel
(ComparisonProcessHandle handle) Cancels the compare/merge process defined by the specified handle and discards its comparison session.void
Checks the comparison for the memory overload.void
combineOneSideNodes
(ComparisonContext comparisonContext, ComparisonNode mainNode, ComparisonNode otherNode, List<Long> newNodeIds) Combines two complementing one-side nodes with the help of a participant supporting this operation.void
compare
(long topNodeId, ComparisonSession session, org.eclipse.core.runtime.IProgressMonitor monitor) Compares the specified result node of the specified session.void
Notifies the controller about finishing of all comparison processes of the specified batch.void
deserializeMergeSettings
(ComparisonProcessHandle handle, String mergeSettingsFileName) Reads the merge settings for the given comparison process from a xml-file or zip-file.Proclaim demands of resources for a given set of activities.getComparedObjects
(IComparisonSession comparisonSession, ComparisonNode node, ComparisonContext comparisonContext) Returns compared objects for the specified node.Returns the comparison session for the specified comparison process handle.getDefaultMergeRule
(ComparisonNode node, IComparisonSession session) Returns the default merge rule for the given node.getDefaultMustBeMerged
(ComparisonNode node, IComparisonSession session) Returns the default must be merged value for the given node.getHandles
(IV8Project v8Project) Returns handles of all sides of a comparison process with the specified V8 project.getMatchingSymlinks
(ComparisonNode node, org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EReference reference, ComparisonSide sourceSide, String symlink, ComparisonContext comparisonContext, IMergeSession mergeSession) For the specified symbolic link in the specified context on the specified side ("source side"), returns an object with this link on the specified target side and symbolic links (within the same context) of objects corresponding to the source object in the comparison model.getMatchingSymlinksToTopObject
(ComparisonContext comparisonContext, String symlink, ComparisonSide side, IMergeSession mergeSession) Returns matched symlinks to the top object with the given symlink on a given comparison side.Returns a list of all merge problems found during merge validation and merge using external tool phases.getPotentialCorrespondingNodes
(ComparisonProcessHandle handle, ComparisonNode node, ComparisonSide sourceSide) Returns a list of candidate nodes for setting as corresponding to the specified node.getPotentialMergeProblemsDescriptions
(ComparisonNode node, ComparisonContext comparisonContext) Returns human-readable descriptions of merge problems of the specified node.getStatus
(ComparisonProcessHandle handle) Returns the status of a comparison process managed by this.boolean
Tells if there any active comparison being executed at the moment.boolean
isCandidateForPotentialMergeProblems
(ComparisonNode node, IComparisonSession session) Tells whether the given node may break the configuration if it is merged.boolean
isExcludedFromComparison
(org.eclipse.emf.ecore.EStructuralFeature feature, AbstractComparedEmfObjects<?> comparedContextObjects, IComparisonSession session) Checks whether the feature is to be excluded from the comparison via any of existing comparison participants.void
link()
Participates thelinking
phase. Performs initialization steps only once, no matter how many times it is invoked.void
onResourceUnloading
(ProjectContext context) Participates theresource unloading
phase. For more information seeLifecyclePhase.RESOURCE_UNLOADING
.org.eclipse.core.runtime.IStatus
performComparisonProcess
(ComparisonProcessHandle handle, org.eclipse.core.runtime.IProgressMonitor monitor) Performs the process of comparison for the specified handle.org.eclipse.core.runtime.IStatus
performMergeProcess
(CompareMergeProcessBatch batch, org.eclipse.core.runtime.IProgressMonitor monitor) Performs merging for the specified compare/merge processes batch.void
Removes a comparison status listener.void
restoreCustomSettings
(ComparisonNode node, SerializableMergeSettings container, IComparisonSession session) Restores custom settings for the specified node from the given merge settings container.void
Runs the comparison of the given batch.<T> T
runComparisonTreeBmModelReadonlyTask
(IComparisonSession session, IBmTask<T> task) Executes the given read-only BM task in a comparison tree BM model of the specified session.<T> T
runComparisonTreeBmModelTask
(IComparisonSession session, IBmTask<T> task) Executes the given BM task in a comparison tree BM model of the specified session.void
saveCustomSettings
(ComparisonNode node, SerializableMergeSettings container, IComparisonSession session) Saves custom settings for the specified node into the given merge settings container.void
serializeMergeSettings
(Collection<ComparisonProcessHandle> handles, String mergeSettingsFileName) Serializes the merge settings for the given comparison session/-s to a zip-file.void
setStrictOverloadCheckMode
(boolean strict) Sets/resets the strict mode for the memory overload checks.void
shutdown()
Performs the shutdown.void
Schedules asynchronous job that will start the comparison of projects specified by the given batch of compare/merge processes.org.eclipse.core.runtime.IStatus
startMerge
(CompareMergeProcessBatch batch, org.eclipse.core.runtime.IProgressMonitor monitor) Schedules asynchronous job that will merge changes detected in the specified batch of compare/merge processes.void
stop
(ComparisonProcessHandle handle) Forgets the compare/merge process defined by the specified handle and discards its comparison session.boolean
supportsCustomMerging
(IComparisonSession session, ComparisonNode node) Tells whether the given node supports custom merging.boolean
supportsMergingUsingExternalTool
(IComparisonSession session, ComparisonNode node) Tells whether the given node supports merging using external tool.boolean
supportsPrioritizedMerging
(IComparisonSession session, ComparisonNode node) Tells whether the given node supports prioritized merging.translateForImport
(IMergeSession mergeSession, ComparisonNode node, org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EReference reference, String symlink, ComparisonContext comparisonContext) Translates the specified symbolic link referencing an object on the OTHER side of comparison for the purposes of import, that is, when the reference is situated in an imported other object.void
updateComparison
(ComparisonContext comparisonContext, ComparisonNode node, List<Long> newNodeIds) Updates the comparison results for a given object.
-
Field Details
-
EXTENSION_POINT_ID
- See Also:
-
COMPARISON_JOB_FAMILY
- See Also:
-
-
Constructor Details
-
ComparisonManager
public ComparisonManager()Constructs an instance of the comparison manager.
-
-
Method Details
-
activate
public void activate()- Specified by:
activate
in interfaceIManagedService
-
addStatusListener
Description copied from interface:IComparisonManager
Adds a comparison status listener.- Specified by:
addStatusListener
in interfaceIComparisonManager
- Parameters:
listener
- the status listener, notnull
-
compare
public void compare(long topNodeId, ComparisonSession session, org.eclipse.core.runtime.IProgressMonitor monitor) Description copied from interface:IComparisonProcessController
Compares the specified result node of the specified session.- Specified by:
compare
in interfaceIComparisonProcessController
- Parameters:
topNodeId
- the top node idsession
- the comparison sessionmonitor
- the progress monitor
-
deactivate
public void deactivate()- Specified by:
deactivate
in interfaceIManagedService
-
getHandles
Description copied from interface:IComparisonManager
Returns handles of all sides of a comparison process with the specified V8 project.- Specified by:
getHandles
in interfaceIComparisonManager
- Parameters:
v8Project
- the V8 project, notnull
- Returns:
- the handles, never
null
-
getStatus
Description copied from interface:IComparisonManager
Returns the status of a comparison process managed by this.- Specified by:
getStatus
in interfaceIComparisonManager
- Parameters:
handle
- the handle of comparison, notnull
- Returns:
- the status of comparison, may be
null
in case if the handle is not known to this
-
hasActiveComparison
public boolean hasActiveComparison()Description copied from interface:IComparisonManager
Tells if there any active comparison being executed at the moment.- Specified by:
hasActiveComparison
in interfaceIComparisonManager
- Returns:
true
if any comparison is being executed,false
otherwise
-
performComparisonProcess
public org.eclipse.core.runtime.IStatus performComparisonProcess(ComparisonProcessHandle handle, org.eclipse.core.runtime.IProgressMonitor monitor) Description copied from interface:IComparisonProcessController
Performs the process of comparison for the specified handle.- Specified by:
performComparisonProcess
in interfaceIComparisonProcessController
- Parameters:
handle
- the comparison process handle, cannot benull
monitor
- the progress monitor, cannot benull
- Returns:
- the resulting status of the comparison process, never
null
-
comparisonFinished
Description copied from interface:IComparisonProcessController
Notifies the controller about finishing of all comparison processes of the specified batch.- Specified by:
comparisonFinished
in interfaceIComparisonProcessController
- Parameters:
batch
- the batch whose comparison was finished, cannot benull
-
removeStatusListener
Description copied from interface:IComparisonManager
Removes a comparison status listener.- Specified by:
removeStatusListener
in interfaceIComparisonManager
- Parameters:
listener
- the status listener, notnull
-
startComparison
Description copied from interface:IComparisonManager
Schedules asynchronous job that will start the comparison of projects specified by the given batch of compare/merge processes.- Specified by:
startComparison
in interfaceIComparisonManager
- Parameters:
batch
- the batch of compare/merge processes to start comparison for, cannot benull
or empty
-
runComparison
Description copied from interface:IBatchComparisonRunner
Runs the comparison of the given batch.- Specified by:
runComparison
in interfaceIBatchComparisonRunner
- Parameters:
batch
- the batch to run comparison for, cannot benull
or empty
-
stop
Description copied from interface:IComparisonManager
Forgets the compare/merge process defined by the specified handle and discards its comparison session. Stops the whole batch of compare/merge processes this handle relates to if this batch is under active comparison. Does nothing if the process in under active merge.- Specified by:
stop
in interfaceIComparisonManager
- Parameters:
handle
- the handle, notnull
-
cancel
Description copied from interface:IComparisonManager
Cancels the compare/merge process defined by the specified handle and discards its comparison session. Stops the whole batch of compare/merge processes this handle relates to if this batch is under active comparison. Does nothing if the process in under active merge or merge already performed.- Specified by:
cancel
in interfaceIComparisonManager
- Parameters:
handle
- the handle, notnull
-
startMerge
public org.eclipse.core.runtime.IStatus startMerge(CompareMergeProcessBatch batch, org.eclipse.core.runtime.IProgressMonitor monitor) Description copied from interface:IComparisonManager
Schedules asynchronous job that will merge changes detected in the specified batch of compare/merge processes.NOTE that it is not possible to schedule the job if the processes in the batch have not yet been fully compared.
- Specified by:
startMerge
in interfaceIComparisonManager
- Parameters:
batch
- the batch of compare/merge processes to start merge for, cannot benull
or emptymonitor
- the progress monitor, may benull
- Returns:
Status.OK_STATUS
if the merge job has been successfully scheduled, an error status otherwise
-
getMergeProblems
Description copied from interface:IComparisonManager
Returns a list of all merge problems found during merge validation and merge using external tool phases. The list will be empty if no problems found.NOTE that this method may only be called for processes that are in the
ComparisonProcessStatus.MERGE_PROCESS_USING_EXTERNAL_TOOL_FINISHED
orComparisonProcessStatus.MERGE_PROCESS_VALIDATION_FINISHED
state, and an exception will be thrown otherwise.- Specified by:
getMergeProblems
in interfaceIComparisonManager
- Parameters:
handle
- the handle of the comparison process to get merge problems of, cannot benull
- Returns:
- a list of merge problems, never
null
-
performMergeProcess
public org.eclipse.core.runtime.IStatus performMergeProcess(CompareMergeProcessBatch batch, org.eclipse.core.runtime.IProgressMonitor monitor) Description copied from interface:IMergeProcessor
Performs merging for the specified compare/merge processes batch.- Specified by:
performMergeProcess
in interfaceIMergeProcessor
- Parameters:
batch
- the compare/merge processes batch to perform merge on, notnull
monitor
- the progress monitor, notnull
- Returns:
- the result merging status, never
null
-
getComparisonSession
Description copied from interface:IComparisonManager
Returns the comparison session for the specified comparison process handle.- Specified by:
getComparisonSession
in interfaceIComparisonManager
- Parameters:
handle
- the handle, notnull
- Returns:
- the session, may be
null
if the handle is not known to the manager
-
getPotentialCorrespondingNodes
public List<ComparisonNode> getPotentialCorrespondingNodes(ComparisonProcessHandle handle, ComparisonNode node, ComparisonSide sourceSide) Description copied from interface:IComparisonManager
Returns a list of candidate nodes for setting as corresponding to the specified node.- Specified by:
getPotentialCorrespondingNodes
in interfaceIComparisonManager
- Parameters:
handle
- the comparison process handle, notnull
node
- the comparison result node to find potential correspondences for, notnull
sourceSide
- the source side of the correspondence, notnull
- Returns:
- a list of comparison result nodes, never
null
-
ableToBreakCorrespondence
Description copied from interface:IComparisonManager
Checks if there is a participant able to break a correspondence stored in the specified node.- Specified by:
ableToBreakCorrespondence
in interfaceIComparisonManager
- Parameters:
handle
- the comparison process handle, notnull
node
- the node to check whether the correspondence represented by it can be broken, notnull
- Returns:
true
if at least one participant is able to break the correspondence, andfalse
otherwise
-
breakCorrespondence
Breaks correspondence represented by the specified model node with the help of a participant supporting this operation.- Parameters:
comparisonContext
- the comparison context, cannot benull
node
- the node with the correspondence to break, cannot benull
-
updateComparison
public void updateComparison(ComparisonContext comparisonContext, ComparisonNode node, List<Long> newNodeIds) Updates the comparison results for a given object. Usually it's a reset of already available object, etc.- Parameters:
comparisonContext
- the comparison context. Cannot benull
.node
- The node to update comparison information for. Cannot benull
.newNodeIds
- the list of created new node Ids to fill by participants, notnull
-
addNewTopObjectToComparison
public TopComparisonNode addNewTopObjectToComparison(IComparisonSession comparisonSession, String mainSymlink, org.eclipse.emf.ecore.EClass eClass) Adds a new object to the comparison.- Parameters:
comparisonSession
- The session to update into. Cannot benull
.mainSymlink
- the main symlinkeClass
- the e class- Returns:
- the new top node created.
-
combineOneSideNodes
public void combineOneSideNodes(ComparisonContext comparisonContext, ComparisonNode mainNode, ComparisonNode otherNode, List<Long> newNodeIds) Combines two complementing one-side nodes with the help of a participant supporting this operation.- Parameters:
comparisonContext
- the comparison context, cannot benull
mainNode
- the one-side MAIN node, cannot benull
otherNode
- the one-side OTHER node, cannot benull
newNodeIds
- the list of new node Ids to fill by participants, notnull
-
getComparedObjects
public IComparedObjects<?> getComparedObjects(IComparisonSession comparisonSession, ComparisonNode node, ComparisonContext comparisonContext) Returns compared objects for the specified node.- Parameters:
comparisonSession
- the comparison session, cannot benull
node
- the node to get the compared objects for, cannot benull
comparisonContext
- the current comparison context, cannot benull
- Returns:
- the compared objects
-
getMatchingSymlinks
public IMatchingSymlinks getMatchingSymlinks(ComparisonNode node, org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EReference reference, ComparisonSide sourceSide, String symlink, ComparisonContext comparisonContext, IMergeSession mergeSession) Description copied from interface:ISymlinkTranslator
For the specified symbolic link in the specified context on the specified side ("source side"), returns an object with this link on the specified target side and symbolic links (within the same context) of objects corresponding to the source object in the comparison model.- Specified by:
getMatchingSymlinks
in interfaceISymlinkTranslator
- Parameters:
node
- the comparison result nodeeObject
- the EObject containing the symbolic linkreference
- the reference of the linksourceSide
- the source sidesymlink
- the source symbolic linkcomparisonContext
- the current comparison context, cannot benull
mergeSession
- the merge session ornull
- Returns:
- an object with matching symbolic links where the source symbolic is on the source side
-
getMatchingSymlinksToTopObject
public IMatchingSymlinks getMatchingSymlinksToTopObject(ComparisonContext comparisonContext, String symlink, ComparisonSide side, IMergeSession mergeSession) Description copied from interface:ISymlinkTranslator
Returns matched symlinks to the top object with the given symlink on a given comparison side.- Specified by:
getMatchingSymlinksToTopObject
in interfaceISymlinkTranslator
- Parameters:
comparisonContext
- the comparison context, cannot benull
symlink
- the top object symlink to be matched, cannot benull
side
- the comparison side where the top object lies, cannot benull
mergeSession
- the merge session, can benull
if no merge process run- Returns:
- the triple of matched symlinks or
null
if no matched symlinks found
-
translateForImport
public String translateForImport(IMergeSession mergeSession, ComparisonNode node, org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EReference reference, String symlink, ComparisonContext comparisonContext) Description copied from interface:ISymlinkTranslator
Translates the specified symbolic link referencing an object on the OTHER side of comparison for the purposes of import, that is, when the reference is situated in an imported other object. An object is imported if it is present only on the OTHER side of comparison and is merged according to the merge settings. The translated symlink, if the original symlink was referencing an object having a correspondence on the MAIN side of comparison, will be the same as in thegetMatchingSymlinks
method. If the symlink was pointing to an object not present on the MAIN side but imported in the specified session (or an object derived from one), the result will take into account the closest existing parent correspondence.- Specified by:
translateForImport
in interfaceISymlinkTranslator
- Parameters:
mergeSession
- the merge sessionnode
- the comparison result nodeeObject
- the EObject containing the symbolic linkreference
- the reference of the linksymlink
- the symbolic link on the other sidecomparisonContext
- the current comparison context, cannot benull
- Returns:
- the symlink in terms of the main side after import
-
getDefaultMustBeMerged
Returns the default must be merged value for the given node.- Parameters:
node
- the node to get default must be merged value for, can not benull
session
- the comparison session, can not benull
- Returns:
- the default must be merged value or
null
if it wasn't specified
-
runComparisonTreeBmModelTask
Executes the given BM task in a comparison tree BM model of the specified session.- Type Parameters:
T
- the generic type- Parameters:
session
- the session, cannot benull
task
- the task to execute, cannot benull
- Returns:
- the result returned by
IBmTask.execute(IBmTransaction, IProgressMonitor)
method
-
runComparisonTreeBmModelReadonlyTask
Executes the given read-only BM task in a comparison tree BM model of the specified session.- Type Parameters:
T
- the generic type- Parameters:
session
- the session, cannot benull
task
- the task to execute, cannot benull
- Returns:
- the result returned by
IBmTask.execute(IBmTransaction, IProgressMonitor)
method
-
supportsPrioritizedMerging
Tells whether the given node supports prioritized merging.- Parameters:
session
- the session, cannot benull
node
- the node to check, cannot benull
- Returns:
true
if the node supports prioritized merging,false
otherwise
-
supportsCustomMerging
Tells whether the given node supports custom merging.- Parameters:
session
- the session, cannot benull
node
- the node to check, cannot benull
- Returns:
true
if the node supports custom merging,false
otherwise
-
supportsMergingUsingExternalTool
Tells whether the given node supports merging using external tool.- Parameters:
session
- the comparison session, cannot benull
node
- the comparison node to check, cannot benull
- Returns:
true
if the node supports merging using external tool,false
otherwise
-
breakMainSideCorrespondence
Breaks main side correspondence represented by the specified model node with the help of a participant supporting this operation.- Parameters:
comparisonSession
- the session in which to break correspondence, can not be {@code null{ @param node the node with the correspondence to break, can not be {@code null}
-
gatherActivities
Description copied from interface:IResourcePlan
Proclaim demands of resources for a given set of activities.- Specified by:
gatherActivities
in interfaceIResourcePlan
- Returns:
- Returns
IActivityDemandsDefinition
mapped to respective name of the activity.
-
isExcludedFromComparison
public boolean isExcludedFromComparison(org.eclipse.emf.ecore.EStructuralFeature feature, AbstractComparedEmfObjects<?> comparedContextObjects, IComparisonSession session) Checks whether the feature is to be excluded from the comparison via any of existing comparison participants.- Parameters:
feature
- the feature to check, cannot benull
comparedContextObjects
- the triple of compared objects, cannot benull
session
- the comparison session, cannot benull
- Returns:
true
if the feature is to be excluded,false
otherwise
-
getDefaultMergeRule
Returns the default merge rule for the given node.- Parameters:
node
- the node to get default merge rule for, can not benull
session
- the comparison session, can not benull
- Returns:
- the default merge rule or
null
if it wasn't specified
-
isCandidateForPotentialMergeProblems
public boolean isCandidateForPotentialMergeProblems(ComparisonNode node, IComparisonSession session) Tells whether the given node may break the configuration if it is merged.- Parameters:
node
- the node to check, cannot benull
session
- the comparison session, cannot benull
- Returns:
true
if the node may break the configuration,false
otherwise
-
getPotentialMergeProblemsDescriptions
public List<PotentialMergeProblemDescription> getPotentialMergeProblemsDescriptions(ComparisonNode node, ComparisonContext comparisonContext) Returns human-readable descriptions of merge problems of the specified node.- Parameters:
node
- the node to get merge problems descriptions for, cannot benull
comparisonContext
- the comparison context, cannot benull
- Returns:
- the list of descriptions, never
null
, can be empty if the node doesn't bring any merge problems
-
saveCustomSettings
public void saveCustomSettings(ComparisonNode node, SerializableMergeSettings container, IComparisonSession session) Saves custom settings for the specified node into the given merge settings container. Does nothing if the node doesn't have any custom settings.- Parameters:
node
- the comparison node to save custom settings for, cannot benull
container
- the container of serializable settings, cannot benull
session
- the comparison session, cannot benull
-
restoreCustomSettings
public void restoreCustomSettings(ComparisonNode node, SerializableMergeSettings container, IComparisonSession session) Restores custom settings for the specified node from the given merge settings container.- Parameters:
node
- the comparison node to restore custom settings for, cannot benull
container
- the container of serialized settings, cannot benull
session
- the comparison session, cannot benull
-
adoptMainSideFeature
public org.eclipse.emf.ecore.EStructuralFeature adoptMainSideFeature(org.eclipse.emf.ecore.EStructuralFeature mainSideFeature, IComparisonSession session) Converts, if possible, the main side feature into a other supported by the other side object. Returns the given main side feature if no convert was found.- Parameters:
mainSideFeature
- the main side feature to convert, cannot benull
session
- the comparison session, cannot benull
- Returns:
- the converted feature applicable for other side object or given main side feature
if no convert was found, never
null
-
checkForOverload
public void checkForOverload()Checks the comparison for the memory overload. Throws aComparisonMemoryOverloadException
in case of check failure and the strict mode is being enabled.- See Also:
-
setStrictOverloadCheckMode
public void setStrictOverloadCheckMode(boolean strict) Sets/resets the strict mode for the memory overload checks.- Parameters:
strict
- The strict mode
-
link
Participates thelinking
phase. Performs initialization steps only once, no matter how many times it is invoked. -
shutdown
public void shutdown()Performs the shutdown.We do not call this method on unlinking phase as unlinking can be executed a few times per EDT session whereas this method must be executed exactly once.
-
onResourceUnloading
@LifecycleParticipant(phase=RESOURCE_UNLOADING, dependsOn="BM_MODEL_MANAGER") public void onResourceUnloading(ProjectContext context) Participates theresource unloading
phase. For more information seeLifecyclePhase.RESOURCE_UNLOADING
.- Parameters:
context
- the project context, cannot benull
.- See Also:
-
serializeMergeSettings
public void serializeMergeSettings(Collection<ComparisonProcessHandle> handles, String mergeSettingsFileName) throws IOException Description copied from interface:IComparisonManager
Serializes the merge settings for the given comparison session/-s to a zip-file.- Specified by:
serializeMergeSettings
in interfaceIComparisonManager
- Parameters:
handles
- the comparison process handles to serialize merge settings for, cannot be or emptymergeSettingsFileName
- the merge settings file name, cannot benull
- Throws:
IOException
- if a file serialization error occurred
-
deserializeMergeSettings
public RestoredMergeSettings deserializeMergeSettings(ComparisonProcessHandle handle, String mergeSettingsFileName) throws FileNotFoundException, IOException, InvalidPreferencesFormatException Description copied from interface:IComparisonManager
Reads the merge settings for the given comparison process from a xml-file or zip-file.- Specified by:
deserializeMergeSettings
in interfaceIComparisonManager
- Parameters:
handle
- the comparison process handle to read merge settings for, cannot benull
mergeSettingsFileName
- the merge settings file name, may benull
- Returns:
- the restored merge settings, can be
null
- Throws:
FileNotFoundException
- if the file does not exist, is a directory rather than a regular file, or for some other reason cannot be opened forreadingIOException
- if an input/output operation was failed or interaptedInvalidPreferencesFormatException
- unsupported version of input file serialization format
-