1 18 package freecs.content; 19 import freecs.Server; 20 import freecs.core.*; 21 22 27 public class MessageState { 28 public volatile boolean useRenderCache, moderated; 29 public volatile Group sourceGroup, targetGroup; 30 public volatile User sender, usercontext; 31 public volatile String message, param, msg, reason; 32 public volatile String msgTemplate; 33 public volatile ConnectionBuffer cb; 34 public MessageParser mp; 35 public volatile Object [] usrList; 36 37 public MessageState (MessageParser mp) { 38 this.mp=mp; 39 clear(); 40 if (Server.TRACE_CREATE_AND_FINALIZE) 41 Server.log (this, "++++++++++++++++++++++++++++++++++++++++CREATE", Server.MSG_STATE, Server.LVL_VERY_VERBOSE); 42 } 43 44 public void clear() { 45 sender=null; 46 usercontext=null; 47 message=null; 48 reason=null; 49 msg=null; 50 msgTemplate=null; 51 useRenderCache=true; 52 moderated = false; 53 usrList = null; 54 } 55 56 public void inhale (MessageState mst) { 57 this.cb = mst.cb; 58 this.message = mst.message; 59 this.moderated = mst.moderated; 60 this.msg = mst.msg; 61 this.msgTemplate = mst.msgTemplate; 62 this.reason = mst.reason; 63 this.sender = mst.sender; 64 this.sourceGroup = mst.sourceGroup; 65 this.targetGroup = mst.targetGroup; 66 this.usercontext = mst.usercontext; 67 this.useRenderCache = mst.useRenderCache; 68 this.usrList = mst.usrList; 69 } 70 71 public Object clone () { 72 MessageState mst = new MessageState(this.mp); 73 mst.cb = this.cb; 74 mst.message = this.message; 75 mst.moderated = this.moderated; 76 mst.msg = this.msg; 77 mst.msgTemplate = this.msgTemplate; 78 mst.reason = this.reason; 79 mst.sender = this.sender; 80 mst.sourceGroup = this.sourceGroup; 81 mst.targetGroup = this.targetGroup; 82 mst.usercontext = this.usercontext; 83 mst.useRenderCache = this.useRenderCache; 84 mst.usrList = this.usrList; 85 return mst; 86 } 87 88 public void finalize() { 89 if (Server.TRACE_CREATE_AND_FINALIZE) 90 Server.log(this, "----------------------------------------FINALIZED", Server.MSG_STATE, Server.LVL_VERY_VERBOSE); 91 } 92 } 93 | Popular Tags |