}
}
byte protocolVersion = CougarProtocol.getProtocolVersion(command.getSession());
ExecutionContextWithTokens context = marshaller.readExecutionContext(in, command.getRemoteAddress(), clientCertChain, transportSecurityStrengthFactor, protocolVersion);
final SocketRequestContextImpl requestContext = new SocketRequestContextImpl(context);
OperationKey remoteOperationKey = marshaller.readOperationKey(in);
OperationDefinition opDef = findCompatibleBinding(remoteOperationKey);
if (opDef == null) {
throw new CougarFrameworkException("Can't find operation definition in bindings for operation named '" + remoteOperationKey.getOperationName() + "'");
}
final OperationKey operationKey = opDef.getOperationKey(); // safer to read it from locally
final OperationDefinition operationDefinition = getExecutionVenue().getOperationDefinition(operationKey);
final Object[] args = marshaller.readArgs(operationDefinition.getParameters(), in);
TimeConstraints rawTimeConstraints = marshaller.readTimeConstraintsIfPresent(in, protocolVersion);
final TimeConstraints timeConstraints = DefaultTimeConstraints.rebaseFromNewStartTime(context.getRequestTime(), rawTimeConstraints);
final ExecutionCommand exec = new ExecutionCommand() {
@Override
public Object[] getArgs() {
return args;
}
@Override
public OperationKey getOperationKey() {
return operationKey;
}
@Override
public void onResult(ExecutionResult result) {
if (result.getResultType() == ExecutionResult.ResultType.Success) {
if (operationKey.getType() == OperationKey.Type.ConnectedObject) {
connectedObjectManager.addSubscription(SocketTransportCommandProcessor.this, rpcCommand, (ConnectedResponse) result.getResult(), operationDefinition, requestContext, requestContext.getConnectedObjectLogExtension());
} else {
writeSuccessResponse(rpcCommand, result);
}
} else if (result.getResultType() == ExecutionResult.ResultType.Fault) {