All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.alachisoft.ncache.client.CacheEventArg Maven / Gradle / Ivy

There is a newer version: 5.3.0
Show newest version
package com.alachisoft.ncache.client;

import com.alachisoft.ncache.client.internal.caching.CacheItemRemovedReason;
import com.alachisoft.ncache.runtime.events.EventType;

/**
 * This object is received when an even is raised and delegate  is executed
 * CacheEventArg contains necessary information to identify the event and perform necessary actions accordingly.
 * It inherits  which is also a parent of 
 * This class is consistent for both selective and general events
 */
public class CacheEventArg extends EventArg {

    private CacheItemRemovedReason _reason; //For remove only
    private CacheEventDescriptor _descriptor;

    public CacheEventArg(String key, String cachename, EventType eventType, EventCacheItem item, CacheEventDescriptor discriptor) {
        super(cachename, eventType, item);
        _descriptor = discriptor;
    }

    public CacheEventArg(String key, String cachename, EventType eventType, EventCacheItem item, CacheEventDescriptor discriptor, EventCacheItem olditem) {
        super(cachename, eventType, item, olditem);
        _descriptor = discriptor;
    }


    public CacheEventArg(String key, String cachename, EventType eventType, EventCacheItem item, CacheEventDescriptor discriptor, CacheItemRemovedReason reason) {
        super(cachename, eventType, item);
        _reason = reason;
        _descriptor = discriptor;
    }



    /**
     * Only applicable for general events otherwise it will be null
     */
    public final CacheEventDescriptor getDescriptor() {
        return _descriptor;
    }

    public final void setDescriptor(CacheEventDescriptor value) {
        _descriptor = value;
    }

    /**
     * Only applicable for 
     * Otherwise default value is DependencyChanged
     */
    public final CacheItemRemovedReason getCacheItemRemovedReason() {
        return _reason;
    }

    public final void setItemRemovedReason(CacheItemRemovedReason value) {
        _reason = value;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy