.finish();
}
private Statement generateRequest(ClassStructureBuilder<?> classBuilder,
MetaMethod method, Statement methodParams, boolean intercepted) {
BlockStatement requestBlock = new BlockStatement();
requestBlock.addStatement(Stmt.declareVariable("sendable", RemoteCallSendable.class, null));
requestBlock.addStatement(
If.isNull(Variable.get("errorCallback"))
.append(Stmt.loadVariable("sendable").assignValue(
Stmt
.invokeStatic(MessageBuilder.class, "createCall")
.invoke("call", remote.getFullyQualifiedName())
.invoke("endpoint", ProxyUtil.createCallSignature(method),
Stmt.loadClassMember("qualifiers"),
methodParams)
.invoke("respondTo", method.getReturnType().asBoxed(), Stmt.loadVariable("remoteCallback"))
.invoke("defaultErrorHandling")))
.finish()
.else_()
.append(Stmt.loadVariable("sendable").assignValue(
Stmt
.invokeStatic(MessageBuilder.class, "createCall")
.invoke("call", remote.getFullyQualifiedName())
.invoke("endpoint", ProxyUtil.createCallSignature(method),
Stmt.loadClassMember("qualifiers"),
methodParams)
.invoke("respondTo", method.getReturnType().asBoxed(), Stmt.loadVariable("remoteCallback"))
.invoke("errorsHandledBy", Stmt.loadVariable("errorCallback"))))
.finish());
requestBlock.addStatement(Stmt.loadStatic(classBuilder.getClassDefinition(), "this")
.invoke("sendRequest", Variable.get("bus"), Variable.get("sendable")));
return requestBlock;
}