1 22 package org.jboss.annotation.ejb; 23 24 import java.lang.annotation.Annotation ; 25 import java.io.Serializable ; 26 import org.jboss.annotation.ejb.DeliveryMode; 27 import org.jboss.annotation.ejb.MessageProperties; 28 29 34 public class MessagePropertiesImpl implements MessageProperties, Serializable 35 { 36 private DeliveryMode deliveryMode = DeliveryMode.PERSISTENT; 37 private int ttl = 0; 38 private int priority = 4; 39 private Class interfac; 40 41 public MessagePropertiesImpl(DeliveryMode deliveryMode, int ttl, int priority) 42 { 43 this.deliveryMode = deliveryMode; 44 this.ttl = ttl; 45 this.priority = priority; 46 } 47 48 public MessagePropertiesImpl(MessageProperties props) 49 { 50 deliveryMode = props.delivery(); 51 ttl = props.timeToLive(); 52 priority = props.priority(); 53 } 54 55 public void setDelivery(DeliveryMode mode) 56 { 57 this.deliveryMode = mode; 58 } 59 60 public void setPriority(int priority) 61 { 62 this.priority = priority; 63 } 64 65 public MessagePropertiesImpl() 66 { 67 68 } 69 70 public DeliveryMode delivery() 71 { 72 return deliveryMode; 73 } 74 75 public int timeToLive() 76 { 77 return ttl; 78 } 79 80 public int priority() 81 { 82 return priority; 83 } 84 85 public Class getInterface() 86 { 87 return interfac; 88 } 89 90 public void setInterface(Class interfac) 91 { 92 this.interfac = interfac; 93 } 94 95 public Class <? extends Annotation > annotationType() 96 { 97 return MessageProperties.class; 98 } 99 } 100 | Popular Tags |