Oracle® Fusion Middleware .NET API Reference for Oracle Coherence
12c (12.2.1.4.0)
E90869-02
ConditionalPut is an IEntryProcessor that sets Valueif the specified condition is satisfied.

Namespace: Tangosol.Util.Processor
Assembly: Coherence (in Coherence.dll) Version: 12.2.1.4014 (12.2.1.4014)

Syntax

C#
public class ConditionalPut : AbstractProcessor, 
	IPortableObject

Remarks

While the ConditionalPut processing could be implemented via direct key-based IQueryCache operations, it is more efficient and enforces concurrency control without explicit locking.

IInvocableCacheIConcurrentCache
filter = PresentFilter.Instance; cache.Invoke(key, new ConditionalPut(filter, value));cache.Replace(key, value);
filter = new NotFilter(PresentFilter.Instance); cache.Invoke(key, new ConditionalPut(filter, value));cache.PutIfAbsent(key, value);
filter = new EqualsFilter(IdentityExtractor.Instance, valueOld); cache.Invoke(key, new ConditionalPut(filter, valueNew));cache.Replace(key, valueOld, valueNew);

Obviously, using more specific, fine-tuned filters (rather than ones based on the IdentityExtractor may provide additional flexibility and efficiency allowing the put operation to be performed conditionally on values of specific attributes (or even calculations) instead of the entire object.

Inheritance Hierarchy

System..::..Object
  Tangosol.Util.Processor..::..AbstractProcessor
    Tangosol.Util.Processor..::..ConditionalPut

See Also