Class ContextBatchOperations
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionmerge(Collection<ContextBatch> batchesToMerge) Merges context batches into a single context batch.subtract(ContextBatch operand, Collection<ContextBatch> batchesToSubtract) Subtract ContextBatches from the supplied operand, creating a new ContextBatch (unless there are no batches to subtract in which case the supplied operand is returned unchanged).
-
Constructor Details
-
ContextBatchOperations
public ContextBatchOperations()
-
-
Method Details
-
merge
Merges context batches into a single context batch.Note:you can only merge batches if all batches do not have any excluded contexts. The problem is that with excluded contexts you can't know if the batch you are merging with should have resources (and resource parameters) removed and you are therefore going to end up with a merged batch with a potentially wrong hash. (See
ContextBatch)- Parameters:
batchesToMerge- - one or more batches to merge together- Returns:
- a single context batch which is the result of merging all the supplied batches.
- Throws:
IllegalArgumentException- if any of the batches have excludedContexts
-
subtract
Subtract ContextBatches from the supplied operand, creating a new ContextBatch (unless there are no batches to subtract in which case the supplied operand is returned unchanged).Subtraction for a ContextBatch means the removal of any WebResourceModuleDescriptor that exist within the ContextBatch being subtracted. Consequently it also means that some PluginResourceBatchParams may also be removed (if there is no longer an applicable PluginResource).
Note:you can only subtract batches if all batches do not have any excluded contexts. The problem is that with excluded contexts you end up with the possibility of subtracting a subtracted context. And since the already subtracted context no longer has reference to the WebResourceModuleDescriptor it caused to be removed you cannot ensure that the resultant ContextBatch also has them removed.
- Parameters:
operand- the ContextBatch to be operated uponbatchesToSubtract- the ContextBatches to be subtracted.- Returns:
- the ContextBatch resulting in subtracting the batchesToSubtract.
- Throws:
IllegalArgumentException- if any of the batchesToSubtract already have excluded contexts.
-