Changeset 105
- Timestamp:
- 10/16/13 16:19:02 (11 years ago)
- Location:
- branches/supervisor/src/main/java/omq
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/supervisor/src/main/java/omq/Remote.java
r82 r105 17 17 18 18 /** 19 * Returns the UIDof a RemoteObject19 * Returns the reference of a RemoteObject 20 20 * 21 * @return UID21 * @return reference 22 22 */ 23 23 public String getRef(); -
branches/supervisor/src/main/java/omq/client/proxy/MultiProxymq.java
r99 r105 25 25 private static final String multi = "multi#"; 26 26 27 private String uid;27 private String reference; 28 28 private Broker broker; 29 29 private Serializer serializer; … … 33 33 private transient String serializerType; 34 34 35 public MultiProxymq(String uid, Class<?> clazz, Broker broker) throws Exception {36 this. uid = uid;35 public MultiProxymq(String reference, Class<?> clazz, Broker broker) throws Exception { 36 this.reference = reference; 37 37 this.broker = broker; 38 38 serializer = broker.getSerializer(); 39 39 40 40 Properties env = broker.getEnvironment(); 41 exchange = multi + uid;41 exchange = multi + reference; 42 42 serializerType = env.getProperty(ParameterQueue.PROXY_SERIALIZER, Serializer.JAVA); 43 43 } … … 52 52 53 53 // Add the correlation ID and create a replyTo property 54 BasicProperties props = new BasicProperties.Builder().appId( uid).correlationId(corrId).type(serializerType).build();54 BasicProperties props = new BasicProperties.Builder().appId(reference).correlationId(corrId).type(serializerType).build(); 55 55 56 56 byte[] bytesRequest = serializer.serialize(serializerType, request); 57 57 broker.publishMessge(exchange, routingkey, props, bytesRequest); 58 58 59 logger.debug("Proxymq: " + uid+ " invokes " + methodName + ", corrID" + corrId + ", exchange: " + exchange + ", replyQueue: " + replyQueueName59 logger.debug("Proxymq: " + reference + " invokes " + methodName + ", corrID" + corrId + ", exchange: " + exchange + ", replyQueue: " + replyQueueName 60 60 + ", serializerType: " + serializerType + ", multi call: " + request.isMulti() + ", async call: " + request.isAsync()); 61 61 -
branches/supervisor/src/main/java/omq/client/proxy/Proxymq.java
r104 r105 46 46 private static final String multi = "multi#"; 47 47 48 private String uid;48 private String reference; 49 49 private transient String exchange; 50 50 private transient String multiExchange; … … 72 72 * Proxymq Constructor. 73 73 * 74 * This constructor uses an uidto know which object will call. It also uses74 * This constructor uses an reference to know which object will call. It also uses 75 75 * Properties to set where to send the messages 76 76 * 77 * @param uid78 * The uidrepresents the unique identifier of a remote object77 * @param reference 78 * The reference represents the unique identifier of a remote object 79 79 * @param clazz 80 80 * It represents the real class of the remote object. With this … … 85 85 * @throws Exception 86 86 */ 87 public Proxymq(String uid, Class<?> clazz, Broker broker) throws Exception {88 this. uid = uid;87 public Proxymq(String reference, Class<?> clazz, Broker broker) throws Exception { 88 this.reference = reference; 89 89 this.broker = broker; 90 90 rListener = broker.getResponseListener(); … … 95 95 env = broker.getEnvironment(); 96 96 exchange = env.getProperty(ParameterQueue.RPC_EXCHANGE, ""); 97 multiExchange = multi + uid;97 multiExchange = multi + reference; 98 98 replyQueueName = env.getProperty(ParameterQueue.RPC_REPLY_QUEUE); 99 99 … … 165 165 } else { 166 166 exchange = this.exchange; 167 routingkey = uid;167 routingkey = reference; 168 168 } 169 169 170 170 // Add the correlation ID and create a replyTo property 171 BasicProperties props = new BasicProperties.Builder().appId( uid).correlationId(corrId).replyTo(replyQueueName).type(serializerType)171 BasicProperties props = new BasicProperties.Builder().appId(reference).correlationId(corrId).replyTo(replyQueueName).type(serializerType) 172 172 .deliveryMode(deliveryMode).build(); 173 173 … … 175 175 byte[] bytesRequest = serializer.serialize(serializerType, request); 176 176 broker.publishMessge(exchange, routingkey, props, bytesRequest); 177 logger.debug("Proxymq: " + uid+ " invokes '" + request.getMethod() + "' , corrID: " + corrId + ", exchange: " + exchange + ", replyQueue: "177 logger.debug("Proxymq: " + reference + " invokes '" + request.getMethod() + "' , corrID: " + corrId + ", exchange: " + exchange + ", replyQueue: " 178 178 + replyQueueName + ", serializerType: " + serializerType + ", multi call: " + request.isMulti() + ", async call: " + request.isAsync() 179 179 + ", delivery mode: " + deliveryMode); … … 359 359 @Override 360 360 public String getRef() { 361 return uid;361 return reference; 362 362 } 363 363 -
branches/supervisor/src/main/java/omq/server/InvocationThread.java
r102 r105 35 35 // RemoteObject 36 36 private RemoteObject obj; 37 private String UID;37 private String reference; 38 38 private Properties env; 39 39 private boolean idle; … … 54 54 public InvocationThread(RemoteObject obj) throws Exception { 55 55 this.obj = obj; 56 this. UID= obj.getRef();56 this.reference = obj.getRef(); 57 57 this.env = obj.getEnv(); 58 58 this.broker = obj.getBroker(); … … 176 176 // Get info about which exchange and queue will use 177 177 String exchange = env.getProperty(ParameterQueue.RPC_EXCHANGE, ""); 178 String queue = UID;179 String routingKey = UID;178 String queue = reference; 179 String routingKey = reference; 180 180 181 181 // RemoteObject default queue … … 192 192 channel.queueBind(queue, exchange, routingKey); 193 193 } 194 logger.info("RemoteObject: " + UID+ " declared direct exchange: " + exchange + ", Queue: " + queue + ", Durable: " + durable + ", Exclusive: "194 logger.info("RemoteObject: " + reference + " declared direct exchange: " + exchange + ", Queue: " + queue + ", Durable: " + durable + ", Exclusive: " 195 195 + exclusive + ", AutoDelete: " + autoDelete); 196 196 … … 200 200 201 201 // Get info about the multiQueue 202 String multiExchange = multi + UID;203 // TODO:String multiExchange = multi + exchange + UID;202 String multiExchange = multi + reference; 203 // TODO:String multiExchange = multi + exchange + reference; 204 204 multiQueue = env.getProperty(ParameterQueue.MULTI_QUEUE_NAME); 205 205 … … 217 217 } 218 218 channel.queueBind(multiQueue, multiExchange, ""); 219 logger.info("RemoteObject: " + UID+ " declared fanout exchange: " + multiExchange + ", Queue: " + multiQueue + ", Durable: " + multiDurable219 logger.info("RemoteObject: " + reference + " declared fanout exchange: " + multiExchange + ", Queue: " + multiQueue + ", Durable: " + multiDurable 220 220 + ", Exclusive: " + multiExclusive + ", AutoDelete: " + multiAutoDelete); 221 221 … … 236 236 237 237 public void kill() throws IOException { 238 logger.info("Killing objectmq: " + UID+ " thread id");238 logger.info("Killing objectmq: " + reference + " thread id"); 239 239 killed = true; 240 240 interrupt(); -
branches/supervisor/src/main/java/omq/server/RemoteObject.java
r101 r105 30 30 private static final Logger logger = Logger.getLogger(RemoteObject.class.getName()); 31 31 32 private String UID;32 private String reference; 33 33 private Properties env; 34 34 private transient Broker broker; … … 61 61 public void startRemoteObject(String reference, Broker broker, Properties env) throws Exception { 62 62 this.broker = broker; 63 this. UID= reference;63 this.reference = reference; 64 64 this.env = env; 65 65 … … 87 87 @Override 88 88 public String getRef() { 89 return UID;89 return reference; 90 90 } 91 91
Note: See TracChangeset
for help on using the changeset viewer.