This method creates a #ModbusResponse instance from #functionCode

@param functionCode a number representing a modbus function
@return an instance of a specific ModbusRequest
@see ModbusRequest
@see ModbusMessageFactory
@see ModbusResponseFactory
967856
@Override
    public ModbusMessage createMessage(int functionCode) {
        ModbusResponse msg;

        switch (ModbusFunctionCode.get(functionCode)) {
            case READ_COILS:
                msg = new ReadCoilsResponse();
                break;
            case READ_DISCRETE_INPUTS:
                msg = new ReadDiscreteInputsResponse();
                break;
            case READ_HOLDING_REGISTERS:
                msg = new ReadHoldingRegistersResponse();
                break;
            case READ_INPUT_REGISTERS:
                msg = new ReadInputRegistersResponse();
                break;
            case WRITE_SINGLE_COIL:
                msg = new WriteSingleCoilResponse();
                break;
            case WRITE_SINGLE_REGISTER:
                msg = new WriteSingleRegisterResponse();
                break;
            case WRITE_MULTIPLE_COILS:
                msg = new WriteMultipleCoilsResponse();
                break;
            case WRITE_MULTIPLE_REGISTERS:
                msg = new WriteMultipleRegistersResponse();
                break;
            case MASK_WRITE_REGISTER:
                msg = new MaskWriteRegisterResponse();
                break;
            case READ_WRITE_MULTIPLE_REGISTERS:
                msg = new ReadWriteMultipleRegistersResponse();
                break;
            case READ_FIFO_QUEUE:
                msg = new ReadFifoQueueResponse();
                break;
            case READ_FILE_RECORD:
                msg = new ReadFileRecordResponse();
                break;
            case WRITE_FILE_RECORD:
                msg = new WriteFileRecordResponse();
                break;
            case READ_EXCEPTION_STATUS:
                msg = new ReadExceptionStatusResponse();
                break;
            case REPORT_SLAVE_ID:
                msg = new ReportSlaveIdResponse();
                break;
            case GET_COMM_EVENT_COUNTER:
                msg = new GetCommEventCounterResponse();
                break;
            case GET_COMM_EVENT_LOG:
                msg = new GetCommEventLogResponse();
                break;
            case DIAGNOSTICS:
                msg = new DiagnosticsResponse();
                break;
            case ENCAPSULATED_INTERFACE_TRANSPORT:
                msg = new EncapsulatedInterfaceTransportResponse();
                break;
            default:
                msg = new IllegalFunctionResponse(functionCode);
        }
        if (ModbusFunctionCode.isException(functionCode)) {
            msg.setException();
        }
        return msg;
    }
137912
public FaceletTaglibFunctionType<FaceletTaglibType<T>> getOrCreateFunction()
   {
      List<Node> nodeList = childNode.get("function");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new FaceletTaglibFunctionTypeImpl<FaceletTaglibType<T>>(this, "function", childNode, nodeList.get(0));
      }
      return createFunction();
   }
660885
public static HttpResponseStatus valueOf(int code) {
        HttpResponseStatus status = valueOf0(code);
        return status != null ? status : new HttpResponseStatus(code);
    }
658099
Node createThisForFunction(Node functionNode) {
    final Node result = IR.thisNode();
    if (isAddingTypes()) {
      result.setJSType(getTypeOfThisForFunctionNode(functionNode));
    }
    return result;
  }
1058849
private FunctionType createNativeFunctionTypeWithVarArgs(
      JSType returnType, JSType... parameterTypes) {
    return createNativeFunctionType(
        returnType, createParametersWithVarArgs(parameterTypes));
  }
691804
private ModbusResponse getAndCheckResponse() throws ModbusException {
        ModbusResponse res = transaction.getResponse();
        if (res == null) {
            throw new ModbusException("No response");
        }
        return res;
    }
138646
public TrmClientAttachReply createNewTrmClientAttachReply() throws MessageCreateFailedException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createNewTrmClientAttachReply");
    TrmClientAttachReply msg = null;
    try {
      msg = new TrmClientAttachReplyImpl();
    }
    catch (MessageDecodeFailedException e) {
      /* No need to FFDC this as JsMsgObject will already have done so */
      // No FFDC code needed
      throw new MessageCreateFailedException(e);
    }
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createNewTrmClientAttachReply");
    return msg;
  }
608509
private ClientResponseImpl coreCall(Object... paramListIn) {
        VoltTable[] results = null;

        // use local var to avoid warnings about reassigning method argument
        Object[] paramList = paramListIn;

        try {
            if ((m_paramTypes.length > 0) && (m_paramTypes[0] == ParameterSet.class)) {
                assert(m_paramTypes.length == 1);
                paramList = new Object[] { ParameterSet.fromArrayNoCopy(paramListIn) };
            }

            if (paramList.length != m_paramTypes.length) {
                String msg = "PROCEDURE " + m_procedureName + " EXPECTS " + String.valueOf(m_paramTypes.length) +
                    " PARAMS, BUT RECEIVED " + String.valueOf(paramList.length);
                m_statusCode = ClientResponse.GRACEFUL_FAILURE;
                return ProcedureRunner.getErrorResponse(m_statusCode, m_appStatusCode, m_appStatusString, msg, null);
            }

            for (int i = 0; i < m_paramTypes.length; i++) {
                try {
                    paramList[i] = ParameterConverter.tryToMakeCompatible(m_paramTypes[i], paramList[i]);
                    // check the result type in an assert
                    assert(ParameterConverter.verifyParameterConversion(paramList[i], m_paramTypes[i]));
                } catch (Exception e) {
                    String msg = "PROCEDURE " + m_procedureName + " TYPE ERROR FOR PARAMETER " + i +
                            ": " + e.toString();
                    m_statusCode = ClientResponse.GRACEFUL_FAILURE;
                    return ProcedureRunner.getErrorResponse(m_statusCode, m_appStatusCode, m_appStatusString, msg, null);
                }
            }

            try {
                m_procedure.m_runner = this;
                Object rawResult = m_procMethod.invoke(m_procedure, paramList);

                if (rawResult instanceof CompletableFuture<?>) {
                    final CompletableFuture<?> fut = (CompletableFuture<?>) rawResult;

                    fut.thenRun(() -> {
                        //
                        // Happy path. No exceptions thrown. Procedure work is complete.
                        //
                        Object innerRawResult = null;
                        ClientResponseImpl response = null;
                        try {
                            innerRawResult = fut.get();
                        } catch (InterruptedException | ExecutionException e) {
                            assert(false);
                            // this is a bad place to be, but it's hard to know if it's crash bad...
                            innerRawResult = new ClientResponseImpl(ClientResponseImpl.UNEXPECTED_FAILURE,
                                    new VoltTable[0],
                                    "Future returned from NTProc " + m_procedureName + " failed to complete.",
                                    m_clientHandle);
                        }

                        if (innerRawResult instanceof ClientResponseImpl) {
                            response = (ClientResponseImpl) innerRawResult;
                        }
                        else {
                            try {
                                VoltTable[] r = ParameterConverter.getResultsFromRawResults(m_procedureName, innerRawResult);
                                response = responseFromTableArray(r);
                            } catch (Exception e) {
                                // this is a bad place to be, but it's hard to know if it's crash bad...
                                response = new ClientResponseImpl(ClientResponseImpl.GRACEFUL_FAILURE,
                                        new VoltTable[0],
                                        "Type " + innerRawResult.getClass().getName() +
                                            " returned from NTProc \"" + m_procedureName +
                                            "\" was not an acceptible VoltDB return type.",
                                        m_clientHandle);
                            }
                        }

                        completeCall(response);
                    })
                    .exceptionally(e -> {
                        //
                        // Exception path. Some bit of async work threw something.
                        //
                        SerializableException se = null;
                        if (e instanceof SerializableException) {
                            se = (SerializableException) e;
                        }

                        String msg = "PROCEDURE " + m_procedureName + " THREW EXCEPTION: ";
                        if (se != null) {
                            msg += se.getMessage();
                        } else {
                            msg += e.toString();
                        }
                        m_statusCode = ClientResponse.GRACEFUL_FAILURE;
                        completeCall(ProcedureRunner.getErrorResponse(m_statusCode, m_appStatusCode, m_appStatusString, msg, se));
                        return null;
                    });

                    return null;
                }
                results = ParameterConverter.getResultsFromRawResults(m_procedureName, rawResult);
            }
            catch (IllegalAccessException e) {
                // If reflection fails, invoke the same error handling that other exceptions do
                throw new InvocationTargetException(e);
            }
        }
        catch (InvocationTargetException itex) {
            //itex.printStackTrace();
            Throwable ex = itex.getCause();
            if (CoreUtils.isStoredProcThrowableFatalToServer(ex)) {
                // If the stored procedure attempted to do something other than linklibrary or instantiate
                // a missing object that results in an error, throw the error and let the server deal with
                // the condition as best as it can (usually a crashLocalVoltDB).
                throw (Error)ex;
            }
            return ProcedureRunner.getErrorResponse(m_procedureName,
                                                    true,
                                                    0,
                                                    m_appStatusCode,
                                                    m_appStatusString,
                                                    null,
                                                    ex);
        }

        return responseFromTableArray(results);
    }
898933
public static Function<Client<HttpRequest, HttpResponse>, HttpDecodingClient>
    newDecorator(StreamDecoderFactory... decoderFactories) {
        return newDecorator(ImmutableList.copyOf(decoderFactories));
    }
1060349
@Override
	public Response sendFAX(String CorpNum, int ItemCode, String MgtKey,
			String Sender, String Receiver) throws PopbillException {
		return sendFAX(CorpNum, ItemCode, MgtKey, Sender, Receiver, null);
	}
659924
function createSyncFunction(functionName, functionInfo) {
    return function syncLJMFunction() {
        if(arguments.length != functionInfo.args.length) {
            var errStr = 'Invalid number of arguments.  Should be: ';
            errStr += functionInfo.args.length.toString() + '.  ';
            errStr += 'Given: ' + arguments.length + '.  ';
            errStr += getFunctionArgNames(functionInfo).join(', ');
            errStr += '.';
            console.error('Error in ljm-ffi syncLJMFunction', errStr);
            throw new LJMFFIError(errStr);
        } else {
            // Create an array that will be filled with values to call the
            // LJM function with.
            var funcArgs = [];

            // Parse and fill the function arguments array with data.
            allocateAndFillSyncFunctionArgs(functionInfo, funcArgs, arguments);

            // Execute the synchronous LJM function.
            var ljmFunction = liblabjack[functionName];
            var ljmError = ljmFunction.apply(this, funcArgs);

            // Create an object to be returned.
            var retObj = {
                'ljmError': ljmError,
            };
            if(ljmError !== 0) {
                retObj.errorInfo = modbus_map.getErrorInfo(ljmError);
            }

            // Fill the object being returned with data.
            parseAndStoreSyncFunctionArgs(functionInfo, funcArgs, retObj);
            return retObj;
        }
    };
}
1038756
@XmlElementDecl(namespace = "http://www.w3.org/1998/Math/MathML", name = "domain")
    public JAXBElement<FunctionsType> createDomain(FunctionsType value) {
        return new JAXBElement<FunctionsType>(_Domain_QNAME, FunctionsType.class, null, value);
    }
886278
public static function create()
	{
		switch (func_num_args()) {
			case 0:
				return new CodeGeneratorResponse();
			case 1:
				return new CodeGeneratorResponse(func_get_arg(0));
			case 2:
				return new CodeGeneratorResponse(func_get_arg(0), func_get_arg(1));
			case 3:
				return new CodeGeneratorResponse(func_get_arg(0), func_get_arg(1), func_get_arg(2));
			case 4:
				return new CodeGeneratorResponse(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3));
			case 5:
				return new CodeGeneratorResponse(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3), func_get_arg(4));
			case 6:
				return new CodeGeneratorResponse(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3), func_get_arg(4), func_get_arg(5));
			case 7:
				return new CodeGeneratorResponse(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3), func_get_arg(4), func_get_arg(5), func_get_arg(6));
			case 8:
				return new CodeGeneratorResponse(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3), func_get_arg(4), func_get_arg(5), func_get_arg(6), func_get_arg(7));
			default:
				throw new \InvalidArgumentException('More than 8 arguments supplied, please be reasonable.');
		}
	}
729768
public JsJmsMapMessage createJmsMapMessage() throws MessageCreateFailedException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createJmsMapMessage");
    JsJmsMapMessage msg = null;
    try {
      msg = new JsJmsMapMessageImpl(MfpConstants.CONSTRUCTOR_NO_OP);
    }
    catch (MessageDecodeFailedException e) {
      /* No need to FFDC this as JsMsgObject will already have done so */
      // No FFDC code needed
      throw new MessageCreateFailedException(e);
    }
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createJmsMapMessage");
    return msg;
  }
1342356
public static function createResponse($body, $mediaType = 'text/html', $code = 200)
    {
        return Factory::createResponse()
            ->withStatus($code)
            ->withHeader('Content-Type', $mediaType)
            ->withBody(Factory::createStream($body));
    }
929588
public final ControlRequestHighestGeneratedTick createNewControlRequestHighestGeneratedTick() throws MessageCreateFailedException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createNewControlRequestHighestGeneratedTick");
    ControlRequestHighestGeneratedTick msg = null;
    try {
      msg = new ControlRequestHighestGeneratedTickImpl(MfpConstants.CONSTRUCTOR_NO_OP);
    }
    catch (MessageDecodeFailedException e) {
      /* No need to FFDC this as JsMsgObject will already have done so */
      // No FFDC code needed
      throw new MessageCreateFailedException(e);
    }
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createNewControlRequestHighestGeneratedTick");
    return msg;
  }
609372
public static Method getFunction(String functionName) {
    return functionMap.get("sql" + functionName.toLowerCase(Locale.US));
  }