1 22 package org.objectweb.petals.kernel.registry.msg.request; 23 24 import java.io.Serializable ; 25 26 32 public class RegistryRequest implements Serializable { 33 34 39 public static enum RequestType { 40 43 addToEnvironment, 44 47 bind, 48 52 createSubcontext, 53 57 destroySubcontext, 58 61 fullUpdate, 62 65 list, 66 70 listBindings, 71 74 lookup, 75 78 lookupLink, 79 82 newMaster, 83 86 ping, 87 90 rebind, 91 94 rename, 95 98 unbind 99 } 100 101 private static final long serialVersionUID = 1L;; 102 103 106 protected Object arg1; 107 108 111 protected Object arg2; 112 113 116 protected Object arg3; 117 118 121 protected long recipient; 122 123 126 protected long requestDate; 127 128 131 protected long sender; 132 133 136 protected RequestType type; 137 138 protected RegistryRequest(RequestType type, long sender, long recipient) { 139 super(); 140 this.type = type; 141 this.sender = sender; 142 this.recipient = recipient; 143 requestDate = System.nanoTime(); 144 } 145 146 protected RegistryRequest(RequestType type, Object arg1, long sender, 147 long recipient) { 148 super(); 149 this.type = type; 150 this.arg1 = arg1; 151 this.sender = sender; 152 this.recipient = recipient; 153 requestDate = System.nanoTime(); 154 } 155 156 protected RegistryRequest(RequestType type, Object arg1, Object arg2, 157 long sender, long recipient) { 158 super(); 159 this.type = type; 160 this.arg1 = arg1; 161 this.arg2 = arg2; 162 this.sender = sender; 163 this.recipient = recipient; 164 requestDate = System.nanoTime(); 165 } 166 167 protected RegistryRequest(RequestType type, Object arg1, Object arg2, 168 Object arg3, long sender, long recipient) { 169 super(); 170 this.type = type; 171 this.arg1 = arg1; 172 this.arg2 = arg2; 173 this.arg3 = arg3; 174 this.sender = sender; 175 this.recipient = recipient; 176 requestDate = System.nanoTime(); 177 } 178 179 public Object getArg1() { 180 return arg1; 181 } 182 183 public Object getArg2() { 184 return arg2; 185 } 186 187 public Object getArg3() { 188 return arg3; 189 } 190 191 public long getRecipient() { 192 return recipient; 193 } 194 195 public long getRequestDate() { 196 return requestDate; 197 } 198 199 public long getSender() { 200 return sender; 201 } 202 203 public RequestType getType() { 204 return type; 205 } 206 207 public void setArg1(Object arg1) { 208 this.arg1 = arg1; 209 } 210 211 public void setArg2(Object arg2) { 212 this.arg2 = arg2; 213 } 214 215 public void setArg3(Object arg3) { 216 this.arg3 = arg3; 217 } 218 219 public void setRecipient(long recipient) { 220 this.recipient = recipient; 221 } 222 223 public void setSender(long sender) { 224 this.sender = sender; 225 } 226 227 public void setType(RequestType type) { 228 this.type = type; 229 } 230 231 public String toString() { 232 return "RegistryRequest " + type + " date " + requestDate; 233 } 234 235 } 236 | Popular Tags |