Interface IEntryProcessor
EntryProcesser interface to implement the process logic for server.
Namespace:
Assembly: Alachisoft.NCache.Runtime.dll
Syntax
public interface IEntryProcessor
Methods
IgnoreLock()
If entry required by EntryProcesser is locked by the application, In case of true, lock is ignored to access the entry and method is executed.
Declaration
bool IgnoreLock()
Returns
Type | Description |
---|---|
System.Boolean | True or false depending upon the logic. |
Examples
Following examples demonstrates how to implement IgnoreLock.
public bool IgnoreLock()
{
// implement logic
return true;
}
ProcessEntry(IMutableEntry, Object[])
Contains logic to be executed on server side.
Declaration
object ProcessEntry(IMutableEntry entry, params object[] arguments)
Parameters
Type | Name | Description |
---|---|---|
IMutableEntry | entry | An instance of IMutableEntry |
System.Object[] | arguments | Arraqy of the parameters for the cache |
Returns
Type | Description |
---|---|
System.Object | Returns any required results. |
Examples
Argument list is optional. Following example demonstrates how to implement ProcessEntry.
public object ProcessEntry(IMutableEntry entry, params object[] arguments)
{
if (entry.Key.Equals("1"))
{
if (entry.Exists())
{
entry.Remove();
return 0;
}
else
{
entry.Remove();
return -1;
}
}
else if (entry.Equals("15"))
{
object value = "Greater Than 10";
entry.Value = value;
return value;
}
return 1;
}