Java 8 Condition - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 Condition class.

This code example shows how to use the following methods:signal
 
    @Override 
    public Weather loadDataFromNetwork() throws Exception { 
        try { 
            reentrantLock.lock(); 
            loadDataFromNetworkHasBeenExecuted.signal(); 
        } finally { 
            reentrantLock.unlock(); 
        } 
        return new Weather(); 
    } 
 
    public void await(long timeout) throws InterruptedException { 
        try { 
            reentrantLock.lock(); 
            loadDataFromNetworkHasBeenExecuted.await(timeout, 
                TimeUnit.MILLISECONDS); 
        } finally { 
            reentrantLock.unlock(); 
        } 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:signal
        lock.lock();
        try { 
            checkIsExectuedInUIThread(); 
            isSuccessful = false;
            this.exception = exception;
            requestFinishedCondition.signal();
        } finally { 
            lock.unlock();
        } 
    } 
 
    @Override 
    public void onRequestSuccess( T arg0 ) {
        lock.lock();
        try { 
            checkIsExectuedInUIThread(); 
            isSuccessful = true;
            requestFinishedCondition.signal();
        } finally { 
            lock.unlock();
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:signalAll
        this.condition = condition;
    } 
 
    public void dispatch(InterHubMessage message) {
        queue.add(message);
        condition.signalAll();
    } 
 
    public void take(Collection<InterHubMessage> drainTo) {
        if (queue.isEmpty()) {
            owner.empty(this);
        } 
        while (queue.isEmpty()) {
            try { 
                condition.await();
            } catch (InterruptedException e) {
                throw UncheckedException.throwAsUncheckedException(e);
            } 
        } 
        drainTo.addAll(queue);
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:signalAll
    content.getBytes(0, _receivedBytes);
    _lock.lock();
    try 
    { 
      _hasResponse = true;
      _hasResponseCondition.signalAll();
    } 
    finally 
    { 
      _lock.unlock();
    } 
  } 
 
  public void awaitResponseUninterruptedly() 
  { 
    _lock.lock();
    try 
    { 
      while (!_hasResponse) _hasResponseCondition.awaitUninterruptibly();
    } 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:signal
        lock.lock();
        try { 
            checkIsExectuedInUIThread(); 
            isSuccessful = false;
            this.exception = exception;
            requestFinishedCondition.signal();
        } finally { 
            lock.unlock();
        } 
    } 
 
    @Override 
    public void onRequestSuccess(T arg0) {
        lock.lock();
        try { 
            checkIsExectuedInUIThread(); 
            isSuccessful = true;
            requestFinishedCondition.signal();
        } finally { 
            lock.unlock();
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:signalAll
_msgLock.lock();
    try 
    { 
      _messages.add(e.getMessage());
      _newMsgCondition.signalAll();
    } 
    finally 
    { 
      _msgLock.unlock();
    } 
    super.messageReceived(ctx, e);
  } 
 
} 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:signalAll
 
    private void onEndAction() { 
        lock.lock();
        try { 
            executing.remove(Thread.currentThread());
            condition.signalAll();
        } finally { 
            lock.unlock();
        } 
    } 
} 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:await
    } 
 
    public void await(long millisecond) throws InterruptedException {
        lock.lock();
        try { 
            requestFinishedCondition.await(millisecond, TimeUnit.MILLISECONDS);
        } finally { 
            lock.unlock();
        } 
    } 
} 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:signal
        lock.lock();
        try { 
            checkIsExectuedInUIThread(); 
            isSuccessful = false;
            this.exception = exception;
            requestFinishedCondition.signal();
        } finally { 
            lock.unlock();
        } 
    } 
 
    @Override 
    public void onRequestSuccess(T arg0) {
        lock.lock();
        try { 
            checkIsExectuedInUIThread(); 
            isSuccessful = true;
            requestFinishedCondition.signal();
        } finally { 
            lock.unlock();
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:signal
    @Override 
    public boolean offer(T t) {
        lock.lock();
        try { 
            elements.add(t);
            notEmpty.signal();
            return true; 
        } finally { 
            lock.unlock();
        } 
    } 
 
    @Override 
    public T poll() { 
        lock.lock();
        try { 
            return dequeue(); 
        } finally { 
            lock.unlock();
        } 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java

Related Java 8 Condition Questions & Answers:

See Code Examples for Java 8 Condition Methods: