private void addBytes(byte functionStateOrHasResult) { if (ConnectionImpl .getClientFunctionTimeout() == ConnectionImpl.DEFAULT_CLIENT_FUNCTION_TIMEOUT) { getMessage().addBytesPart(new byte[] {functionStateOrHasResult}); } else { byte[] bytes = new byte[5]; bytes[0] = functionStateOrHasResult; Part.encodeInt(ConnectionImpl.getClientFunctionTimeout(), bytes, 1); getMessage().addBytesPart(bytes); } }
private void addBytes(byte functionState) { if (ConnectionImpl .getClientFunctionTimeout() == ConnectionImpl.DEFAULT_CLIENT_FUNCTION_TIMEOUT) { getMessage().addBytesPart(new byte[] {functionState}); } else { byte[] bytes = new byte[5]; bytes[0] = functionState; Part.encodeInt(ConnectionImpl.getClientFunctionTimeout(), bytes, 1); getMessage().addBytesPart(bytes); } }
private void addBytes(byte isReexecute, byte fnStateOrHasResult) { if (ConnectionImpl .getClientFunctionTimeout() == ConnectionImpl.DEFAULT_CLIENT_FUNCTION_TIMEOUT) { if (isReexecute == 1) { getMessage().addBytesPart( new byte[] {AbstractExecution.getReexecuteFunctionState(fnStateOrHasResult)}); } else { getMessage().addBytesPart(new byte[] {fnStateOrHasResult}); } } else { byte[] bytes = new byte[5]; if (isReexecute == 1) { bytes[0] = AbstractExecution.getReexecuteFunctionState(fnStateOrHasResult); } else { bytes[0] = fnStateOrHasResult; } Part.encodeInt(ConnectionImpl.getClientFunctionTimeout(), bytes, 1); getMessage().addBytesPart(bytes); } }
@Override public Object execute(Op op) throws Exception { Object result; // Do not synchronize when used for GatewaySender // as the same connection is being used if ((op instanceof AbstractOp) && ((AbstractOp) op).isGatewaySenderOp()) { result = op.attempt(this); endpoint.updateLastExecute(); return result; } synchronized (this) { if (op instanceof ExecuteFunctionOpImpl || op instanceof ExecuteRegionFunctionOpImpl || op instanceof ExecuteRegionFunctionSingleHopOpImpl) { int earliertimeout = this.getSocket().getSoTimeout(); this.getSocket().setSoTimeout(getClientFunctionTimeout()); try { result = op.attempt(this); } finally { this.getSocket().setSoTimeout(earliertimeout); } } else { result = op.attempt(this); } } endpoint.updateLastExecute(); return result; }