1 24 package com.scalagent.kjoram.jms; 25 26 import java.util.Hashtable ; 27 import java.util.Enumeration ; 28 29 33 public class AbstractJmsRequest 34 { 35 36 private int requestId = -1; 37 41 protected String target = null; 42 43 45 51 public AbstractJmsRequest(String target) 52 { 53 this.target = target; 54 } 55 56 59 public AbstractJmsRequest() 60 {} 61 62 63 64 public void setRequestId(int requestId) 65 { 66 this.requestId = requestId; 67 } 68 69 70 public void setTarget(String target) 71 { 72 this.target = target; 73 } 74 75 76 public int getRequestId() 77 { 78 return requestId; 79 } 80 81 82 public String getTarget() 83 { 84 return target; 85 } 86 87 88 public Integer getKey() 89 { 90 return new Integer (requestId); 91 } 92 93 public Hashtable soapCode() { 94 Hashtable h = new Hashtable (); 95 String className = getClass().getName(); 96 String end = className.substring( 97 className.lastIndexOf((int)'.'), 98 className.length()); 99 h.put("className","org.objectweb.joram.shared.client"+end); 100 102 h.put("requestId",getKey()); 103 if (target != null) 104 h.put("target",target); 105 return h; 106 } 107 108 public static Object soapDecode(Hashtable h) { 109 AbstractJmsRequest req = 110 new AbstractJmsRequest((String ) h.get("target")); 111 req.setRequestId(((Integer ) h.get("requestId")).intValue()); 112 return req; 113 } 114 } 115 | Popular Tags |