home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1997 August / PCO0897.ISO / filesbbs / os2 / fp1os2.arj / OS2 / DATA / 49 / C / 0 / F_26836 / SJCondMsgStruct.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-05-15  |  1.7 KB  |  76 lines

  1. import stardiv.tools.SjProtocolWindow;
  2.  
  3. class SJCondMsgStruct implements SJCondition {
  4.    private boolean bMessagePending;
  5.    private SJMessageHandlerInterface aOwner;
  6.    private SJMessageHandlerInterface aDestination;
  7.    private SJMessage aMessage;
  8.    public SJCondition[] aCondEventArray;
  9.  
  10.    public final void SetOwner(SJMessageHandlerInterface var1) {
  11.       this.aOwner = var1;
  12.    }
  13.  
  14.    public final SJMessageHandlerInterface GetOwner() {
  15.       return this.aOwner;
  16.    }
  17.  
  18.    public final void SetDestination(SJMessageHandlerInterface var1) {
  19.       this.aDestination = var1;
  20.    }
  21.  
  22.    public final SJMessageHandlerInterface GetDestination() {
  23.       return this.aDestination;
  24.    }
  25.  
  26.    public final void SetMessage(SJMessage var1) {
  27.       this.aMessage = var1;
  28.    }
  29.  
  30.    public final SJMessage GetMessage() {
  31.       return this.aMessage;
  32.    }
  33.  
  34.    protected private SJCondMsgStruct(SJMessageHandlerInterface var1) {
  35.       this.aOwner = var1;
  36.       this.aDestination = null;
  37.       this.aMessage = null;
  38.       this.aCondEventArray = null;
  39.       this.bMessagePending = false;
  40.    }
  41.  
  42.    public synchronized boolean IsTrue() {
  43.       return false;
  44.    }
  45.  
  46.    public synchronized boolean AllConditionsTrue() {
  47.       if (this.aCondEventArray != null) {
  48.          for(int var1 = 0; var1 < this.aCondEventArray.length; ++var1) {
  49.             if (!this.aCondEventArray[var1].IsTrue()) {
  50.                return false;
  51.             }
  52.          }
  53.       }
  54.  
  55.       return true;
  56.    }
  57.  
  58.    public void Deliver() {
  59.       if (this.aDestination != null) {
  60.          this.aDestination.HandleMessage(this.aMessage);
  61.       }
  62.  
  63.    }
  64.  
  65.    public final synchronized boolean PeekMessagePending() {
  66.       return this.bMessagePending;
  67.    }
  68.  
  69.    protected private final synchronized void SetMessagePending() {
  70.       this.bMessagePending = true;
  71.       SjProtocolWindow.AddNotifyEvent(this, "SJJob.SetMessagePending()");
  72.       this.notifyAll();
  73.       SjProtocolWindow.AddNotifyEventDONE(this, "SJJob.SetMessagePending()");
  74.    }
  75. }
  76.