"Module not found in SCA component.");
sendMessage(connection, senderPid, senderRef,
MessageHelper.ATOM_BADRPC, errorMsg);
} else {
// module found, looking for operation
RuntimeComponentService service = nodeElement.getService();
ErlangBinding binding = nodeElement.getBinding();
List<Operation> operations = service.getInterfaceContract()
.getInterface().getOperations();
Operation operation = null;
for (Operation o : operations) {
if (o.getName().equals(function)) {
operation = o;
break;
}
}
if (operation != null) {
// operation found
List<DataType> iTypes = operation.getInputType()
.getLogical();
Class<?>[] forClasses = new Class<?>[iTypes.size()];
for (int i = 0; i < iTypes.size(); i++) {
forClasses[i] = iTypes.get(i).getPhysical();
}
try {
// invoke operation
Method jmethod = ((JavaOperation) operation)
.getJavaMethod();
Object result = service.getRuntimeWire(binding,
service.getInterfaceContract()).invoke(
operation,
TypeHelpersProxy.toJavaFromList(argsList,
forClasses, jmethod
.getParameterAnnotations()));
OtpErlangObject response = null;