1 31 package org.objectweb.proactive.ic2d.spy; 32 33 import org.objectweb.proactive.core.UniqueID; 34 import org.objectweb.proactive.core.event.ProActiveEvent; 35 36 public class SpyEvent extends ProActiveEvent implements java.io.Serializable { 37 38 public static final int GENERIC_TYPE = 0; 39 public static final int OBJECT_WAIT_BY_NECESSITY_TYPE = 20; 40 public static final int OBJECT_RECEIVED_FUTURE_RESULT_TYPE = 21; 41 public static final int OBJECT_WAIT_FOR_REQUEST_TYPE = 30; 42 public static final int REQUEST_SENT_MESSAGE_TYPE = 50; 43 public static final int REPLY_SENT_MESSAGE_TYPE = 60; 44 public static final int REQUEST_RECEIVED_MESSAGE_TYPE = 51; 45 public static final int REPLY_RECEIVED_MESSAGE_TYPE = 61; 46 public static final int VOID_REQUEST_SERVED_TYPE = 70; 47 public static final int SERVING_STARTED_TYPE = 80; 48 public static final int BODY_EVENT_TYPE = 100; 49 public static final int BODY_CREATION_EVENT_TYPE = 200; 50 51 52 protected UniqueID bodyID; 53 54 55 protected int pos = -1; 56 57 public SpyEvent(int type, UniqueID bodyID) { 58 super(bodyID, type); 59 this.bodyID = bodyID; 60 } 61 62 public UniqueID getBodyID() { return bodyID; } 63 64 public int getPos() { return pos; } 65 public void setPos(int v) { pos = v; } 66 67 public String toString() { 68 return "SpyEvent "+eventTypeAsString(type)+" body="+bodyID; 69 } 70 71 public static String eventTypeAsString(int type) { 72 switch (type) { 73 case GENERIC_TYPE: return "GENERIC_TYPE"; 74 case OBJECT_WAIT_BY_NECESSITY_TYPE: return "OBJECT_WAIT_BY_NECESSITY_TYPE"; 75 case OBJECT_WAIT_FOR_REQUEST_TYPE: return "OBJECT_WAIT_FOR_REQUEST_TYPE"; 76 case OBJECT_RECEIVED_FUTURE_RESULT_TYPE: return "OBJECT_RECEIVED_FUTURE_RESULT_TYPE"; 77 case REQUEST_SENT_MESSAGE_TYPE: return "REQUEST_SENT_MESSAGE_TYPE"; 78 case REPLY_SENT_MESSAGE_TYPE: return "REPLY_SENT_MESSAGE_TYPE"; 79 case REQUEST_RECEIVED_MESSAGE_TYPE: return "REQUEST_RECEIVED_MESSAGE_TYPE"; 80 case REPLY_RECEIVED_MESSAGE_TYPE: return "REPLY_RECEIVED_MESSAGE_TYPE"; 81 case VOID_REQUEST_SERVED_TYPE: return "VOID_REQUEST_SERVED_TYPE"; 82 case SERVING_STARTED_TYPE: return "SERVING_STARTED_TYPE"; 83 case BODY_EVENT_TYPE: return "BODY_EVENT_TYPE"; 84 case BODY_CREATION_EVENT_TYPE: return "BODY_CREATION_EVENT_TYPE"; 85 } 86 return "UNKNOWN"; 87 } 88 } 89 | Popular Tags |