Do not call if in {@link Mode#safe}.

@param aMessage
@param onlyIfInScope
@return False if message should be dropped.
338710
public boolean handleMessageReceivedFromServer(Message aMessage, boolean onlyIfInScope) {
        if (! isBreakpoint(aMessage, false, onlyIfInScope)) {
            return true;
        }
        
        // Do this outside of the semaphore loop so that the 'continue' button can apply to all queued break points
        // but be reset when the next break point is hit
        breakPanel.breakpointHit();

        synchronized(semaphore) {
            //breakPanel.breakpointHit();
            if (breakPanel.isHoldMessage()) {
                setBreakDisplay(aMessage, false);
                waitUntilContinue(false);
            }
        }
        breakPanel.clearAndDisableResponse();

        return ! breakPanel.isToBeDropped();
    }
948602
public IStatus validatePluginTransferDrop(
			IStructuredSelection aDragSelection, Object aDropTarget) {
		if (!(aDropTarget instanceof IResource)) {
			return WorkbenchNavigatorPlugin
					.createStatus(
							IStatus.INFO,
							0,
							WorkbenchNavigatorMessages.DropAdapter_targetMustBeResource,
							null);
		}
		IResource resource = (IResource) aDropTarget;
		if (!resource.isAccessible()) {
			return WorkbenchNavigatorPlugin
					.createErrorStatus(
							0,
							WorkbenchNavigatorMessages.DropAdapter_canNotDropIntoClosedProject,
							null);
		}
		IContainer destination = getActualTarget(resource);
		if (destination.getType() == IResource.ROOT) {
			return WorkbenchNavigatorPlugin
					.createErrorStatus(
							0,
							WorkbenchNavigatorMessages.DropAdapter_resourcesCanNotBeSiblings,
							null);
		}

		IResource[] selectedResources = getSelectedResources(aDragSelection);

		String message = null;
		if (selectedResources.length == 0) {
			message = WorkbenchNavigatorMessages.DropAdapter_dropOperationErrorOther;
		} else {
			MoveFilesAndFoldersOperation operation;

			operation = new MoveFilesAndFoldersOperation(getShell());
			message = operation.validateDestination(destination,
					selectedResources);
		}
		if (message != null) {
			return WorkbenchNavigatorPlugin.createErrorStatus(0, message, null);
		}
		return Status.OK_STATUS;
	}
1315819
@Override
    public boolean requeueSilent(IQueueMessage<ID, DATA> _msg) throws QueueException.QueueIsFull {
        IQueueMessage<ID, DATA> msg = _msg.clone();
        putToQueue(msg);
        if (!isEphemeralDisabled()) {
            ephemeralStorage.remove(msg.getId());
        }
        return true;
    }
683125
public void error(final Throwable aThrowable, final String aMessage, final Object... aVarargs) {
        if (isErrorEnabled()) {
            final MDCCloseable closeable = setLineNumber();

            if (hasI18nKey(aMessage)) {
                if (aThrowable != null) {
                    myLogger.error(getI18n(aMessage, aVarargs), aThrowable);
                } else {
                    myLogger.error(getI18n(aMessage, aVarargs));
                }
            } else {
                if (aThrowable != null) {
                    if (aVarargs.length == 0) {
                        myLogger.error(aMessage, aThrowable);
                    } else {
                        myLogger.error(StringUtils.format(aMessage, aVarargs), aThrowable);
                    }
                } else {
                    if (aVarargs.length == 0) {
                        myLogger.error(aMessage);
                    } else {
                        myLogger.error(aMessage, aVarargs);
                    }
                }
            }

            clearLineNumber(closeable);
        }
    }
1350587
@Override
	public boolean sendMessageToClient(MessageFromClient message, Session client) {
		MessageToClient mtc = messageToClientService.createMessageToClient(message, client);
		if (mtc != null) {
			client.getAsyncRemote().sendObject(mtc);
			return true;
		}
		return false;
	}
1023339
public final StringSubject hasMessageThat() {
    StandardSubjectBuilder check = check("getMessage()");
    if (actual() instanceof ErrorWithFacts && ((ErrorWithFacts) actual()).facts().size() > 1) {
      check =
          check.withMessage(
              "(Note from Truth: When possible, instead of asserting on the full message, assert"
                  + " about individual facts by using ExpectFailure.assertThat.)");
    }
    return check.that(actual().getMessage());
  }
24823
@Override
    public void setAutoStopSequentialMessageFailure(final String autoStopSequentialMessageFailure)
    {
        _autoStopSequentialMessageFailure = (autoStopSequentialMessageFailure == null ? null : Integer.valueOf(autoStopSequentialMessageFailure));
    }
944978
boolean removeLocalScope(TransactionScope<Txn> scope) {
        TransactionScope<Txn> existing = mLocalScope.get();
        if (existing == scope) {
            detachNotification(scope.getActiveTxn());
            mLocalScope.remove();
            return true;
        }
        return false;
    }
1197239
public boolean displayMessage (ChatMessage message, boolean alreadyDisplayed)
    {
        // nothing doing if we've not been laid out
        if (!isLaidOut()) {
            return false;
        }

        // possibly display it now
        Graphics2D gfx = getTargetGraphics();
        if (gfx != null) {
            displayMessage(message, gfx); // display it
            gfx.dispose(); // clean up
            return true;
        }
        return false;
    }
904699
void send(AbstractMessage aMessage, int priority)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "send", new Object[] {this,
                                            aMessage,
                                            new Integer(priority),
                                            "verboseMsg OUT : " + aMessage.toVerboseString()});
    if(TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
      MPIOMsgDebug.debug(tc, aMessage, priority);
    
    // comms accepting messages, write the message
    // immediately.
    try
    {
      //send the encoded message
      connection.send(aMessage, priority);          

      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
        SibTr.debug(tc, "send", "Message accepted by Comms");
    } 
    catch (SIConnectionDroppedException e)
    {
      // No FFDC code needed
      
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
        SibTr.debug(tc, "send", "Message refused by Comms: Connection Dropped");
      
      // Pass this exception up to our parent.  Note that we'll assume
      // we're still alive, and let our parent (in coordination with TRM
      // decide whether or not to nuke us).
      mpio.error(connection, e);
    }       
    catch (SIConnectionUnavailableException e)
    {
      // No FFDC code needed
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
        SibTr.debug(tc, "send", "Message refused by Comms: Connection Unavailable");
      
      // Pass this exception up to our parent.  Note that we'll assume
      // we're still alive, and let our parent (in coordination with TRM
      // decide whether or not to nuke us).
      mpio.error(connection, e);
    } 
    catch (SIConnectionLostException e)
    {
      // No FFDC code needed
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
        SibTr.debug(tc, "send", "Message refused by Comms: Connection Lost");
      
      // Pass this exception up to our parent.  Note that we'll assume
      // we're still alive, and let our parent (in coordination with TRM
      // decide whether or not to nuke us).
      mpio.error(connection, e);
    }
    catch(MessageEncodeFailedException e)
    {
      // No FFDC code needed
      //this should never happen, but comms declare the exception, so
      //we have to deal with it
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
        SibTr.debug(tc, "send", "Message refused by Comms: Msg Encode Failed");
      
      // Pass this exception up to our parent.  Note that we'll assume
      // we're still alive, and let our parent (in coordination with TRM
      // decide whether or not to nuke us).
      mpio.error(connection, e);
    }
    catch(MessageCopyFailedException e)
    {
      // No FFDC code needed
      //this should never happen, but comms declare the exception, so
      //we have to deal with it
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
        SibTr.debug(tc, "send", "Message refused by Comms: Msg Copy Failed");
      
      // Pass this exception up to our parent.  Note that we'll assume
      // we're still alive, and let our parent (in coordination with TRM
      // decide whether or not to nuke us).
      mpio.error(connection, e);
    }
    catch(UnsupportedEncodingException e)
    {
      // No FFDC code needed
      //this should never happen, but comms declare the exception, so
      //we have to deal with it
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
        SibTr.debug(tc, "send", "Message refused by Comms: Msg Encoding Failed");
      
      // Pass this exception up to our parent.  Note that we'll assume
      // we're still alive, and let our parent (in coordination with TRM
      // decide whether or not to nuke us).
      mpio.error(connection, e);
    }
    catch(IncorrectMessageTypeException e)
    {
      // No FFDC code needed
      //this should never happen, but comms declare the exception, so
      //we have to deal with it
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
        SibTr.debug(tc, "send", "Message refused by Comms: Incorrect Message Type");
      
      // Pass this exception up to our parent.  Note that we'll assume
      // we're still alive, and let our parent (in coordination with TRM
      // decide whether or not to nuke us).
      mpio.error(connection, e);
    }
      
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "send");
  }
124947
private static NlsMessage getMessage(IoMode mode) {

    NlsBundleUtilIoRoot bundle = createBundle(NlsBundleUtilIoRoot.class);
    switch (mode) {
      case READ:
        return bundle.errorIoRead();
      case WRITE:
        return bundle.errorIoWrite();
      case CLOSE:
        return bundle.errorIoClose();
      case FLUSH:
        return bundle.errorIoFlush();
      case COPY:
        return bundle.errorIoCopy();
      default:
        assert (false) : "IoMode is null!";
        return bundle.errorIo();
    }
  }
941985
public static void safeRelease(Object msg) {
		if (msg instanceof ReferenceCounted) {
			ReferenceCounted referenceCounted = (ReferenceCounted) msg;
			if (referenceCounted.refCnt() > 0) {
				referenceCounted.release();
			}
		}
	}
263559
public boolean isSendRemoteMessage(BaseMessage message)
    {
        Iterator<BaseMessageFilter> iterator = this.getMessageFilterList().getFilterList(null);    // ALL The filters (not just matches).
        while (iterator.hasNext())
        {
            BaseMessageFilter filter = iterator.next();
            if (!filter.isRemoteFilter())   // Always send down when filter is a remote copy
                if (filter.isSendRemoteMessage(message) == false)
                    return false;      // Don't send this message down
        }
        return true;
    }
174529
public boolean isMessagingEngine () {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "isMessagingEngine");

    boolean rc = (this instanceof MessagingEngine);

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "isMessagingEngine", Boolean.valueOf(rc));
    return rc;
  }
1138961
private boolean takeMessage(SIMPMessage msg, boolean isOnItemStream)
                    throws SIResourceException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "takeMessage", new Object[] { this, msg, Boolean.valueOf(isOnItemStream) });

        boolean msgTaken = false;

        // Put should only have been called if we said we were Ready but
        // we'll double check we are still Ready as there is a window where
        // we could have stopped/closed/ended the receive after the CD
        // had picked us from the ready list.
        if ((_ready && (_keyGroup == null)) || (_keyGroup != null) && (_keyGroup.isGroupReady()))
        {
            //Consumer is still ready so it can take the message
            //indicate that we're not Ready for any more messages
            //setReadyState(false);
            _ready = false;

            if (_keyGroup != null)
                _keyGroup.groupNotReady();

            // Before we can take the message we need to know that this consumer or its
            // ConsumerSet will allow it (they haven't reached their maxActiveMessage limits).
            // If they will accept it we have to, in the case of a ConsumerSet, 'reserve' the
            // space upfront because multiple members of the set could be concurrently adding
            // active messages. If this add happens to take the last available slot in the set's
            // quota it will keep the set write-locked for the duration of the message lookup. During
            // this time no other consumers in the set will be able to add any more messages.
            // This is done to ensure that the set's suspend/resume state is consistent and we don't
            // have to try to un-suspend consumers when we find there isn't a message to take after all.
            boolean msgAccepted = prepareAddActiveMessage();
            if (!msgAccepted)
            {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    SibTr.debug(tc, "The consumer set is already suspended ");
            }
            else
            {
                boolean activeMessageAttached = false;
                // Whatever the outcome we must commit or rollback the prepareAddActiveMessage()
                try
                {
                    //we HAVE taken this message
                    msgTaken = true;

                    //attach the message we have taken
                    try
                    {
                        activeMessageAttached = attachAndLockMsg(msg, isOnItemStream);
                    } catch (SIResourceException e)
                    {
                        // No FFDC code needed
                        SibTr.exception(tc, e);

                        activeMessageAttached = false;
                        checkWaiting();

                        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                            SibTr.exit(tc, "takeMessage", e);

                        throw e;
                    }

                    // We found an attached message, therefore we have another active
                    // message so commit the prepare we did above.
                    if (activeMessageAttached)
                        commitAddActiveMessage();

                    checkWaiting();
                } finally
                {
                    // If a message wasn't attached the commit won't have happened, instead
                    // roll back the prepare of the add, as if the prepare never happened.
                    if (!activeMessageAttached)
                        rollbackAddActiveMessage();
                }
            }
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "takeMessage", Boolean.valueOf(msgTaken));

        return msgTaken;
    }
573316
public boolean removeMessageListener(String topic, IKafkaMessageListener msgListener) {
        synchronized (topicMsgListeners) {
            if (topicMsgListeners.remove(topic, msgListener)) {
                if (topicMsgListeners.get(topic).isEmpty()) {
                    // no more listener, stop worker
                    KafkaMsgConsumerWorker worker = topicWorkers.remove(topic);
                    if (worker != null) {
                        worker.stopWorker();
                    }
                }
                return true;
            }
        }
        return false;
    }
82609
public void error(final Throwable aThrowable, final String aMessage) {
        if (isErrorEnabled()) {
            final MDCCloseable closeable = setLineNumber();

            if (hasI18nKey(aMessage)) {
                if (aThrowable != null) {
                    myLogger.error(getI18n(aMessage), aThrowable);
                } else {
                    myLogger.error(getI18n(aMessage));
                }
            } else {
                if (aThrowable != null) {
                    myLogger.error(aMessage, aThrowable);
                } else {
                    myLogger.error(aMessage);
                }
            }

            clearLineNumber(closeable);
        }
    }