Helper method to check if message is initialized.

@throws InvalidProtocolBufferException if it is not initialized.
@return The message to check.
974998
private MessageType checkMessageInitialized(MessageType message)
      throws InvalidProtocolBufferException {
    if (message != null && !message.isInitialized()) {
      throw newUninitializedMessageException(message)
          .asInvalidProtocolBufferException()
          .setUnfinishedMessage(message);
    }
    return message;
  }
1370366
public boolean getClearDigitBuffer() {
        String value = Optional.fromNullable(getParameter(SignalParameters.CLEAR_DIGIT_BUFFER.symbol())).or("false");
        return Boolean.parseBoolean(value);
    }
1311037
private function initBufferFromNextChunk()
    {
        if ($this->chunkOffset === $this->numChunks - 1) {
            return false;
        }

        $this->bufferOffset = 0;
        $this->chunkOffset++;
        $this->chunksIterator->next();

        return $this->initBufferFromCurrentChunk();
    }
622284
private void checkStarted() throws SINotPossibleInCurrentConfigurationException 
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "checkStarted");

    synchronized (this)
    {
      if (!isStarted())
      {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
          SibTr.exit(tc, "checkStarted", "ME not started");

        throw new SINotPossibleInCurrentConfigurationException(
          nls.getFormattedMessage("MESSAGE_PROCESSOR_NOT_STARTED_ERROR_CWSIP0211", 
          new Object[] { messageProcessor.getMessagingEngineName(), messageProcessor.getMessagingEngineBus()}, 
          null));
      }
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "checkStarted");
  }
1307119
private boolean okayToSendMessage(IRTMPEvent message) {
        if (message instanceof IStreamData) {
            final long now = System.currentTimeMillis();
            // check client buffer size
            if (isClientBufferFull(now)) {
                return false;
            }
            // get pending message count
            long pending = pendingMessages();
            if (bufferCheckInterval > 0 && now >= nextCheckBufferUnderrun) {
                if (pending > underrunTrigger) {
                    // client is playing behind speed, notify him
                    sendInsufficientBandwidthStatus(currentItem.get());
                }
                nextCheckBufferUnderrun = now + bufferCheckInterval;
            }
            // check for under run
            if (pending > underrunTrigger) {
                // too many messages already queued on the connection
                return false;
            }
            return true;
        } else {
            String itemName = "Undefined";
            // if current item exists get the name to help debug this issue
            if (currentItem.get() != null) {
                itemName = currentItem.get().getName();
            }
            Object[] errorItems = new Object[] { message.getClass(), message.getDataType(), itemName };
            throw new RuntimeException(String.format("Expected IStreamData but got %s (type %s) for %s", errorItems));
        }
    }
777874
private static Method getInitializeMethod(Class< ? > cl) {
        Method method = null;
        
        try {
            method = cl.getDeclaredMethod(IS_INITIALIZED, new Class[]{Object.class});
        } catch (NoSuchMethodException e) {
			//in this case 'isInitialized' method can't be null
        } 
        return method;		
    }
727141
@Override
    public Boolean isReady() {
        try {
            validateInitialization();
            validateActivation();
            validateMiddleware();
            return true;
        } catch (InvalidStateException e) {
            return false;
        }
    }
685871
@Override
    public String getLocalizedMessage() {

        if (m_exceptions.isEmpty()) {
            return null;
        }
        StringBuffer result = new StringBuffer(128);
        Iterator<CmsException> it = m_exceptions.iterator();
        while (it.hasNext()) {
            CmsException ex = it.next();
            result.append(ex.getLocalizedMessage());
            if (it.hasNext()) {
                result.append('\n');
            }
        }
        return result.toString();
    }
1194830
public CmsMessageContainer validateWithMessage() {

        if (m_parsingFailed) {
            return Messages.get().container(Messages.ERR_SERIALDATE_INVALID_VALUE_0);
        }
        if (!isStartSet()) {
            return Messages.get().container(Messages.ERR_SERIALDATE_START_MISSING_0);
        }
        if (!isEndValid()) {
            return Messages.get().container(Messages.ERR_SERIALDATE_END_BEFORE_START_0);
        }
        String key = validatePattern();
        if (null != key) {
            return Messages.get().container(key);
        }
        key = validateDuration();
        if (null != key) {
            return Messages.get().container(key);
        }
        if (hasTooManyEvents()) {
            return Messages.get().container(
                Messages.ERR_SERIALDATE_TOO_MANY_EVENTS_1,
                Integer.valueOf(CmsSerialDateUtil.getMaxEvents()));
        }
        return null;
    }
46496
public static boolean isInitialized()
    {
        final Cache<Long, Type> cache1 = InfinispanCache.get().<Long, Type>getCache(Type.IDCACHE);
        final Cache<String, Type> cache2 = InfinispanCache.get().<String, Type>getCache(Type.NAMECACHE);
        final Cache<UUID, Type> cache3 = InfinispanCache.get().<UUID, Type>getCache(Type.UUIDCACHE);
        return !cache1.isEmpty() || !cache2.isEmpty() || !cache3.isEmpty();
    }
1296418
@Override
	protected void unserializeFrom(RawDataBuffer in)
    {
        super.unserializeFrom(in);
        message = MessageSerializer.unserializeFrom(in, true);
    }
11557
@SuppressWarnings("unchecked")
  private P byteBufferToPage(ByteBuffer buffer) {
    try (InputStream bais = new ByteBufferInputStream(buffer);
        ObjectInputStream ois = new ObjectInputStream(bais)) {
      int type = ois.readInt();
      if (type == EMPTY_PAGE) {
        return null;
      } else if (type == FILLED_PAGE) {
        return (P) ois.readObject();
      } else {
        throw new IllegalArgumentException("Unknown type: " + type);
      }
    } catch (IOException|ClassNotFoundException e) {
      LoggingUtil.exception(e);
      return null;
    }
  }
563971
protected void initMessageObject() {

        Object o = null;

        try {
            // this is not the initial call, get the message info object from session
            o = getDialogObject();
            m_msgInfo = (CmsMessageInfo)o;
            // test
            m_msgInfo.getTo();
        } catch (Exception e) {
            // create a new message info object
            m_msgInfo = new CmsMessageInfo();
        }
        m_msgInfo.setFrom(getCms().getRequestContext().getCurrentUser().getFullName());
        m_msgInfo.setTo(getToNames());
    }
923021
public void initialRead() {
        try {
            this.buffer = this.isc.getRequestBodyBuffer();
            if (null != this.buffer) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "Buffer returned from getRequestBodyBuffer : " + this.buffer);
                }
                // record the new amount of data read from the channel
                this.bytesRead += this.buffer.remaining();
            }
        } catch (IOException e) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Exception encountered during initialRead : " + e);
            }
        }
    }
745342
public static String getInitialCauseMessage(final Throwable throwable) {
        final Throwable cause = getInitialCause(throwable);
        if (cause.getLocalizedMessage() == null) {
            return cause.getClass().getSimpleName();
        }
        return cause.getLocalizedMessage();
    }
192345
public static boolean isInitialized() {
    final boolean loaded = WebshimResources.rememberEvent != null
        || StringUtils.isEmpty(WebshimResources.POLIFILLER_URL);
    return loaded || WebshimResources.isInHeader();
  }
78604
public static boolean isPropertyInitialized(Object object) {
    	Class < ? > cl =  getHibernateClass();
    	
        if (cl == null) {
            return true;
        }
        
        Method method = getInitializeMethod(cl);
        return checkInitialize(method, object);
    }