Tabnine Logo
Object.notify
Code IndexAdd Tabnine to your IDE (free)

How to use
notify
method
in
java.lang.Object

Best Java code snippets using java.lang.Object.notify (Showing top 20 results out of 25,335)

origin: apache/kafka

public void close() {
  synchronized (AbstractCoordinator.this) {
    this.closed = true;
    AbstractCoordinator.this.notify();
  }
}
origin: redisson/redisson

/**
 * Notifies an object for synchronization purposes.
 */
public static void notify(Object obj){
  synchronized (obj) {
    obj.notify();
  }
}
origin: apache/incubator-druid

public void done()
{
 synchronized (singleByteReaderDoer) {
  done = true;
  singleByteReaderDoer.notify();
 }
}
origin: apache/incubator-druid

public void exceptionCaught(Throwable t)
{
 synchronized (singleByteReaderDoer) {
  done = true;
  throwable = t;
  singleByteReaderDoer.notify();
 }
}
origin: apache/flink

protected void stopRetrieval() {
  // stop retrieval
  refreshThread.isRunning = false;
  synchronized (refreshThread) {
    refreshThread.notify();
  }
}
origin: apache/rocketmq

public void wakeup() {
  synchronized (this) {
    if (!this.hasNotified) {
      this.hasNotified = true;
      this.notify();
    }
  }
}
origin: spring-projects/spring-framework

/**
 * To be invoked after the main execution logic of concrete subclasses.
 * @see #beforeAccess()
 */
protected void afterAccess() {
  if (this.concurrencyLimit >= 0) {
    synchronized (this.monitor) {
      this.concurrencyCount--;
      if (logger.isDebugEnabled()) {
        logger.debug("Returning from throttle at concurrency count " + this.concurrencyCount);
      }
      this.monitor.notify();
    }
  }
}
origin: apache/incubator-druid

public void add(byte[] bytesToAdd)
{
 if (bytesToAdd.length == 0) {
  return;
 }
 synchronized (singleByteReaderDoer) {
  bytes.addLast(bytesToAdd);
  available += bytesToAdd.length;
  singleByteReaderDoer.notify();
 }
}
origin: apache/incubator-druid

public void putRequest(final DruidPullRequest request)
{
 synchronized (this) {
  this.requestsWrite.add(request);
  if (!hasNotified) {
   hasNotified = true;
   notify();
  }
 }
}
origin: spring-projects/spring-framework

public void stop() {
  synchronized(this.lock) {
    this.lock.notify();
  }
}
origin: stackoverflow.com

 class BlockingQueue {
  Queue<String> buffer = new LinkedList<String>();

  public void give(String data) {
    buffer.add(data);
    notify();                   // Since someone may be waiting in take!
  }

  public String take() throws InterruptedException {
    while (buffer.isEmpty())    // don't use "if" due to spurious wakeups.
      wait();
    return buffer.remove();
  }
}
origin: log4j/log4j

void close() {
 synchronized (bf) {
  interrupted = true;
  // We have a waiting dispacther if and only if bf.length is
  // zero.  In that case, we need to give it a death kiss.
  if (bf.length() == 0) {
   bf.notify();
  }
 }
}
origin: apache/kafka

@Override
public synchronized void wakeup() {
  if (numBlockingWakeups > 0) {
    numBlockingWakeups--;
    notify();
  }
}
origin: apache/kafka

public void enable() {
  synchronized (AbstractCoordinator.this) {
    log.debug("Enabling heartbeat thread");
    this.enabled = true;
    heartbeat.resetTimeouts();
    AbstractCoordinator.this.notify();
  }
}
origin: apache/flink

protected void decreaseRefreshInterval(int minInterval) {
  refreshInterval = Math.max(minInterval, refreshInterval - 1);
  // reset view
  resetAllParts();
  synchronized (refreshThread) {
    refreshThread.notify();
  }
}
origin: apache/flink

protected void increaseRefreshInterval() {
  refreshInterval = Math.min(REFRESH_INTERVALS.size() - 1, refreshInterval + 1);
  // reset view
  resetAllParts();
  synchronized (refreshThread) {
    refreshThread.notify();
  }
}
origin: square/okio

 @Override public void run() {
  synchronized (WaitUntilNotifiedTest.this) {
   WaitUntilNotifiedTest.this.notify();
  }
 }
}, 1000, TimeUnit.MILLISECONDS);
origin: apache/incubator-dubbo

protected void registered(URL url) {
  for (Map.Entry<URL, Set<NotifyListener>> entry : getSubscribed().entrySet()) {
    URL key = entry.getKey();
    if (UrlUtils.isMatch(key, url)) {
      Set<URL> urls = received.get(key);
      if (urls == null) {
        received.putIfAbsent(key, new ConcurrentHashSet<URL>());
        urls = received.get(key);
      }
      urls.add(url);
      List<URL> list = toList(urls);
      for (NotifyListener listener : entry.getValue()) {
        notify(key, listener, list);
        synchronized (listener) {
          listener.notify();
        }
      }
    }
  }
}
origin: apache/incubator-dubbo

protected void registered(URL url) {
  for (Map.Entry<URL, Set<NotifyListener>> entry : getSubscribed().entrySet()) {
    URL key = entry.getKey();
    if (UrlUtils.isMatch(key, url)) {
      Set<URL> urls = received.get(key);
      if (urls == null) {
        received.putIfAbsent(key, new ConcurrentHashSet<URL>());
        urls = received.get(key);
      }
      urls.add(url);
      List<URL> list = toList(urls);
      for (NotifyListener listener : entry.getValue()) {
        notify(key, listener, list);
        synchronized (listener) {
          listener.notify();
        }
      }
    }
  }
}
origin: spring-projects/spring-framework

@Override
public void run() {
  if (this.acceptOnExecution) {
    this.workListener.workAccepted(new WorkEvent(this, WorkEvent.WORK_ACCEPTED, this.work, null));
  }
  synchronized (this.monitor) {
    this.started = true;
    this.monitor.notify();
  }
  this.workListener.workStarted(new WorkEvent(this, WorkEvent.WORK_STARTED, this.work, null));
  try {
    this.work.run();
  }
  catch (RuntimeException | Error ex) {
    this.workListener.workCompleted(
        new WorkEvent(this, WorkEvent.WORK_COMPLETED, this.work, new WorkCompletedException(ex)));
    throw ex;
  }
  this.workListener.workCompleted(new WorkEvent(this, WorkEvent.WORK_COMPLETED, this.work, null));
}
java.langObjectnotify

Popular methods of Object

  • getClass
  • toString
  • equals
  • hashCode
  • wait
  • notifyAll
  • clone
  • <init>
  • finalize

Popular in Java

  • Creating JSON documents from java classes using gson
  • onCreateOptionsMenu (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • getSupportFragmentManager (FragmentActivity)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Github Copilot 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