Changeset 53 for trunk/src/main/java/omq/client/proxy/Proxymq.java
- Timestamp:
- 06/20/13 16:57:39 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/main/java/omq/client/proxy/Proxymq.java
r49 r53 51 51 private String uid; 52 52 private transient String serializerType; 53 private transient Broker broker; 53 54 private transient ResponseListener rListener; 54 55 private transient EventDispatcher dispatcher; 56 private transient Serializer serializer; 55 57 // private transient Channel channel; 56 58 private transient Properties env; … … 85 87 * @throws Exception 86 88 */ 87 public Proxymq(String uid, Class<?> clazz, Properties env) throws Exception {89 public Proxymq(String uid, Class<?> clazz, Broker broker) throws Exception { 88 90 this.uid = uid; 89 this.rListener = ResponseListener.getRequestListener(); 90 this.dispatcher = EventDispatcher.getDispatcher(); 91 this.broker = broker; 92 rListener = broker.getResponseListener(); 93 dispatcher = broker.getEventDispatcher(); 94 serializer = broker.getSerializer(); 91 95 92 96 // TODO what is better to use a new channel or to use the same? 93 97 // this.channel = Broker.getChannel(); 94 this.env = env;98 env = broker.getEnvironment(); 95 99 96 100 // set the serializer type … … 160 164 161 165 // Publish the message 162 byte[] bytesRequest = Serializer.serialize(serializerType, request);166 byte[] bytesRequest = serializer.serialize(serializerType, request); 163 167 // TODO See this 164 168 // channel.basicPublish(exchange, routingkey, props, bytesRequest); 165 Broker.getChannel().basicPublish(exchange, routingkey, props, bytesRequest);169 broker.getChannel().basicPublish(exchange, routingkey, props, bytesRequest); 166 170 // Log.saveLog("Client-Serialize", bytesRequest); 167 171 } … … 232 236 throw new TimeoutException("Timeout exception time: " + timeout); 233 237 } 234 resp = Serializer.deserializeResponse(results.get(corrId), type);238 resp = serializer.deserializeResponse(results.get(corrId), type); 235 239 // Log.saveLog("Client-Deserialize", results.get(corrId)); 236 240
Note: See TracChangeset
for help on using the changeset viewer.