Notify all {@link StateListener}s about a {@link State} change

@param node The node whose state changed
@param oldState The old state
@param newState The new state
484809
private void fireStateChanged(Object node, State oldState, State newState)
    {
        for (StateListener stateListener : stateListeners)
        {
            stateListener.stateChanged(node, oldState, newState);
        }
    }
1348917
public void setState(State state, boolean fireEvent) {

        boolean changed = m_state != state;
        m_state = state;
        if (changed) {
            updateStyle();
        }
        if (fireEvent) {
            ValueChangeEvent.fire(this, state);
        }
    }
573626
synchronized void stateChanged(Date date, ChannelState state)
    {
        final ChannelStateHistoryEntry historyEntry;
        final ChannelState oldState = this.state;

        if (oldState == state)
        {
            return;
        }

        // System.err.println(id + " state change: " + oldState + " => " + state
        // + " (" + name + ")");
        historyEntry = new ChannelStateHistoryEntry(date, state);
        synchronized (stateHistory)
        {
            stateHistory.add(historyEntry);
        }

        this.state = state;
        firePropertyChange(PROPERTY_STATE, oldState, state);
    }
329031
void notifyListener() {
        Node<K, V> node;
        while ((node = pendingNotifications.poll()) != null) {
            listener.onEviction(node.key, node.getValue());
        }
    }
1128474
void gotoState(@Nonnull ConnectivityState newState) {
    checkNotNull(newState, "newState");
    if (state != newState && state != ConnectivityState.SHUTDOWN) {
      state = newState;
      if (listeners.isEmpty()) {
        return;
      }
      // Swap out callback list before calling them, because a callback may register new callbacks,
      // if run in direct executor, can cause ConcurrentModificationException.
      ArrayList<Listener> savedListeners = listeners;
      listeners = new ArrayList<>();
      for (Listener listener : savedListeners) {
        listener.runInExecutor();
      }
    }
  }
84328
def notify_state(node, state, latency = nil)
      @lock.synchronize do
        if running?
          update_current_state(node, state, latency)
        end
      end
    rescue => ex
      logger.error("Error handling state report #{[node, state].inspect}: #{ex.inspect}")
      logger.error(ex.backtrace.join("\n"))
    end
975191
private void delegateChanged(Observable<T> oldDelegate, Observable<T> newDelegate)
	{
		removeObservableListeners(oldDelegate);
		
		addObservableListeners(newDelegate);

		support.fireValueChanged(oldDelegate.getValue(), newDelegate.getValue());
	}
204248
public boolean removeNode(RiakNode node)
    {
        stateCheck(State.CREATED, State.RUNNING, State.QUEUING);
        boolean removed = false;
        try
        {
            nodeListLock.writeLock().lock();
            removed = nodeList.remove(node);
            for (NodeStateListener listener : stateListeners)
            {
                node.removeStateListener(listener);
            }
        }
        finally
        {
            nodeListLock.writeLock().unlock();
        }
        nodeManager.removeNode(node);
        return removed;
    }
21069
public static void fireOnDeleted(@Nonnull Node node) {
        for (NodeListener nl: all()) {
            try {
                nl.onDeleted(node);
            } catch (Throwable ex) {
                LOGGER.log(Level.WARNING, "Listener invocation failed", ex);
            }
        }
    }
196399
@Override
  @SuppressWarnings("unchecked")
  public void stateChanged(AppSession source, Enum oldState, Enum newState) {
    logger.info("Diameter Rf SessionFactory :: stateChanged :: source[{}], oldState[{}], newState[{}]", new Object[] { source, oldState, newState });
  }
1332904
private void doNotifyListeners(R oldValue, R newValue) {
        List<ValueChangeListener<R>> listenersCopy = new ArrayList<ValueChangeListener<R>>(listeners);
        notifyingListeners = true;
        for (ValueChangeListener<R> listener : listenersCopy) {
            listener.valueChanged(this, oldValue, newValue);
        }
        notifyingListeners = false;
    }
595393
protected final void setStateNotify(final int newState)
	{
		synchronized (lock) {
			setState(newState);
			if (newState == OK && !inBlockingSend)
				this.sendWaitQueue.release(false);
			// worst case: we notify 2 threads, the closing one and 1 sending
			lock.notifyAll();
		}
	}
919756
public final void internalSetNodeState (@Nonnull final EHCNodeState eNodeState)
  {
    if (DEBUG_NODE_STATE)
    {
      ValueEnforcer.notNull (eNodeState, "NodeState");
      if (m_eNodeState.isAfter (eNodeState))
        HCConsistencyChecker.consistencyError ("The new node state is invalid. Got " +
                                               eNodeState +
                                               " but having " +
                                               m_eNodeState);
    }
    m_eNodeState = eNodeState;
  }
306258
public void setState(TransferState state) {
        synchronized (this) {
            this.state = state;
        }
        for ( TransferStateChangeListener listener : stateChangeListeners ) {
            listener.transferStateChanged(this, state);
        }
    }
1110424
public void removeNodeStateListener(NodeStateListener listener)
    {
        stateCheck(State.CREATED, State.RUNNING, State.SHUTTING_DOWN, State.QUEUING);
        try
        {
            stateListeners.remove(listener);
            nodeListLock.readLock().lock();
            for (RiakNode node : nodeList)
            {
                node.removeStateListener(listener);
            }
        }
        finally
        {
            nodeListLock.readLock().unlock();
        }
    }
512351
protected void setState(int newState) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "setState", newState);

        synchronized (stateLock) {
            if ((newState == JmsInternalConstants.CLOSED)
                || (newState == JmsInternalConstants.STOPPED)
                || (newState == JmsInternalConstants.STARTED)) {
                state = newState;
                stateLock.notifyAll();
            }
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "setState");
    }
1146735
void afterRead(Node<K, V> node) {
        final int bufferIndex = readBufferIndex();
        final long writeCount = recordRead(bufferIndex, node);
        drainOnReadIfNeeded(bufferIndex, writeCount);
        notifyListener();
    }