Tabnine Logo
SitemapResource$BlockingStateChangeListener.hasChangeOccurred
Code IndexAdd Tabnine to your IDE (free)

How to use
hasChangeOccurred
method
in
org.eclipse.smarthome.io.rest.sitemap.internal.SitemapResource$BlockingStateChangeListener

Best Java code snippets using org.eclipse.smarthome.io.rest.sitemap.internal.SitemapResource$BlockingStateChangeListener.hasChangeOccurred (Showing top 2 results out of 315)

origin: org.eclipse.smarthome.io/org.eclipse.smarthome.io.rest.sitemap

/**
 * This method only returns when a change has occurred to any item on the
 * page to display or if the timeout is reached
 *
 * @param widgets
 *            the widgets of the page to observe
 */
private boolean waitForChanges(EList<Widget> widgets) {
  long startTime = (new Date()).getTime();
  boolean timeout = false;
  BlockingStateChangeListener listener = new BlockingStateChangeListener();
  // let's get all items for these widgets
  Set<GenericItem> items = getAllItems(widgets);
  for (GenericItem item : items) {
    item.addStateChangeListener(listener);
  }
  while (!listener.hasChangeOccurred() && !timeout) {
    timeout = (new Date()).getTime() - startTime > TIMEOUT_IN_MS;
    try {
      Thread.sleep(300);
    } catch (InterruptedException e) {
      timeout = true;
      break;
    }
  }
  for (GenericItem item : items) {
    item.removeStateChangeListener(listener);
  }
  return !timeout;
}
origin: openhab/openhab-core

  item.addStateChangeListener(listener);
while (!listener.hasChangeOccurred() && !timeout) {
  timeout = (new Date()).getTime() - startTime > TIMEOUT_IN_MS;
  try {
org.eclipse.smarthome.io.rest.sitemap.internalSitemapResource$BlockingStateChangeListenerhasChangeOccurred

Javadoc

determines, whether a state change has occurred since its creation

Popular methods of SitemapResource$BlockingStateChangeListener

  • <init>

Popular in Java

  • Finding current android device location
  • addToBackStack (FragmentTransaction)
  • getResourceAsStream (ClassLoader)
  • getApplicationContext (Context)
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • BoxLayout (javax.swing)
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now