01: /*
02: * All content copyright (c) 2003-2007 Terracotta, Inc., except as may otherwise be noted in a separate copyright
03: * notice. All rights reserved.
04: */
05: package com.tc.objectserver.context;
06:
07: import com.tc.async.api.EventContext;
08: import com.tc.net.groups.NodeID;
09:
10: public class NodeStateEventContext implements EventContext {
11: public static final int CREATE = 0;
12: public static final int REMOVE = 1;
13:
14: private final int type;
15: private final NodeID nodeID;
16:
17: public NodeStateEventContext(int type, NodeID nodeID) {
18: this .type = type;
19: this .nodeID = nodeID;
20: if ((type != CREATE) && (type != REMOVE)) {
21: throw new IllegalArgumentException("invalid type: " + type);
22: }
23: }
24:
25: public int getType() {
26: return type;
27: }
28:
29: public NodeID getNodeID() {
30: return nodeID;
31: }
32: }
|