cz.zcu.fav.kiv.jsimcasestudies.watersystem.application
Class StationMonitor

java.lang.Object
  |
  +--cz.zcu.fav.kiv.jsimcasestudies.watersystem.application.StationMonitor

class StationMonitor
extends java.lang.Object

An encapsulation of the water station data and functionality. !!! This code should be changed in order to use the JiJ package - passive waiting in requestActivity().

Version:
1.0 from 2004-03-21
Author:
Cesar ALLAIN, Jarda KACER, St.RACEK

Field Summary
 int cntPumpsOn
          Count of pumps currently switched on
 int cntPumpsReady
          Count of pumps that are ready to work
private  CommonControlInterface controlInterface
          A common interface between controlled object and the control program
private  int maxNumberOfPumpsOn
          Maximum number of running pumps
 
Constructor Summary
protected StationMonitor(CommonControlInterface controlInterface, int maxNumberOfPumpsOn)
          Constructor StationMonitor
 
Method Summary
protected  int getCntPumpsOn()
          Synchronized method that return count of running pumps
protected  StationState getStationState()
          Synchronized method that return consistent state of the station
protected  void releaseActivity()
          Synchronized method - source reports, that its pump has been switchd off (water below low level)
protected  boolean requestActivity()
          Synchronized method - source reports its ability to start the pump and requests the activity "permit" to be granted
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

controlInterface

private CommonControlInterface controlInterface
A common interface between controlled object and the control program


maxNumberOfPumpsOn

private final int maxNumberOfPumpsOn
Maximum number of running pumps


cntPumpsOn

public int cntPumpsOn
Count of pumps currently switched on


cntPumpsReady

public int cntPumpsReady
Count of pumps that are ready to work

Constructor Detail

StationMonitor

protected StationMonitor(CommonControlInterface controlInterface,
                         int maxNumberOfPumpsOn)
Constructor StationMonitor

Parameters:
controlInterface -
maxNumberOfPumpsOn -
Method Detail

requestActivity

protected boolean requestActivity()
Synchronized method - source reports its ability to start the pump and requests the activity "permit" to be granted


releaseActivity

protected void releaseActivity()
Synchronized method - source reports, that its pump has been switchd off (water below low level)


getCntPumpsOn

protected int getCntPumpsOn()
Synchronized method that return count of running pumps


getStationState

protected StationState getStationState()
Synchronized method that return consistent state of the station



Copyright © 2000-2004 University of West Bohemia, FAV-KIV. All Rights Reserved. Build date 20040510