Package org.mockserver.state.infinispan
Class VersionedWrapper<V>
java.lang.Object
org.mockserver.state.infinispan.VersionedWrapper<V>
- Type Parameters:
V- the value type (must be serializable for Infinispan storage)
- All Implemented Interfaces:
Serializable
Wrapper that pairs a value with an explicit version number for storage in
an Infinispan cache. This enables optimistic-concurrency CAS via
cache.replace(key, oldWrapper, newWrapper) — Infinispan compares
the old value using equals(Object), which checks both the value's
identity AND the version, so a stale-version replace fails atomically.
Implements Serializable so it works with Infinispan's default
Java serialization marshaller. For phase 2c (clustering with ProtoStream),
a dedicated marshaller adapter can be added without changing this class.
- See Also:
-
Constructor Summary
Constructors -
Method Summary