Sets the <tt>ModbusRequest</tt> for this
<tt>ModbusTransaction</tt>.<p>
The related <tt>ModbusResponse</tt> is acquired
from the passed in <tt>ModbusRequest</tt> instance.<br>
<p>

@param req a <tt>ModbusRequest</tt>.
199816
public void setRequest(ModbusRequest req) {
        request = req;
        if (req != null) {
            request.setTransactionID(getTransactionID());
        }
    }
594600
protected void setRequestContent(HTTPRequest httpRequest,HttpMethodBase httpMethodClient)
    {
        //set content
        if(httpMethodClient instanceof EntityEnclosingMethod)
        {
            EntityEnclosingMethod pushMethod=(EntityEnclosingMethod)httpMethodClient;
            
            RequestEntity requestEntity=null;
            ContentType contentType=httpRequest.getContentType();
            switch(contentType)
            {
                case STRING:
                    requestEntity=this.createStringRequestContent(httpRequest);
                    break;
                case BINARY:
                    requestEntity=this.createBinaryRequestContent(httpRequest);
                    break;
                case MULTI_PART:
                    requestEntity=this.createMultiPartRequestContent(httpRequest,httpMethodClient);
                    break;
                default:
                    throw new FaxException("Unsupported content type: "+contentType);
            }

            //set request data
            if(requestEntity!=null)
            {
                pushMethod.setRequestEntity(requestEntity);
                pushMethod.setContentChunked(false);
            }
        }
    }
632080
protected void addPendingRequestForType(ResourceRequestInfo req) {
    Context c = getContext(req.getType());
    c.pendingRequests.add(req);
    c.pendingRequestCount++;
  }
555055
void setBus(String busName)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "setBus", busName);
    this.busName = busName;
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "setBus");
  }
1233842
public void addTransaction(SipServletRequestImpl request) {
        if(!request.getMethod().equalsIgnoreCase("ACK") && !request.getMethod().equalsIgnoreCase("PRACK")) {
                String branch = ((Via)request.getMessage().getHeader(Via.NAME)).getBranch();
                if(this.ongoingTransactions.add(new TransactionRequest(branch, request))) {
                        request.getTransactionApplicationData().setProxyBranch(this);
                        if(logger.isDebugEnabled()) {
                                logger.debug("Added transaction "+branch+" to proxy branch.");
                        }
                }                                               
        }                               
    }
1145457
@Override
    public void setBusName(final String busName) {
        if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) {
            SibTr.debug(this, TRACE, "setBusName", busName);
        }
        _busName = busName;
    }
1315877
@Override
    public ModbusResponse process(DataHolder dataHolder) throws ModbusNumberException {
        MaskWriteRegisterResponse response = (MaskWriteRegisterResponse) getResponse();
        response.setStartAddress(getStartAddress());
        response.setMaskAnd(getMaskAnd());
        response.setMaskOr(getMaskOr());

        try {
            int reg = dataHolder.readHoldingRegister(getStartAddress());
            dataHolder.writeHoldingRegister(getStartAddress(), (reg & getMaskAnd()) | (getMaskOr() & (~getMaskAnd())));
        } catch (ModbusProtocolException e) {
            response.setException();
            response.setModbusExceptionCode(e.getException().getValue());
        }
        return response;
    }
976423
public void setRemoteQueue(InvocationRequestQueue remoteQueue) {
        this.remoteQueue = remoteQueue;
        InvocationRequest deferredRequest = helpRequest;
        sendRequest(loadRequest, false);
        sendRequest(deferredRequest, false);
    }
961460
public final void setBus(String value) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "setBus", value);
        getHdr2().setField(JsHdr2Access.BUS, value);
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "setBus");
    }
1039001
public <R extends Request<T>> R setRetryPolicy(RetryPolicy retryPolicy) {
        checkIfActive();
        this.retryPolicy = retryPolicy;
        return (R) this;
    }
1207330
public void setRequestProperty(String key, Object value) {
		if (value != null) {
			if (requestProperties == null) {
				requestProperties = new HashMap<>();
			}
			requestProperties.put(key, value);
		}
	}
423541
@Nonnull
  public final HttpClientFactory setRetryMode (@Nonnull final ERetryMode eRetryMode)
  {
    ValueEnforcer.notNull (eRetryMode, "RetryMode");
    m_eRetryMode = eRetryMode;
    return this;
  }
1082746
public void connect() throws Exception {
        if (connection != null && !connection.isConnected()) {
            connection.connect(useRtuOverTcp);
            transaction = connection.getModbusTransport().createTransaction();
            ((ModbusTCPTransaction)transaction).setReconnecting(reconnecting);
            setTransaction(transaction);
        }
    }
1328381
public void setPurchase(java.util.Collection<Purchase> purchase) {
        if (purchase == null) {
            this.purchase = null;
            return;
        }

        this.purchase = new com.amazonaws.internal.SdkInternalList<Purchase>(purchase);
    }
814433
public void setResponseBody(HttpResponseBody resBody) {
		if (resBody == null) {
			throw new IllegalArgumentException("The parameter resBody must not be null.");
		}
		mResBody = resBody;
	    getResponseBody().setCharset(getResponseHeader().getCharset());

	}
174184
protected ModbusResponse readResponseIn() throws ModbusIOException {
        boolean done;
        ModbusResponse response;
        int dlength;

        try {
            do {
                // 1. read to function code, create request and read function
                // specific bytes
                synchronized (byteInputStream) {
                    int uid = readByte();

                    if (uid != -1) {
                        int fc = readByte();
                        byteInputOutputStream.reset();
                        byteInputOutputStream.writeByte(uid);
                        byteInputOutputStream.writeByte(fc);

                        // create response to acquire length of message
                        response = ModbusResponse.createModbusResponse(fc);
                        response.setHeadless();

                        /*
                         * With Modbus RTU, there is no end frame. Either we
                         * assume the message is complete as is or we must do
                         * function specific processing to know the correct
                         * length. To avoid moving frame timing to the serial
                         * input functions, we set the timeout and to message
                         * specific parsing to read a response.
                         */
                        getResponse(fc, byteInputOutputStream);
                        dlength = byteInputOutputStream.size() - 2; // less the crc
                        if (logger.isDebugEnabled()) {
                            logger.debug("Response: {}", ModbusUtil.toHex(byteInputOutputStream.getBuffer(), 0, dlength + 2));
                        }
                        byteInputStream.reset(inBuffer, dlength);

                        // check CRC
                        int[] crc = ModbusUtil.calculateCRC(inBuffer, 0, dlength); // does not include CRC
                        if (ModbusUtil.unsignedByteToInt(inBuffer[dlength]) != crc[0] || ModbusUtil.unsignedByteToInt(inBuffer[dlength + 1]) != crc[1]) {
                            logger.debug("CRC should be {}, {}", crc[0], crc[1]);
                            throw new IOException("CRC Error in received frame: " + dlength + " bytes: " + ModbusUtil.toHex(byteInputStream.getBuffer(), 0, dlength));
                        }
                    }
                    else {
                        throw new IOException("Error reading response");
                    }

                    // read response
                    byteInputStream.reset(inBuffer, dlength);
                    response.readFrom(byteInputStream);
                    done = true;
                }
            } while (!done);
            return response;
        }
        catch (IOException ex) {
            // FIXME: This printout is wrong when reading response from other slave
            throw new ModbusIOException("I/O exception - failed to read response for request [%s] - %s", ModbusUtil.toHex(lastRequest), ex.getMessage());
        }
    }
764910
public static void setController(ServletRequest req, CmsFlexController controller) {

        req.setAttribute(CmsFlexController.ATTRIBUTE_NAME, controller);
    }