?? clusternotification.java
字號:
/*
* Copyright (c) 2002-2003 by OpenSymphony
* All rights reserved.
*/
package com.opensymphony.oscache.plugins.clustersupport;
import java.io.Serializable;
/**
* A notification message that holds information about a cache event. This
* class is <code>Serializable</code> to allow it to be sent across the
* network to other machines running in a cluster.
*
* @author <a href="mailto:chris@swebtec.com">Chris Miller</a>
* @author $Author: dres $
* @version $Revision: 254 $
*/
public class ClusterNotification implements Serializable {
/**
* Specifies a notification message that indicates a particular cache key
* should be flushed.
*/
public static final int FLUSH_KEY = 1;
/**
* Specifies a notification message that indicates an entire cache group
* should be flushed.
*/
public static final int FLUSH_GROUP = 2;
/**
* Specifies a notification message that indicates all entries in the cache
* that match the specified pattern should be flushed.
*/
public static final int FLUSH_PATTERN = 3;
/**
* Specifies a notification message indicating that an entire cache should
* be flushed.
*/
public static final int FLUSH_CACHE = 4;
/**
* Any additional data that may be required
*/
protected Serializable data;
/**
* The type of notification message.
*/
protected int type;
/**
* Creates a new notification message object to broadcast to other
* listening nodes in the cluster.
*
* @param type The type of notification message. Valid types are
* {@link #FLUSH_KEY} and {@link #FLUSH_GROUP}.
* @param data Specifies the object key or group name to flush.
*/
public ClusterNotification(int type, Serializable data) {
this.type = type;
this.data = data;
}
/**
* Holds any additional data that was required
*/
public Serializable getData() {
return data;
}
/**
* The type of notification message.
*/
public int getType() {
return type;
}
public String toString() {
StringBuffer buf = new StringBuffer();
buf.append("type=").append(type).append(", data=").append(data);
return buf.toString();
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -