home *** CD-ROM | disk | FTP | other *** search
- public class SJMessage {
- private int nMessageID;
- private SJMessageHandlerInterface aNotifyObj;
- private SJMessageHandlerInterface aCallbackObj;
- private Object[] aObjArray;
- public static final int ID_EMPTY = 0;
- public static final int ID_NOTIFY_MESSAGE_DONE = 10000;
- public static final int ID_NOTIFY_MESSAGE_RECEIVED = 10001;
- public static final int ID_NOTIFY_MESSAGE_ERROR = 10002;
- public static final int ID_NOTIFY_JOB_FINISHED = 10011;
- public static final int ID_NOTIFY_JOB_KILLED = 10012;
- public static final int ID_DATA_FOR_JOB_FINISHED = 10013;
- public static final int ID_NOTIFY_THREAD_STARTED = 10021;
- public static final int ID_NOTIFY_THREAD_SUSPENDED = 10022;
- public static final int ID_NOTIFY_THREAD_STOPED = 10023;
- public static final int ID_PING = 10030;
- public static final int ID_NOTIFY_PING = 10031;
-
- public final void JOB_SetNotifyObject(SJMessageHandlerInterface var1) {
- this.aNotifyObj = var1;
- }
-
- private final SJMessageHandlerInterface GetNotifyObject() {
- return this.aNotifyObj;
- }
-
- public SJMessage() {
- this(0);
- }
-
- public SJMessage(int var1) {
- this(var1, (SJMessageHandlerInterface)null, (Object)null);
- }
-
- public SJMessage(int var1, SJMessageHandlerInterface var2) {
- this.nMessageID = var1;
- this.aCallbackObj = var2;
- this.aObjArray = null;
- }
-
- public SJMessage(int var1, SJMessageHandlerInterface var2, Object var3) {
- this(var1, var2);
- this.aObjArray = new Object[1];
- this.SetObject(0, var3);
- }
-
- public final int GetID() {
- return this.nMessageID;
- }
-
- public final int GetNoOfObjects() {
- return this.aObjArray == null ? 0 : this.aObjArray.length;
- }
-
- public final void SetNoOfObjects(int var1) {
- this.aObjArray = new Object[var1];
- }
-
- public final void SetObject(int var1, Object var2) {
- this.aObjArray[var1] = var2;
- }
-
- public final Object GetObject(int var1) {
- return this.aObjArray == null ? null : this.aObjArray[var1];
- }
-
- public final void PostToCallback(SJMessage var1) {
- if (this.aCallbackObj != null) {
- this.aCallbackObj.HandleMessage(var1);
- } else {
- System.out.println("PostToCallback() without aCallbackObj, MsgID=" + this.GetID());
- }
- }
-
- public final void PostToNotify(SJMessage var1) {
- if (this.aNotifyObj != null) {
- this.aNotifyObj.HandleMessage(var1);
- }
-
- }
-
- public final void Acknowledge() {
- this.PostToNotify(new SJMessage(10000, (SJMessageHandlerInterface)null, this));
- }
-
- public final void AcknowledgeError() {
- this.PostToNotify(new SJMessage(10002, (SJMessageHandlerInterface)null, this));
- }
-
- public final void JobFinished() {
- this.PostToNotify(new SJMessage(10011, (SJMessageHandlerInterface)null, this));
- }
-
- public final void AcknowledgePing() {
- this.PostToNotify(new SJMessage(10031, (SJMessageHandlerInterface)null, this));
- }
- }
-