Package | Class | Tree | Deprecated | Index | Help
| Oracle Application Server Java Object Cache API Reference 10g Release 3 (10.1.3) B25712-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.ias.cache
Class CacheEvent

`java.lang.Object
java.util.EventObject
oracle.ias.cache.CacheEvent`

All Implemented Interfaces:
  java.io.Serializable

public class CacheEvent
extends java.util.EventObject

CacheEvent represents an internal cache event. It extends java.util.EventObject. If an event happens on a cached object, the source object in CacheEvent is the cached object which relates to the event that just happened. If an event happens on a cache group, the source object in CacheEvent is the group name which relates to the event that just happened. Event id is used to identify different types of events. Application can register a CacheEventListener to handle event. Currently, only the OBJECT_INVALIDATED, OBJECT_UPDATED, and OBJECT_UPDATED_SYNC events are defined.

Since:
  2.0.0
See Also:
  Serialized Form

Field Summary
`static int` | `OBJECT_INV_EXPLICIT` Represents the event when object or group explicitly invalidated.
`static int` | `OBJECT_INV_REMOVED` Represents the event when object or group invalidated or removed due to resource or capacity limit.
`static int` | `OBJECT_INV_TIMEOUT` Represents the event when object or group invalidated due to ttl or idletime expired.
`static int` | `OBJECT_INVALIDATED` Represents the object or group invalidated event.
`static int` | `OBJECT_UPDATED` Represents the object updated event.
`static int` | `OBJECT_UPDATED_SYNC` Represents the object updated event.
`static int` | `REASON_INTERNAL` The reason for the event is internal object management
`static int` | `REASON_INV_EXPLICIT` Represents the event when object or group explicitly invalidated.
`static int` | `REASON_INV_GLOBAL` Represents the event when all objects in the cache were explicitly removed
`static int` | `REASON_INV_REMOVED` Represents the event when object or group invalidated or removed due to resource or capacity limit.
`static int` | `REASON_INV_TIMEOUT` Represents the event when object or group invalidated due to ttl or idletime expired.
`static int` | `REASON_UNSPECIFIED` The reason for the event is unspecified

Fields inherited from class java.util.EventObject
`source`

Constructor Summary
`protected` | `CacheEvent(int id, java.lang.Object name, java.lang.String region, java.lang.Object src, CacheEventListener ltn, int reason)` Creates a new CacheEvent.

Method Summary
`int` | `getId()` getId returns the event identifier.
`java.lang.Object` | `getName()` getName returns the name of the object associated with the event
`int` | `getReason()` getReason returns the reason code specified for the event.
`java.lang.String` | `getRegion()` getRegion returns the name of the region associated with the event
`java.lang.Object` | `getSource()` getSource returns the source of the event as set by cache internally

Methods inherited from class java.util.EventObject
`toString`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### OBJECT_INVALIDATED

    public static final int OBJECT_INVALIDATED

  Represents the object or group invalidated event. This event can happen in the following scenarioes:
  - application explicitly invalidates the object or the group.
  - time to live expires
  - idle time expires
    See Also:
      Constant Field Values

### OBJECT_UPDATED

    public static final int OBJECT_UPDATED

  Represents the object updated event. This event can happen when a cached object gets updated. This event usally triggered by a CacheAccess.replace call.
  See Also:
    Constant Field Values

### OBJECT_UPDATED_SYNC

    public static final int OBJECT_UPDATED_SYNC

  Represents the object updated event. This event can happen when a cached object gets updated. This event is triggered by a CacheAccess.replace call. This event differs from the OBJECT_UPDATED event in that it will be executed synchronously, within the callers thread before the update call completes. With OBJECT_UPDATED, the event is handled asynchronously by a background thread.
  See Also:
    Constant Field Values

### OBJECT_INV_EXPLICIT

    public static final int OBJECT_INV_EXPLICIT

  Represents the event when object or group explicitly invalidated. This event can happen in application explicitly invalidates the object or the group.
  See Also:
    Constant Field Values

### OBJECT_INV_TIMEOUT

    public static final int OBJECT_INV_TIMEOUT

  Represents the event when object or group invalidated due to ttl or idletime expired. This event can happen in the object or group time to live or idletime expired.
  See Also:
    Constant Field Values

### OBJECT_INV_REMOVED

    public static final int OBJECT_INV_REMOVED

  Represents the event when object or group invalidated or removed due to resource or capacity limit. This event can happen in the object or group got invalidated or removed when reaching the resource or capacity limit.
  See Also:
    Constant Field Values

### REASON_UNSPECIFIED

    public static final int REASON_UNSPECIFIED

  The reason for the event is unspecified
  See Also:
    Constant Field Values

### REASON_INTERNAL

    public static final int REASON_INTERNAL

  The reason for the event is internal object management
  See Also:
    Constant Field Values

### REASON_INV_GLOBAL

    public static final int REASON_INV_GLOBAL

  Represents the event when all objects in the cache were explicitly removed
  See Also:
    Constant Field Values

### REASON_INV_EXPLICIT

    public static final int REASON_INV_EXPLICIT

  Represents the event when object or group explicitly invalidated. This event can happen in application explicitly invalidates the object or the group.
  See Also:
    Constant Field Values

### REASON_INV_TIMEOUT

    public static final int REASON_INV_TIMEOUT

  Represents the event when object or group invalidated due to ttl or idletime expired. This event can happen in the object or group time to live or idletime expired.
  See Also:
    Constant Field Values

### REASON_INV_REMOVED

    public static final int REASON_INV_REMOVED

  Represents the event when object or group invalidated or removed due to resource or capacity limit. This event can happen in the object or group got invalidated or removed when reaching the resource or capacity limit.
  See Also:
    Constant Field Values

Constructor Detail

### CacheEvent

    protected CacheEvent(int id,
                         java.lang.Object name,
                         java.lang.String region,
                         java.lang.Object src,
                         CacheEventListener ltn,
                         int reason)

  Creates a new CacheEvent.
Parameters:
  `src` - is the source object. If the event happens on a cached object, the cached object is the source object. If the event happens on a cache group, the group name is the source object.
  `id` - is the event identifier. Currently, only OBJECT_INVALIDATED OBJECT_UPDATED, and OBJECT_UPDATED_SYNC are supported
Since:
  2.0.0

Method Detail

### getId

    public int getId()

  getId returns the event identifier.
  Returns:
    event identifier.
  Since:
    2.0.0

### getName

    public java.lang.Object getName()

  getName returns the name of the object associated with the event
  Returns:
    object name
  Since:
    2.1.0

### getSource

    public java.lang.Object getSource()

  getSource returns the source of the event as set by cache internally

### getRegion

    public java.lang.String getRegion()

  getRegion returns the name of the region associated with the event
  Returns:
    object name
  Since:
    9.0.4

### getReason

    public int getReason()

  getReason returns the reason code specified for the event.
  Returns:
    reason code
  Since:
    10.1.3

Package | Class | Tree | Deprecated | Index | Help
| Oracle Application Server Java Object Cache API Reference 10g Release 3 (10.1.3) B25712-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004, 2005, Oracle. All rights reserved.