|
Oracle® Coherence Java API Reference Release 12.1.2.0.3 E26043-02 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.tangosol.util.Base
com.tangosol.util.BitHelper
com.tangosol.util.ExternalizableHelper
com.tangosol.util.filter.FilterTrigger
public class FilterTrigger
A generic Filter-based MapTrigger implementation. If an evaluation of the Entry
object representing a pending change fails (returns false), then one of the following actions is taken:
Entry.getOriginalValue()
method;Entry.remove(true)
call.Note: This trigger never prevents entries from being removed.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.tangosol.util.MapTrigger |
---|
MapTrigger.Entry |
Field Summary | |
---|---|
static int |
ACTION_IGNORE Evaluation failure results in restoring the original Entry's value. |
static int |
ACTION_REMOVE Evaluation failure results in a removal of the entry. |
static int |
ACTION_ROLLBACK Evaluation failure results in an IllegalArgumentException thrown by the trigger. |
protected Filter |
m_filter The underlying filter. |
protected int |
m_nAction The action code. |
Constructor Summary | |
---|---|
FilterTrigger() Default constructor (necessary for the ExternalizableLite interface). |
|
FilterTrigger(Filter filter) Construct a FilterTrigger based on the specified Filter object and ACTION_ROLLBACK. |
|
FilterTrigger(Filter filter, int nAction) Construct a FilterTrigger based on the specified Filter object and the action constant. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o) Compare the FilterTrigger with another object to determine equality. |
int |
getAction() Obtain the action code for this FilterTrigger. |
Filter |
getFilter() Obtain the underlying Filter. |
int |
hashCode() Determine a hash value for the FilterTrigger object according to the general Object.hashCode() contract. |
void |
process(MapTrigger.Entry entry) This method is called before the result of a mutating operation represented by the specified Entry object is committed into the underlying map. |
void |
readExternal(java.io.DataInput in) Restore the contents of this object by loading the object's state from the passed DataInput object. |
void |
readExternal(PofReader in) Restore the contents of a user type instance by reading its state using the specified PofReader object. |
java.lang.String |
toString() Return a human-readable description for this FilterTrigger. |
void |
writeExternal(java.io.DataOutput out) Save the contents of this object by storing the object's state into the passed DataOutput object. |
void |
writeExternal(PofWriter out) Save the contents of a POF user type instance by writing its state using the specified PofWriter object. |
Methods inherited from class com.tangosol.util.BitHelper |
---|
countBits, countBits, countBits, indexOfLSB, indexOfLSB, indexOfLSB, indexOfMSB, indexOfMSB, indexOfMSB, rotateLeft, rotateLeft, rotateLeft, rotateRight, rotateRight, rotateRight, toBitString, toBitString, toBitString |
Field Detail |
---|
public static final int ACTION_ROLLBACK
public static final int ACTION_IGNORE
public static final int ACTION_REMOVE
protected Filter m_filter
protected int m_nAction
Constructor Detail |
---|
public FilterTrigger()
public FilterTrigger(Filter filter)
filter
- the underlying Filterpublic FilterTrigger(Filter filter, int nAction)
filter
- the underlying FilternAction
- one of the ACTION_* constantsMethod Detail |
---|
public void process(MapTrigger.Entry entry)
An implementation of this method can evaluate the change by analyzing the original and the new value, and can perform any of the following:
InvocableMap.Entry.setValue(java.lang.Object)
with a different value;MapTrigger.Entry.getOriginalValue()
;InvocableMap.Entry.remove(boolean)
;process
in interface MapTrigger
entry
- a MapTrigger.Entry
object that represents the pending change to be committed to the map, as well as the original state of the Entrypublic Filter getFilter()
public int getAction()
public void readExternal(java.io.DataInput in) throws java.io.IOException
readExternal
in interface ExternalizableLite
in
- the DataInput stream to read data from in order to restore the state of this objectjava.io.IOException
- if an I/O exception occursjava.io.NotActiveException
- if the object is not in its initial state, and therefore cannot be deserialized intopublic void writeExternal(java.io.DataOutput out) throws java.io.IOException
writeExternal
in interface ExternalizableLite
out
- the DataOutput stream to write the state of this object tojava.io.IOException
- if an I/O exception occurspublic void readExternal(PofReader in) throws java.io.IOException
readExternal
in interface PortableObject
in
- the PofReader from which to read the object's statejava.io.IOException
- if an I/O error occurspublic void writeExternal(PofWriter out) throws java.io.IOException
writeExternal
in interface PortableObject
out
- the PofWriter to which to write the object's statejava.io.IOException
- if an I/O error occurspublic boolean equals(java.lang.Object o)
public int hashCode()
Object.hashCode()
contract.public java.lang.String toString()
|
Oracle® Coherence Java API Reference Release 12.1.2.0.3 E26043-02 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |