Codota Logo
DefaultPromise.notifyListener0
Code IndexAdd Codota to your IDE (free)

How to use
notifyListener0
method
in
io.netty.util.concurrent.DefaultPromise

Best Java code snippets using io.netty.util.concurrent.DefaultPromise.notifyListener0 (Showing top 20 results out of 315)

  • Common ways to obtain DefaultPromise
private void myMethod () {
DefaultPromise d =
  • Codota IconEventExecutor executor;new DefaultPromise<>(executor)
  • Smart code suggestions by Codota
}
origin: netty/netty

private void notifyListenersNow() {
  Object listeners;
  synchronized (this) {
    // Only proceed if there are listeners to notify and we are not already notifying listeners.
    if (notifyingListeners || this.listeners == null) {
      return;
    }
    notifyingListeners = true;
    listeners = this.listeners;
    this.listeners = null;
  }
  for (;;) {
    if (listeners instanceof DefaultFutureListeners) {
      notifyListeners0((DefaultFutureListeners) listeners);
    } else {
      notifyListener0(this, (GenericFutureListener<?>) listeners);
    }
    synchronized (this) {
      if (this.listeners == null) {
        // Nothing can throw from within this method, so setting notifyingListeners back to false does not
        // need to be in a finally block.
        notifyingListeners = false;
        return;
      }
      listeners = this.listeners;
      this.listeners = null;
    }
  }
}
origin: netty/netty

private void notifyListeners0(DefaultFutureListeners listeners) {
  GenericFutureListener<?>[] a = listeners.listeners();
  int size = listeners.size();
  for (int i = 0; i < size; i ++) {
    notifyListener0(this, a[i]);
  }
}
origin: redisson/redisson

private void notifyListenersNow() {
  Object listeners;
  synchronized (this) {
    // Only proceed if there are listeners to notify and we are not already notifying listeners.
    if (notifyingListeners || this.listeners == null) {
      return;
    }
    notifyingListeners = true;
    listeners = this.listeners;
    this.listeners = null;
  }
  for (;;) {
    if (listeners instanceof DefaultFutureListeners) {
      notifyListeners0((DefaultFutureListeners) listeners);
    } else {
      notifyListener0(this, (GenericFutureListener<?>) listeners);
    }
    synchronized (this) {
      if (this.listeners == null) {
        // Nothing can throw from within this method, so setting notifyingListeners back to false does not
        // need to be in a finally block.
        notifyingListeners = false;
        return;
      }
      listeners = this.listeners;
      this.listeners = null;
    }
  }
}
origin: redisson/redisson

private void notifyListeners0(DefaultFutureListeners listeners) {
  GenericFutureListener<?>[] a = listeners.listeners();
  int size = listeners.size();
  for (int i = 0; i < size; i ++) {
    notifyListener0(this, a[i]);
  }
}
origin: wildfly/wildfly

private void notifyListenersNow() {
  Object listeners;
  synchronized (this) {
    // Only proceed if there are listeners to notify and we are not already notifying listeners.
    if (notifyingListeners || this.listeners == null) {
      return;
    }
    notifyingListeners = true;
    listeners = this.listeners;
    this.listeners = null;
  }
  for (;;) {
    if (listeners instanceof DefaultFutureListeners) {
      notifyListeners0((DefaultFutureListeners) listeners);
    } else {
      notifyListener0(this, (GenericFutureListener<?>) listeners);
    }
    synchronized (this) {
      if (this.listeners == null) {
        // Nothing can throw from within this method, so setting notifyingListeners back to false does not
        // need to be in a finally block.
        notifyingListeners = false;
        return;
      }
      listeners = this.listeners;
      this.listeners = null;
    }
  }
}
origin: wildfly/wildfly

private void notifyListeners0(DefaultFutureListeners listeners) {
  GenericFutureListener<?>[] a = listeners.listeners();
  int size = listeners.size();
  for (int i = 0; i < size; i ++) {
    notifyListener0(this, a[i]);
  }
}
origin: netty/netty

/**
 * The logic in this method should be identical to {@link #notifyListeners()} but
 * cannot share code because the listener(s) cannot be cached for an instance of {@link DefaultPromise} since the
 * listener(s) may be changed and is protected by a synchronized operation.
 */
private static void notifyListenerWithStackOverFlowProtection(final EventExecutor executor,
                               final Future<?> future,
                               final GenericFutureListener<?> listener) {
  if (executor.inEventLoop()) {
    final InternalThreadLocalMap threadLocals = InternalThreadLocalMap.get();
    final int stackDepth = threadLocals.futureListenerStackDepth();
    if (stackDepth < MAX_LISTENER_STACK_DEPTH) {
      threadLocals.setFutureListenerStackDepth(stackDepth + 1);
      try {
        notifyListener0(future, listener);
      } finally {
        threadLocals.setFutureListenerStackDepth(stackDepth);
      }
      return;
    }
  }
  safeExecute(executor, new Runnable() {
    @Override
    public void run() {
      notifyListener0(future, listener);
    }
  });
}
origin: redisson/redisson

/**
 * The logic in this method should be identical to {@link #notifyListeners()} but
 * cannot share code because the listener(s) cannot be cached for an instance of {@link DefaultPromise} since the
 * listener(s) may be changed and is protected by a synchronized operation.
 */
private static void notifyListenerWithStackOverFlowProtection(final EventExecutor executor,
                               final Future<?> future,
                               final GenericFutureListener<?> listener) {
  if (executor.inEventLoop()) {
    final InternalThreadLocalMap threadLocals = InternalThreadLocalMap.get();
    final int stackDepth = threadLocals.futureListenerStackDepth();
    if (stackDepth < MAX_LISTENER_STACK_DEPTH) {
      threadLocals.setFutureListenerStackDepth(stackDepth + 1);
      try {
        notifyListener0(future, listener);
      } finally {
        threadLocals.setFutureListenerStackDepth(stackDepth);
      }
      return;
    }
  }
  safeExecute(executor, new Runnable() {
    @Override
    public void run() {
      notifyListener0(future, listener);
    }
  });
}
origin: wildfly/wildfly

/**
 * The logic in this method should be identical to {@link #notifyListeners()} but
 * cannot share code because the listener(s) cannot be cached for an instance of {@link DefaultPromise} since the
 * listener(s) may be changed and is protected by a synchronized operation.
 */
private static void notifyListenerWithStackOverFlowProtection(final EventExecutor executor,
                               final Future<?> future,
                               final GenericFutureListener<?> listener) {
  if (executor.inEventLoop()) {
    final InternalThreadLocalMap threadLocals = InternalThreadLocalMap.get();
    final int stackDepth = threadLocals.futureListenerStackDepth();
    if (stackDepth < MAX_LISTENER_STACK_DEPTH) {
      threadLocals.setFutureListenerStackDepth(stackDepth + 1);
      try {
        notifyListener0(future, listener);
      } finally {
        threadLocals.setFutureListenerStackDepth(stackDepth);
      }
      return;
    }
  }
  safeExecute(executor, new Runnable() {
    @Override
    public void run() {
      notifyListener0(future, listener);
    }
  });
}
origin: io.netty/netty-common

private void notifyListenersNow() {
  Object listeners;
  synchronized (this) {
    // Only proceed if there are listeners to notify and we are not already notifying listeners.
    if (notifyingListeners || this.listeners == null) {
      return;
    }
    notifyingListeners = true;
    listeners = this.listeners;
    this.listeners = null;
  }
  for (;;) {
    if (listeners instanceof DefaultFutureListeners) {
      notifyListeners0((DefaultFutureListeners) listeners);
    } else {
      notifyListener0(this, (GenericFutureListener<?>) listeners);
    }
    synchronized (this) {
      if (this.listeners == null) {
        // Nothing can throw from within this method, so setting notifyingListeners back to false does not
        // need to be in a finally block.
        notifyingListeners = false;
        return;
      }
      listeners = this.listeners;
      this.listeners = null;
    }
  }
}
origin: io.netty/netty-common

private void notifyListeners0(DefaultFutureListeners listeners) {
  GenericFutureListener<?>[] a = listeners.listeners();
  int size = listeners.size();
  for (int i = 0; i < size; i ++) {
    notifyListener0(this, a[i]);
  }
}
origin: io.netty/netty-common

/**
 * The logic in this method should be identical to {@link #notifyListeners()} but
 * cannot share code because the listener(s) cannot be cached for an instance of {@link DefaultPromise} since the
 * listener(s) may be changed and is protected by a synchronized operation.
 */
private static void notifyListenerWithStackOverFlowProtection(final EventExecutor executor,
                               final Future<?> future,
                               final GenericFutureListener<?> listener) {
  if (executor.inEventLoop()) {
    final InternalThreadLocalMap threadLocals = InternalThreadLocalMap.get();
    final int stackDepth = threadLocals.futureListenerStackDepth();
    if (stackDepth < MAX_LISTENER_STACK_DEPTH) {
      threadLocals.setFutureListenerStackDepth(stackDepth + 1);
      try {
        notifyListener0(future, listener);
      } finally {
        threadLocals.setFutureListenerStackDepth(stackDepth);
      }
      return;
    }
  }
  safeExecute(executor, new Runnable() {
    @Override
    public void run() {
      notifyListener0(future, listener);
    }
  });
}
origin: apache/activemq-artemis

private void notifyListenersNow() {
  Object listeners;
  synchronized (this) {
    // Only proceed if there are listeners to notify and we are not already notifying listeners.
    if (notifyingListeners || this.listeners == null) {
      return;
    }
    notifyingListeners = true;
    listeners = this.listeners;
    this.listeners = null;
  }
  for (;;) {
    if (listeners instanceof DefaultFutureListeners) {
      notifyListeners0((DefaultFutureListeners) listeners);
    } else {
      notifyListener0(this, (GenericFutureListener<?>) listeners);
    }
    synchronized (this) {
      if (this.listeners == null) {
        // Nothing can throw from within this method, so setting notifyingListeners back to false does not
        // need to be in a finally block.
        notifyingListeners = false;
        return;
      }
      listeners = this.listeners;
      this.listeners = null;
    }
  }
}
origin: apache/activemq-artemis

private void notifyListeners0(DefaultFutureListeners listeners) {
  GenericFutureListener<?>[] a = listeners.listeners();
  int size = listeners.size();
  for (int i = 0; i < size; i ++) {
    notifyListener0(this, a[i]);
  }
}
origin: org.apache.activemq/artemis-jms-client-all

private void notifyListenersNow() {
  Object listeners;
  synchronized (this) {
    // Only proceed if there are listeners to notify and we are not already notifying listeners.
    if (notifyingListeners || this.listeners == null) {
      return;
    }
    notifyingListeners = true;
    listeners = this.listeners;
    this.listeners = null;
  }
  for (;;) {
    if (listeners instanceof DefaultFutureListeners) {
      notifyListeners0((DefaultFutureListeners) listeners);
    } else {
      notifyListener0(this, (GenericFutureListener<?>) listeners);
    }
    synchronized (this) {
      if (this.listeners == null) {
        // Nothing can throw from within this method, so setting notifyingListeners back to false does not
        // need to be in a finally block.
        notifyingListeners = false;
        return;
      }
      listeners = this.listeners;
      this.listeners = null;
    }
  }
}
origin: org.apache.activemq/artemis-jms-client-all

private void notifyListeners0(DefaultFutureListeners listeners) {
  GenericFutureListener<?>[] a = listeners.listeners();
  int size = listeners.size();
  for (int i = 0; i < size; i ++) {
    notifyListener0(this, a[i]);
  }
}
origin: org.jboss.eap/wildfly-client-all

private void notifyListeners0(DefaultFutureListeners listeners) {
  GenericFutureListener<?>[] a = listeners.listeners();
  int size = listeners.size();
  for (int i = 0; i < size; i ++) {
    notifyListener0(this, a[i]);
  }
}
origin: apache/activemq-artemis

/**
 * The logic in this method should be identical to {@link #notifyListeners()} but
 * cannot share code because the listener(s) cannot be cached for an instance of {@link DefaultPromise} since the
 * listener(s) may be changed and is protected by a synchronized operation.
 */
private static void notifyListenerWithStackOverFlowProtection(final EventExecutor executor,
                               final Future<?> future,
                               final GenericFutureListener<?> listener) {
  if (executor.inEventLoop()) {
    final InternalThreadLocalMap threadLocals = InternalThreadLocalMap.get();
    final int stackDepth = threadLocals.futureListenerStackDepth();
    if (stackDepth < MAX_LISTENER_STACK_DEPTH) {
      threadLocals.setFutureListenerStackDepth(stackDepth + 1);
      try {
        notifyListener0(future, listener);
      } finally {
        threadLocals.setFutureListenerStackDepth(stackDepth);
      }
      return;
    }
  }
  safeExecute(executor, new Runnable() {
    @Override
    public void run() {
      notifyListener0(future, listener);
    }
  });
}
origin: org.jboss.eap/wildfly-client-all

/**
 * The logic in this method should be identical to {@link #notifyListeners()} but
 * cannot share code because the listener(s) cannot be cached for an instance of {@link DefaultPromise} since the
 * listener(s) may be changed and is protected by a synchronized operation.
 */
private static void notifyListenerWithStackOverFlowProtection(final EventExecutor executor,
                               final Future<?> future,
                               final GenericFutureListener<?> listener) {
  if (executor.inEventLoop()) {
    final InternalThreadLocalMap threadLocals = InternalThreadLocalMap.get();
    final int stackDepth = threadLocals.futureListenerStackDepth();
    if (stackDepth < MAX_LISTENER_STACK_DEPTH) {
      threadLocals.setFutureListenerStackDepth(stackDepth + 1);
      try {
        notifyListener0(future, listener);
      } finally {
        threadLocals.setFutureListenerStackDepth(stackDepth);
      }
      return;
    }
  }
  safeExecute(executor, new Runnable() {
    @Override
    public void run() {
      notifyListener0(future, listener);
    }
  });
}
origin: org.apache.activemq/artemis-jms-client-all

/**
 * The logic in this method should be identical to {@link #notifyListeners()} but
 * cannot share code because the listener(s) cannot be cached for an instance of {@link DefaultPromise} since the
 * listener(s) may be changed and is protected by a synchronized operation.
 */
private static void notifyListenerWithStackOverFlowProtection(final EventExecutor executor,
                               final Future<?> future,
                               final GenericFutureListener<?> listener) {
  if (executor.inEventLoop()) {
    final InternalThreadLocalMap threadLocals = InternalThreadLocalMap.get();
    final int stackDepth = threadLocals.futureListenerStackDepth();
    if (stackDepth < MAX_LISTENER_STACK_DEPTH) {
      threadLocals.setFutureListenerStackDepth(stackDepth + 1);
      try {
        notifyListener0(future, listener);
      } finally {
        threadLocals.setFutureListenerStackDepth(stackDepth);
      }
      return;
    }
  }
  safeExecute(executor, new Runnable() {
    @Override
    public void run() {
      notifyListener0(future, listener);
    }
  });
}
io.netty.util.concurrentDefaultPromisenotifyListener0

Popular methods of DefaultPromise

  • <init>
    Creates a new instance. It is preferable to use EventExecutor#newPromise() to create a new promise
  • setSuccess
  • setFailure
  • addListener
  • await
  • addListeners
  • awaitUninterruptibly
  • checkDeadLock
  • removeListener
  • removeListeners
  • sync
  • syncUninterruptibly
  • sync,
  • syncUninterruptibly,
  • tryFailure,
  • cause,
  • isDone,
  • trySuccess,
  • executor,
  • addListener0,
  • await0,
  • checkNotifyWaiters

Popular in Java

  • Updating database using SQL prepared statement
  • putExtra (Intent)
  • notifyDataSetChanged (ArrayAdapter)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Set (java.util)
    A collection that contains no duplicate elements. More formally, sets contain no pair of elements e1
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now