1 21 package fr.dyade.aaa.agent; 22 23 import java.io.*; 24 25 29 public class Notification implements Serializable, Cloneable { 30 static final long serialVersionUID = 3007264908616389613L; 31 32 37 protected transient boolean persistent = true; 38 39 44 protected transient boolean detachable = false; 45 46 51 protected transient boolean detached = false; 52 53 59 long expiration = -1L; 60 61 69 public void setExpiration(long expiration) { 70 this.expiration = expiration; 71 } 72 73 89 public long getExpiration() { 90 return expiration; 91 } 92 93 97 transient String messageId = null; 98 99 public String getMessageId() { 100 return messageId; 101 } 102 103 104 private Object context; 105 106 111 public final void setContext(Object context) { 112 this.context = context; 113 } 114 115 120 public final Object getContext() { 121 return context; 122 } 123 124 129 public synchronized Object clone() { 130 try { 131 Notification dup = (Notification) super.clone(); 132 dup.detached = false; 133 dup.messageId = null; 134 return dup; 135 } catch (CloneNotSupportedException e) { 136 throw new InternalError (); 138 } 139 } 140 141 146 public boolean isPersistent() { 147 return persistent; 148 } 149 150 155 public final String toString() { 156 StringBuffer output = new StringBuffer (); 157 return toString(output).toString(); 158 } 159 160 168 public StringBuffer toString(StringBuffer output) { 169 output.append('('); 170 output.append(super.toString()); 171 output.append(",messageId=").append(messageId); 172 output.append(",persistent=").append(persistent); 173 output.append(",detachable=").append(detachable); 174 output.append(",detached=").append(detached); 175 output.append(",context=").append(context); 176 output.append(",expiration=").append(expiration); 177 output.append(')'); 178 179 return output; 180 } 181 182 } 183 | Popular Tags |