Package org.infinispan.transaction.impl
Class ModificationList
java.lang.Object
org.infinispan.transaction.impl.ModificationList
A list of
WriteCommand
for a transaction
WriteCommand
can only be appended and the methods getAllModifications()
and getModifications()
return a snapshot of the current list. WriteCommand
appended after those methods are
invoked, are not visible.
- Since:
- 14.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
append
(org.infinispan.commands.write.WriteCommand command) Appends theWriteCommand
to this list.void
freeze()
Freezes this list.static ModificationList
fromCollection
(Collection<org.infinispan.commands.write.WriteCommand> mods) List<org.infinispan.commands.write.WriteCommand>
List<org.infinispan.commands.write.WriteCommand>
Returns a snapshot of this list.boolean
boolean
isEmpty()
int
size()
toString()
-
Constructor Details
-
ModificationList
public ModificationList() -
ModificationList
public ModificationList(int capacity)
-
-
Method Details
-
fromCollection
public static ModificationList fromCollection(Collection<org.infinispan.commands.write.WriteCommand> mods) -
append
public void append(org.infinispan.commands.write.WriteCommand command) Appends theWriteCommand
to this list.- Parameters:
command
- TheWriteCommand
instance to append.- Throws:
IllegalStateException
- If this list is frozen.- See Also:
-
freeze
public void freeze()Freezes this list.After invoked, no more
WriteCommand
can be appended to this list.append(WriteCommand)
will throw aIllegalStateException
. -
getModifications
Returns a snapshot of this list.This snapshot does not contain
WriteCommand
with flagFlag.CACHE_MODE_LOCAL
and it cannot be modified.- Returns:
- A snapshot of this list.
-
hasNonLocalModifications
public boolean hasNonLocalModifications()- Returns:
true
if it contains one or moreWriteCommand
withoutFlag.CACHE_MODE_LOCAL
.
-
getAllModifications
- Returns:
- A snapshot of this list with all
WriteCommand
. TheList
cannot be modified. - See Also:
-
size
public int size()- Returns:
- The number of
WriteCommand
stored this list.
-
isEmpty
public boolean isEmpty()- Returns:
true
if this list is empty.
-
toString
-