1 24 package com.scalagent.kjoram.jms; 25 26 import java.util.Hashtable ; 27 import java.util.Enumeration ; 28 29 33 public class ConsumerReceiveRequest extends AbstractJmsRequest 34 { 35 36 private String selector; 37 38 private long timeToLive; 39 40 private boolean queueMode; 41 42 43 53 public ConsumerReceiveRequest(String targetName, String selector, 54 long timeToLive, boolean queueMode) 55 { 56 super(targetName); 57 this.selector = selector; 58 this.timeToLive = timeToLive; 59 this.queueMode = queueMode; 60 } 61 62 65 public ConsumerReceiveRequest() 66 {} 67 68 69 public void setSelector(String selector) 70 { 71 this.selector = selector; 72 } 73 74 75 public void setTimeToLive(long timeToLive) 76 { 77 this.timeToLive = timeToLive; 78 } 79 80 81 public void setQueueMode(boolean queueMode) 82 { 83 this.queueMode = queueMode; 84 } 85 86 87 public String getSelector() 88 { 89 return selector; 90 } 91 92 93 public long getTimeToLive() 94 { 95 return timeToLive; 96 } 97 98 99 public boolean getQueueMode() 100 { 101 return queueMode; 102 } 103 104 public Hashtable soapCode() { 105 Hashtable h = super.soapCode(); 106 if (selector != null) 107 h.put("selector",selector); 108 h.put("timeToLive",new Long (timeToLive)); 109 h.put("queueMode",new Boolean (queueMode)); 110 return h; 111 } 112 113 public static Object soapDecode(Hashtable h) { 114 ConsumerReceiveRequest req = new ConsumerReceiveRequest(); 115 req.setRequestId(((Integer ) h.get("requestId")).intValue()); 116 req.setTarget((String ) h.get("target")); 117 req.setSelector((String ) h.get("selector")); 118 req.setQueueMode(((Boolean ) h.get("queueMode")).booleanValue()); 119 req.setTimeToLive(((Long ) h.get("timeToLive")).longValue()); 120 return req; 121 } 122 } 123 | Popular Tags |