Skip navigation links

Oracle® Fusion Middleware Java API Reference for Oracle Coherence
12c (12.1.3.0.0)

E47890-01


com.tangosol.util.filter
Class CacheEventFilter

java.lang.Object
  extended by com.tangosol.util.Base
      extended by com.tangosol.util.BitHelper
          extended by com.tangosol.util.ExternalizableHelper
              extended by com.tangosol.util.filter.MapEventFilter
                  extended by com.tangosol.util.filter.CacheEventFilter

All Implemented Interfaces:
ExternalizableLite, PortableObject, Filter, java.io.Serializable

public class CacheEventFilter
extends MapEventFilter

An extension of the MapEventFilter which allows selection of client driven (natural) events, cache internal (synthetic) events, or both.

Since:
Coherence 3.7.1.9
Author:
sw 2013.04.04

Field Summary
static int E_NATURAL
          Bitmask to select natural events.
static int E_SYNTHETIC
          Bitmask to select synthetic events.
protected  int m_nMaskSynthetic
          Bitmask that selects whether to include synthetic, natural, or all events.

 

Fields inherited from class com.tangosol.util.filter.MapEventFilter
E_ALL, E_DELETED, E_INSERTED, E_KEYSET, E_UPDATED, E_UPDATED_ENTERED, E_UPDATED_LEFT, E_UPDATED_WITHIN, m_filter, m_nMask

 

Constructor Summary
CacheEventFilter()
          Default constructor (necessary for the ExternalizableLite interface).
CacheEventFilter(Filter filter, int nMaskSynthetic)
          Construct a CacheEventFilter that evaluates MapEvent objects that would affect the results of a keySet filter issued by a previous call to QueryMap.keySet(com.tangosol.util.Filter).
CacheEventFilter(int nMask, Filter filter, int nMaskSynthetic)
          Construct a CacheEventFilter that evaluates MapEvent objects based on the specified combination of event types.
CacheEventFilter(int nMask, int nMaskSynthetic)
          Construct a CacheEventFilter that evaluates MapEvent objects based on the specified combination of event types.

 

Method Summary
 boolean equals(java.lang.Object o)
          Compare the CacheEventFilter with another object to determine equality.
 boolean evaluate(java.lang.Object o)
          Apply the test to the object.
protected  java.lang.String getDescription()
          Get the filter's description.
 int hashCode()
          Determine a hash value for the CacheEventFilter object according to the general Object.hashCode() contract.
 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.
 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.filter.MapEventFilter
getEventMask, getFilter, toString

 

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, toBytes, toBytes, toBytes, toBytes, toInt, toInt, toLong, toLong

 

Field Detail

E_SYNTHETIC

public static final int E_SYNTHETIC
Bitmask to select synthetic events.
See Also:
Constant Field Values

E_NATURAL

public static final int E_NATURAL
Bitmask to select natural events.
See Also:
Constant Field Values

m_nMaskSynthetic

protected int m_nMaskSynthetic
Bitmask that selects whether to include synthetic, natural, or all events.

Constructor Detail

CacheEventFilter

public CacheEventFilter()
Default constructor (necessary for the ExternalizableLite interface).

CacheEventFilter

public CacheEventFilter(int nMask,
                        int nMaskSynthetic)
Construct a CacheEventFilter that evaluates MapEvent objects based on the specified combination of event types.

Using this constructor is equivalent to: new CacheEventFilter(nMask, null, nMaskSynthetic);

Parameters:
nMask - any combination of E_INSERTED, E_UPDATED and E_DELETED, E_UPDATED_ENTERED, E_UPDATED_WITHIN, E_UPDATED_LEFT
nMaskSynthetic - any combination of E_SYNTHETIC and E_NATURAL

CacheEventFilter

public CacheEventFilter(Filter filter,
                        int nMaskSynthetic)
Construct a CacheEventFilter that evaluates MapEvent objects that would affect the results of a keySet filter issued by a previous call to QueryMap.keySet(com.tangosol.util.Filter). It is possible to easily implement continuous query functionality.

Using this constructor is equivalent to: new CacheEventFilter(E_KEYSET, filter, nMaskSynthetic);

Parameters:
filter - the filter passed previously to a keySet() query method
nMaskSynthetic - any combination of E_SYNTHETIC and E_NATURAL

CacheEventFilter

public CacheEventFilter(int nMask,
                        Filter filter,
                        int nMaskSynthetic)
Construct a CacheEventFilter that evaluates MapEvent objects based on the specified combination of event types.
Parameters:
nMask - combination of any of the E_* values
filter - (optional) the filter used for evaluating event values
nMaskSynthetic - any combination of E_SYNTHETIC and E_NATURAL

Method Detail

evaluate

public boolean evaluate(java.lang.Object o)
Apply the test to the object.
Specified by:
evaluate in interface Filter
Overrides:
evaluate in class MapEventFilter
Parameters:
o - the object to test
Returns:
true if the test passes, false otherwise

equals

public boolean equals(java.lang.Object o)
Compare the CacheEventFilter with another object to determine equality.
Overrides:
equals in class MapEventFilter
Returns:
true iff this CacheEventFilter and the passed object are equivalent filters

hashCode

public int hashCode()
Determine a hash value for the CacheEventFilter object according to the general Object.hashCode() contract.
Overrides:
hashCode in class MapEventFilter
Returns:
an integer hash value for this MapEventFilter object

getDescription

protected java.lang.String getDescription()
Get the filter's description.
Overrides:
getDescription in class MapEventFilter
Returns:
this filter's description

readExternal

public void readExternal(java.io.DataInput in)
                  throws java.io.IOException
Restore the contents of this object by loading the object's state from the passed DataInput object.
Specified by:
readExternal in interface ExternalizableLite
Overrides:
readExternal in class MapEventFilter
Parameters:
in - the DataInput stream to read data from in order to restore the state of this object
Throws:
java.io.IOException - if an I/O exception occurs
java.io.NotActiveException - if the object is not in its initial state, and therefore cannot be deserialized into

writeExternal

public void writeExternal(java.io.DataOutput out)
                   throws java.io.IOException
Save the contents of this object by storing the object's state into the passed DataOutput object.
Specified by:
writeExternal in interface ExternalizableLite
Overrides:
writeExternal in class MapEventFilter
Parameters:
out - the DataOutput stream to write the state of this object to
Throws:
java.io.IOException - if an I/O exception occurs

readExternal

public void readExternal(PofReader in)
                  throws java.io.IOException
Restore the contents of a user type instance by reading its state using the specified PofReader object.
Specified by:
readExternal in interface PortableObject
Overrides:
readExternal in class MapEventFilter
Parameters:
in - the PofReader from which to read the object's state
Throws:
java.io.IOException - if an I/O error occurs

writeExternal

public void writeExternal(PofWriter out)
                   throws java.io.IOException
Save the contents of a POF user type instance by writing its state using the specified PofWriter object.
Specified by:
writeExternal in interface PortableObject
Overrides:
writeExternal in class MapEventFilter
Parameters:
out - the PofWriter to which to write the object's state
Throws:
java.io.IOException - if an I/O error occurs

Skip navigation links

Oracle® Fusion Middleware Java API Reference for Oracle Coherence
12c (12.1.3.0.0)

E47890-01


Copyright © 2000, 2014, Oracle and/or its affiliates. All rights reserved.