Status: Coding In Progress (View Workflow)
Major refactorization of the write command with the following goals:
-> Base WriteCommand: all the write command has the same workflow through the interceptor chain
-> Create a concrete WriteCommand for each operation (put, remove, replace, replaceIfEquals, removeIfEquals, putIfAbsent)
-> Extend the interceptor chain to process each one of the command and add a new "visitWriteCommand", that is invoked by the default visitX methods.
-> (minor) change the GetKeyValueCommand to ReadCommand to make name "compatible" with WriteCommand.
Note that most of the interceptor only needs to implement the visitWriteCommand because all the write command has the same execution flow. The basic flow of the write commands are: (non-tx) lock, fetch value (cachestore/remote), check condition and apply change. for tx mode, lock (if pessimistic), fetch value (cache loader, remote, etc), apply change and add it to the transaction (if successful)
Also, another advantage is the simplification of the EntryFactory because if we think a little about it, independent of the write command we need to wrap the entry anyway.
- Concrete implementations*
- Special base class for operation with expected value to compare*
ps: I'm going to open the discussion in the dev mailing list...