1 22 package org.objectweb.petals.kernel.registry.msg.response; 23 24 import java.io.Serializable ; 25 26 31 public class RegistryResponse implements Serializable { 32 33 38 public static enum ResponseType { 39 42 ack, 43 46 createSubcontext, 47 50 exception, 51 54 fullUpdate, 55 58 list, 59 62 listBindings, 63 66 lookup, 67 70 lookupLink, 71 74 myStartTime 75 } 76 77 private static final long serialVersionUID = 1L;; 78 79 82 protected Object arg1; 83 84 87 protected long recipient; 88 89 92 protected long responseDate; 93 94 97 protected long sender; 98 99 102 protected ResponseType type; 103 104 protected RegistryResponse(ResponseType type, long sender, long recipient) { 105 super(); 106 this.type = type; 107 this.sender = sender; 108 this.recipient = recipient; 109 responseDate = System.nanoTime(); 110 } 111 112 protected RegistryResponse(ResponseType type, Object arg1, long sender, 113 long recipient) { 114 super(); 115 this.type = type; 116 this.arg1 = arg1; 117 this.sender = sender; 118 this.recipient = recipient; 119 responseDate = System.nanoTime(); 120 } 121 122 public Object getArg1() { 123 return arg1; 124 } 125 126 public long getRecipient() { 127 return recipient; 128 } 129 130 public long getResponseDate() { 131 return responseDate; 132 } 133 134 public long getSender() { 135 return sender; 136 } 137 138 public ResponseType getType() { 139 return type; 140 } 141 142 public void setArg1(Object arg1) { 143 this.arg1 = arg1; 144 } 145 146 public void setRecipient(int recipient) { 147 this.recipient = recipient; 148 } 149 150 public void setSender(int sender) { 151 this.sender = sender; 152 } 153 154 public void setType(ResponseType type) { 155 this.type = type; 156 } 157 158 public String toString() { 159 return "RegistryResponse " + type + " date " + responseDate; 160 } 161 162 } 163 | Popular Tags |