Show / Hide Table of Contents

Class UpdaterProcessor

UpdaterProcessor is an IEntryProcessor implementations that updates an attribute of an object cached in an IInvocableCache.

Inheritance
object
AbstractProcessor
UpdaterProcessor
Implements
IEntryProcessor
IPortableObject
Inherited Members
AbstractProcessor.ProcessAll(ICollection)
object.Equals(object, object)
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
Namespace: Tangosol.Util.Processor
Assembly: Coherence.dll
Syntax
public class UpdaterProcessor : AbstractProcessor, IEntryProcessor, IPortableObject
Remarks

A common usage pattern is:

cache.Invoke(Key, new UpdaterProcessor(updater, value));

which is functionally equivalent to the following operation:

Object target = cache.Get(Key);
updater.update(target, value);
cache.Put(Key, target);

The major difference is that for clustered caches using the UpdaterProcessor allows avoiding explicit concurrency control and could significantly reduce the amount of network traffic.

Constructors

UpdaterProcessor()

Default constructor.

Declaration
public UpdaterProcessor()

UpdaterProcessor(string, object)

Construct an UpdaterProcessor for a given member name.

Declaration
public UpdaterProcessor(string member, object value)
Parameters
Type Name Description
string member

A member name to make a ReflectionUpdater for; this parameter can also be a dot-delimited sequence of member names which would result in using a CompositeUpdater.

object value

The value to update the target entry with.

Remarks

The member must have a single parameter of a .NET type compatible with the specified value type.

UpdaterProcessor(IValueUpdater, object)

Construct an UpdaterProcessor based on the specified IValueUpdater.

Declaration
public UpdaterProcessor(IValueUpdater updater, object value)
Parameters
Type Name Description
IValueUpdater updater

An IValueUpdater object; passing null will simpy replace the entry's value with the specified one instead of updating it.

object value

The value to update the target entry with.

Fields

m_updater

The underlying IValueUpdater.

Declaration
protected IValueUpdater m_updater
Field Value
Type Description
IValueUpdater

m_value

A value to update the entry's value with.

Declaration
protected object m_value
Field Value
Type Description
object

Methods

Equals(object)

Compare the UpdaterProcessor with another object to determine equality.

Declaration
public override bool Equals(object o)
Parameters
Type Name Description
object o

The object to compare with.

Returns
Type Description
bool

true iff this UpdaterProcessor and the passed object are equivalent UpdaterProcessor.

Overrides
object.Equals(object)

GetHashCode()

Determine a hash value for the UpdaterProcessor object according to the general GetHashCode() contract.

Declaration
public override int GetHashCode()
Returns
Type Description
int

An integer hash value for this UpdaterProcessor object.

Overrides
object.GetHashCode()

Process(IInvocableCacheEntry)

Process an IInvocableCacheEntry.

Declaration
public override object Process(IInvocableCacheEntry entry)
Parameters
Type Name Description
IInvocableCacheEntry entry

The IInvocableCacheEntry to process.

Returns
Type Description
object

The result of the processing, if any.

Overrides
AbstractProcessor.Process(IInvocableCacheEntry)

ReadExternal(IPofReader)

Restore the contents of a user type instance by reading its state using the specified IPofReader object.

Declaration
public virtual void ReadExternal(IPofReader reader)
Parameters
Type Name Description
IPofReader reader

The IPofReader from which to read the object's state.

Exceptions
Type Condition
IOException

If an I/O error occurs.

ToString()

Return a human-readable description for this UpdaterProcessor.

Declaration
public override string ToString()
Returns
Type Description
string

A String description of the UpdaterProcessor.

Overrides
object.ToString()

WriteExternal(IPofWriter)

Save the contents of a POF user type instance by writing its state using the specified IPofWriter object.

Declaration
public virtual void WriteExternal(IPofWriter writer)
Parameters
Type Name Description
IPofWriter writer

The IPofWriter to which to write the object's state.

Exceptions
Type Condition
IOException

If an I/O error occurs.

Implements

IEntryProcessor
IPortableObject
In this article
Back to top Copyright © 2000, 2024, Oracle and/or its affiliates.