Changeset 72 for trunk/src/main/java/omq/server/RemoteObject.java
- Timestamp:
- 06/29/13 20:44:27 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/main/java/omq/server/RemoteObject.java
r67 r72 4 4 import java.lang.reflect.Method; 5 5 import java.util.ArrayList; 6 import java.util.Collection;7 6 import java.util.HashMap; 8 7 import java.util.List; … … 10 9 import java.util.Properties; 11 10 12 import org.apache.log4j.Logger;13 14 11 import omq.Remote; 15 12 import omq.common.broker.Broker; 16 import omq.common.event.Event;17 import omq.common.event.EventListener;18 import omq.common.event.EventWrapper;19 13 import omq.common.util.ParameterQueue; 20 import omq.common.util.Serializer;21 14 import omq.exception.SerializerException; 15 16 import org.apache.log4j.Logger; 22 17 23 18 import com.rabbitmq.client.Channel; … … 42 37 private Properties env; 43 38 private transient Broker broker; 44 private transient Serializer serializer;45 39 private transient RemoteWrapper remoteWrapper; 46 40 private transient Map<String, List<Class<?>>> params; … … 69 63 multiQueue = UID + System.currentTimeMillis(); 70 64 env = broker.getEnvironment(); 71 serializer = broker.getSerializer();72 65 73 66 params = new HashMap<String, List<Class<?>>>(); … … 93 86 this.broker = broker; 94 87 UID = reference; 95 serializer = broker.getSerializer();96 88 if (channel == null || !channel.isOpen()) { 97 89 channel = broker.getChannel(); … … 141 133 } 142 134 143 @Override144 public void notifyEvent(Event event) throws IOException, SerializerException {145 String corrID = java.util.UUID.randomUUID().toString();146 event.setTopic(UID);147 event.setCorrId(corrID);148 EventWrapper wrapper = new EventWrapper(event);149 channel.exchangeDeclare(UID, "fanout");150 channel.basicPublish(UID, "", null, serializer.serialize(wrapper));151 logger.debug("Sending event-> topic: " + UID + ", corrID: " + corrID);152 }153 154 135 public void kill() throws IOException { 155 136 logger.warn("Killing objectmq: " + this.getRef()); … … 265 246 } 266 247 267 @Override268 public void addListener(EventListener<?> eventListener) throws Exception {269 }270 271 @Override272 public void removeListener(EventListener<?> eventListener) throws Exception {273 }274 275 @Override276 public Collection<EventListener<?>> getListeners() throws Exception {277 return null;278 }279 280 248 }
Note: See TracChangeset
for help on using the changeset viewer.