summaryrefslogtreecommitdiffstats
path: root/vpp-api/java/jvpp/gen/dto_gen.py
diff options
context:
space:
mode:
authorTibor Sirovatka <tsirovat@cisco.com>2016-05-18 14:54:50 +0200
committerDave Wallace <dwallacelf@gmail.com>2016-06-09 02:22:34 +0000
commit42bb61fd162b3dd469c9d98a9dc6d3e2b2eaffce (patch)
tree133e183e7b02d7d7e01f1ea1353421d8a65ddb2b /vpp-api/java/jvpp/gen/dto_gen.py
parentb10427e06077dbe3a9ea9922b97941204001f6b9 (diff)
HONEYCOMB-67 Introduce exception handling into JVPP
Send calls throws VppInvocationException on failure Failed requests (negative retval) reported over onError callback interface method Removed retval attributes from dto/xxxReply.java calls Change-Id: Ibd4e90c320d080e02d75b4bd056a7b11c8e37aa7 Signed-off-by: Tibor Sirovatka <tsirovat@cisco.com>
Diffstat (limited to 'vpp-api/java/jvpp/gen/dto_gen.py')
-rw-r--r--vpp-api/java/jvpp/gen/dto_gen.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/vpp-api/java/jvpp/gen/dto_gen.py b/vpp-api/java/jvpp/gen/dto_gen.py
index 378d279c6d0..05859dbe83a 100644
--- a/vpp-api/java/jvpp/gen/dto_gen.py
+++ b/vpp-api/java/jvpp/gen/dto_gen.py
@@ -36,7 +36,7 @@ $methods
field_template = Template(""" public $type $name;\n""")
send_template = Template(""" @Override
- public int send(final $base_package.JVpp jvpp) {
+ public int send(final $base_package.JVpp jvpp) throws org.openvpp.jvpp.VppInvocationException {
return jvpp.$method_name($args);
}\n""")
@@ -58,8 +58,12 @@ def generate_dtos(func_list, base_package, dto_package, inputfile):
fields = ""
for t in zip(func['types'], func['args']):
+ # for retval don't generate dto field in Reply
+ field_name = util.underscore_to_camelcase(t[1])
+ if util.is_reply(camel_case_dto_name) and util.is_retval_field(field_name):
+ continue
fields += field_template.substitute(type=util.jni_2_java_type_mapping[t[0]],
- name=util.underscore_to_camelcase(t[1]))
+ name=field_name)
methods = ""
base_type = ""
if util.is_reply(camel_case_dto_name):