Class UpdaterProcessor
UpdaterProcessor is an IEntryProcessor implementations that updates an attribute of an object cached in an IInvocableCache.
Inherited Members
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 |
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
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
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
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
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. |