1 2 4 package ersatz.resourceadapter; 5 6 import javax.ejb.MessageDrivenBean; 7 import javax.ejb.MessageDrivenContext; 8 9 12 public class MessageTakerMD implements MessageDrivenBean, 13 MsgListenerInterface 14 { 15 private transient MessageDrivenContext mdbContext; 16 String cName = "MessageTakerMD"; 17 18 public MessageTakerMD() { 20 } 21 22 26 37 38 public void setMessageDrivenContext(MessageDrivenContext ctxt) { 39 mdbContext = ctxt; 40 System.out.println(cName+".setMessageDrivenContext"); 41 Utility.log(cName+".setMessageDrivenContext"); 42 } 43 44 53 public void ejbRemove() { 54 Utility.log(cName+".ejbRemove"); 55 } 56 57 61 public void ejbCreate() { 62 Utility.log(cName+".ejbCreate"); 63 } 64 65 68 public void onMessage(String message) { 69 System.out.println(cName+".onMessage Message="+message); 70 try { 71 Utility.log(cName+".onMessage Message="+message); 72 } catch (Exception ex) { 73 Utility.log(cName+".onMessage Exception caught="+ex.toString()); 74 } 75 } 76 79 public void offMessage(String message) { 80 try{ 81 Utility.log(cName+".offMessage Message="+message); 82 }catch(Exception ex){ 83 Utility.log(cName+".offMessage Exception caught="+ex.toString()); 84 } 85 } 86 } | Popular Tags |