1 24 package com.scalagent.kjoram; 25 26 import com.scalagent.kjoram.jms.AbstractJmsReply; 27 28 29 33 class SessionDaemon extends com.scalagent.kjoram.util.Daemon 34 { 35 36 private Session sess; 37 38 43 public SessionDaemon(Session sess) 44 { 45 super(sess.toString()); 46 this.sess = sess; 47 if (JoramTracing.dbgClient) 48 JoramTracing.log(JoramTracing.DEBUG, "SessionDaemon: " + sess 49 + ": created."); 50 } 51 52 53 public void run() 54 { 55 AbstractJmsReply reply; 56 57 try { 58 while (running) { 59 canStop = true; 60 61 try { 63 reply = (AbstractJmsReply) sess.repliesIn.get(); 64 } 65 catch (Exception iE) { 66 continue; 67 } 68 canStop = false; 69 70 sess.distribute(reply); 72 sess.repliesIn.pop(); 73 } 74 } 75 finally { 76 finish(); 77 } 78 } 79 80 81 public void shutdown() 82 { 83 if (JoramTracing.dbgClient) 84 JoramTracing.log(JoramTracing.DEBUG, "SessionDaemon shut down."); 85 } 86 87 88 public void close() 89 { 90 if (JoramTracing.dbgClient) 91 JoramTracing.log(JoramTracing.DEBUG, "SessionDaemon: finished."); 92 } 93 } 94 | Popular Tags |