Changeset 72 for trunk/src/main/java/omq/common/broker/Broker.java
- Timestamp:
- 06/29/13 20:44:27 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/main/java/omq/common/broker/Broker.java
r70 r72 13 13 import omq.client.proxy.MultiProxymq; 14 14 import omq.client.proxy.Proxymq; 15 import omq.common.event.Event;16 import omq.common.event.EventDispatcher;17 import omq.common.event.EventWrapper;18 15 import omq.common.util.OmqConnectionFactory; 19 16 import omq.common.util.ParameterQueue; … … 21 18 import omq.exception.InitBrokerException; 22 19 import omq.exception.RemoteException; 23 import omq.exception.SerializerException;24 20 import omq.server.RemoteObject; 25 21 … … 41 37 private Channel channel; 42 38 private ResponseListener responseListener; 43 private EventDispatcher eventDispatcher;44 39 private Serializer serializer; 45 40 private boolean clientStarted = false; … … 75 70 if (clientStarted) { 76 71 responseListener.kill(); 77 eventDispatcher.kill();78 72 // TODO proxies = null; ?? 79 73 } … … 211 205 responseListener.start(); 212 206 } 213 if (eventDispatcher == null) {214 eventDispatcher = new EventDispatcher(this);215 eventDispatcher.start();216 }217 }218 219 /**220 * This method sends an event with its information221 *222 * @param event223 * @throws IOException224 * @throws SerializerException225 */226 public void trigger(Event event) throws IOException, SerializerException {227 String UID = event.getTopic();228 EventWrapper wrapper = new EventWrapper(event);229 logger.debug("EventTrigger fanout exchange: " + UID + " Event topic: " + UID + " Event corrID: " + event.getCorrId());230 channel.exchangeDeclare(UID, "fanout");231 232 byte[] bytesResponse = serializer.serialize(wrapper);233 channel.basicPublish(UID, "", null, bytesResponse);234 207 } 235 208 … … 318 291 } 319 292 320 public EventDispatcher getEventDispatcher() {321 return eventDispatcher;322 }323 324 293 public Serializer getSerializer() { 325 294 return serializer;
Note: See TracChangeset
for help on using the changeset viewer.