Package org.openhab.binding.digitalstrom.internal.client.job

Examples of org.openhab.binding.digitalstrom.internal.client.job.SensorJob


      }
    }
  }

  private SensorJob getLowPriorityJob() {
    SensorJob job = null;
    synchronized (lowPrioritySensorJobs) {
      if (lowPrioritySensorJobs.size() > 0) {
        job = lowPrioritySensorJobs.get(0);
        lowPrioritySensorJobs.remove(job);
      }
View Full Code Here


    }
    return job;
  }

  private SensorJob getMediumPriorityJob() {
    SensorJob job = null;
    synchronized (mediumPrioritySensorJobs) {
      if (mediumPrioritySensorJobs.size() > 0) {
        job = mediumPrioritySensorJobs.get(0);
        mediumPrioritySensorJobs.remove(job);
      }
View Full Code Here

    }
    return job;
  }

  private SensorJob getHighPriorityJob() {
    SensorJob job = null;
    synchronized (highPrioritySensorJobs) {
      if (highPrioritySensorJobs.size() > 0) {
        job = highPrioritySensorJobs.get(0);
        highPrioritySensorJobs.remove(job);
      }
View Full Code Here

  private void removeSensorJobs(DSID dsid) {
    synchronized (lowPrioritySensorJobs) {
      for (Iterator<SensorJob> iter = lowPrioritySensorJobs.iterator(); iter
          .hasNext();) {
        SensorJob job = iter.next();
        if (job.getDsid().equals(dsid))
          iter.remove();
      }
    }
    synchronized (mediumPrioritySensorJobs) {
      for (Iterator<SensorJob> iter = mediumPrioritySensorJobs.iterator(); iter
          .hasNext();) {
        SensorJob job = iter.next();
        if (job.getDsid().equals(dsid))
          iter.remove();
      }
    }
    synchronized (highPrioritySensorJobs) {
      for (Iterator<SensorJob> iter = highPrioritySensorJobs.iterator(); iter
          .hasNext();) {
        SensorJob job = iter.next();
        if (job.getDsid().equals(dsid))
          iter.remove();
      }
    }
  }
View Full Code Here

    @Override
    public void run() {

      while (!this.shutdown) {
        SensorJob job = getHighPriorityJob();

        if (job == null) {
          job = getMediumPriorityJob();
          if (job == null)
            job = getLowPriorityJob();
        }
        if (job != null) {
          job.execute(digitalSTROM, getSessionToken());
        }

        try {
          sleep(this.sleepTime);
        } catch (InterruptedException e) {
View Full Code Here

TOP

Related Classes of org.openhab.binding.digitalstrom.internal.client.job.SensorJob

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.