class RateControl {

  protected boolean checkExpired() throws DatabusException
  {
    if (!_enabled)
    {
      return false;
    }

    if (_expired)
    {
      return true;
    }

    long throttleDurationInNs = _ra.getDuration();
    if (throttleDurationInNs < (_maxthrottleDurationInSecs*DbusConstants.NUM_NSECS_IN_SEC))
    {
      if (_expired != false)
      {
        throw new DatabusException("Throttle duration has not expired. _expired must be set to false");
      }
    }
    else
    {
      LOG.info("Ending throttling of events as " + _maxthrottleDurationInSecs + " have expired");
      _expired = true;
    }
    return _expired;
  }

  public  RateControl(long numEventsPerSec, long throttleDurationInSecs);

}