Changeset 49 for trunk/src/main/java/omq/server/RemoteObject.java
- Timestamp:
- 06/19/13 15:59:53 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/main/java/omq/server/RemoteObject.java
r44 r49 10 10 import java.util.Properties; 11 11 12 import org.apache.log4j.Logger; 13 12 14 import omq.Remote; 13 15 import omq.common.broker.Broker; … … 33 35 34 36 private static final long serialVersionUID = -1778953938739846450L; 37 private static final Logger logger = Logger.getLogger(RemoteObject.class.getName()); 35 38 36 39 private String UID; … … 85 88 try { 86 89 Delivery delivery = consumer.nextDelivery(); 87 System.out.println("RemoteObject: " + UID + " has received a message"); 90 91 logger.debug(UID + " has received a message"); 92 88 93 remoteWrapper.notifyDelivery(delivery); 89 94 } catch (InterruptedException i) { 90 i.printStackTrace();95 logger.error(i); 91 96 } catch (ShutdownSignalException e) { 92 e.printStackTrace();97 logger.error(e); 93 98 try { 94 99 if (channel.isOpen()) { … … 101 106 Thread.sleep(milis); 102 107 } catch (InterruptedException e2) { 103 e2.printStackTrace();104 } 105 e1.printStackTrace();108 logger.error(e2); 109 } 110 logger.error(e1); 106 111 } 107 112 } catch (ConsumerCancelledException e) { 108 e.printStackTrace();113 logger.error(e); 109 114 } catch (SerializerException e) { 110 e.printStackTrace();115 logger.error(e); 111 116 } catch (Exception e) { 112 e.printStackTrace();117 logger.error(e); 113 118 } 114 119 } … … 129 134 130 135 public void kill() throws IOException { 136 logger.warn("Killing objectmq: " + this.getRef()); 131 137 killed = true; 132 138 interrupt(); … … 218 224 219 225 // Declares and bindings 220 System.out.println("RemoteObject: " + UID + " declaring direct exchange: " + exchange + ", Queue: " + queue);226 logger.info("RemoteObject: " + UID + " declaring direct exchange: " + exchange + ", Queue: " + queue); 221 227 channel.exchangeDeclare(exchange, "direct"); 222 228 channel.queueDeclare(queue, durable, false, false, null); … … 224 230 225 231 // Declare the event topic fanout 226 System.out.println("RemoteObject: " + UID + " declaring fanout exchange: " + UID);232 logger.info("RemoteObject: " + UID + " declaring fanout exchange: " + UID); 227 233 channel.exchangeDeclare(UID, "fanout"); 228 234
Note: See TracChangeset
for help on using the changeset viewer.