1 24 package com.scalagent.kjoram.jms; 25 26 import java.util.Hashtable ; 27 import java.util.Enumeration ; 28 29 33 public class AbstractJmsReply 34 { 35 36 protected int correlationId = -1; 37 38 43 public AbstractJmsReply(int correlationId) 44 { 45 this.correlationId = correlationId; 46 } 47 48 51 public AbstractJmsReply() 52 {} 53 54 55 56 public void setCorrelationId(int correlationId) 57 { 58 this.correlationId = correlationId; 59 } 60 61 62 public int getCorrelationId() 63 { 64 return correlationId; 65 } 66 67 68 public Integer getKey() 69 { 70 return new Integer (correlationId); 71 } 72 73 public Hashtable soapCode() { 74 Hashtable h = new Hashtable (); 75 String className = getClass().getName(); 76 String end = className.substring( 77 className.lastIndexOf((int)'.'), 78 className.length()); 79 h.put("className","org.objectweb.joram.shared.client"+end); 80 h.put("correlationId",getKey()); 82 return h; 83 } 84 85 public static Object soapDecode(Hashtable h) { 86 return new AbstractJmsReply( 87 ((Integer ) h.get("correlationId")).intValue()); 88 } 89 } 90 | Popular Tags |