docs: private void processMaxMessageSize(long payLoadSize) throws MaxMessageException {
          AnnotatedEndpoint ae = null;
          Long maxMessageSize = Constants.DEFAULT_MAX_MSG_SIZE;
  
          if (!(connLink.getEndpoint() instanceof AnnotatedEndpoint)) {
              if (firstFrameOpcodeType == OpcodeType.BINARY_WHOLE || firstFrameOpcodeType == OpcodeType.BINARY_PARTIAL_FIRST
                  || firstFrameOpcodeType == OpcodeType.BINARY_PARTIAL_CONTINUATION || firstFrameOpcodeType == OpcodeType.BINARY_PARTIAL_LAST) {
                  maxMessageSize = (long) connLink.getMaxBinaryMessageBufferSize();
              } else if (firstFrameOpcodeType == OpcodeType.TEXT_WHOLE || firstFrameOpcodeType == OpcodeType.TEXT_PARTIAL_FIRST
                         || firstFrameOpcodeType == OpcodeType.TEXT_PARTIAL_CONTINUATION || firstFrameOpcodeType == OpcodeType.TEXT_PARTIAL_LAST) {
                  maxMessageSize = (long) connLink.getMaxTextMessageBufferSize();
              }
  
              if (tc.isDebugEnabled()) {
                  Tr.debug(tc, "processMaxMessageSize: Not AE. payLoadSize passed in: " + payLoadSize + " maxMessageSize: " + maxMessageSize);
              }
  
              // TODO: will have to use English message for now, needs to be translated in the next release
              if ((maxMessageSize != -1) && (payLoadSize > maxMessageSize)) {
                  // String reasonPhrase = Tr.formatMessage(tc, "invalid.message.toobig", "MessageHandler", payLoadSize, maxMessageSize, "onMessage");
                  // also, this message needs be less than 123, the max for a control frame.
                  String reasonPhrase = "Invalid incoming WebSocket message. Message is too big. Message size: " +
                                        payLoadSize + " but max message size for this Session is: " + maxMessageSize;
                  throw new MaxMessageException(reasonPhrase);
              }
              return;
          } else {
              ae = (AnnotatedEndpoint) connLink.getEndpoint();
  
          }
  
          MethodData methodData = null;
          EndpointMethodHelper epMethodHelper = null;
          if (firstFrameOpcodeType == OpcodeType.BINARY_WHOLE) {
              epMethodHelper = ae.getOnMessageBinaryMethod();
          } else if (firstFrameOpcodeType == OpcodeType.TEXT_WHOLE) {
              epMethodHelper = ae.getOnMessageTextMethod();
          }
          if (epMethodHelper != null) {
              methodData = epMethodHelper.getMethodData();
          } else {
              return;
          }
  
          //get user defined maxMessageSize in @OnMessage annotation if there is one
          maxMessageSize = methodData.getMaxMessageSize();
          if (maxMessageSize == Constants.ANNOTATED_UNDEFINED_MAX_MSG_SIZE) {
              // if user did not define a max size with an annotation, get the size from the session
              if (firstFrameOpcodeType == OpcodeType.BINARY_WHOLE || firstFrameOpcodeType == OpcodeType.BINARY_PARTIAL_FIRST
                  || firstFrameOpcodeType == OpcodeType.BINARY_PARTIAL_CONTINUATION || firstFrameOpcodeType == OpcodeType.BINARY_PARTIAL_LAST) {
                  maxMessageSize = (long) connLink.getMaxBinaryMessageBufferSize();
              } else if (firstFrameOpcodeType == OpcodeType.TEXT_WHOLE || firstFrameOpcodeType == OpcodeType.TEXT_PARTIAL_FIRST
                         || firstFrameOpcodeType == OpcodeType.TEXT_PARTIAL_CONTINUATION || firstFrameOpcodeType == OpcodeType.TEXT_PARTIAL_LAST) {
                  maxMessageSize = (long) connLink.getMaxTextMessageBufferSize();
              }
          }
  
          if (tc.isDebugEnabled()) {
              Tr.debug(tc, "processMaxMessageSize: Is AE. payLoadSize passed in: " + payLoadSize + " maxMessageSize: " + maxMessageSize);
          }
          Class<?> inputType = methodData.getMessageType();
  
          //if message is in parts, don't check for maxMessageSize, per API doc
          if (inputType.equals(String.class) || inputType.equals(ByteBuffer.class) || inputType.equals(byte[].class)) { //if message is return in parts, don't check for maxMessageSize
              int booleanIndex = methodData.getMsgBooleanPairIndex();
              if (booleanIndex >= 0) {
                  return;
              }
          } else if (inputType.equals(Reader.class)) { //if message is Reader type, don't check for maxMessageSize, per API doc
              return;
          } else if (inputType.equals(InputStream.class)) { //if message is InputStream type, don't check for maxMessageSize, per API doc
              return;
          }
          //if payload size is greater than maxMessageSize, throw MaxMessageException which calls onClose() method of ServerEndpoint config
          if ((maxMessageSize != -1) && (payLoadSize > maxMessageSize)) {
              if (firstFrameOpcodeType == OpcodeType.BINARY_WHOLE) {
                  epMethodHelper = ae.getOnMessageBinaryMethod();
              } else if (firstFrameOpcodeType == OpcodeType.TEXT_WHOLE) {
                  epMethodHelper = ae.getOnMessageTextMethod();
              }
              String reasonPhrase = Tr.formatMessage(tc,
                                                     "invalid.message.toobig",
                                                     epMethodHelper.getMethod().getDeclaringClass().getName(), payLoadSize, maxMessageSize,
                                                     epMethodHelper.getMethod().getName());
  
              throw new MaxMessageException(reasonPhrase);
          } else {
              return;
          }
      }