diff options
author | Maros Marsalek <mmarsale@cisco.com> | 2016-05-31 17:45:16 +0200 |
---|---|---|
committer | Dave Wallace <dwallacelf@gmail.com> | 2016-06-09 02:41:57 +0000 |
commit | 7becd08c4b641886ad08dedb90be156f305140ee (patch) | |
tree | df7d5caf95591ffeb9be0d37d74503633e66c890 /vpp-api/java/jvpp/gen/callback_gen.py | |
parent | 42bb61fd162b3dd469c9d98a9dc6d3e2b2eaffce (diff) |
VPP-119: JVpp notifications
- add notification DTOs to JVpp
- add notification callbacks
- add notification registry
- provide/implement notification registry from future and callback facades
Change-Id: I1060ef2ec8ba1eb2e8cff279c93b73aa7c9f9aee
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
Diffstat (limited to 'vpp-api/java/jvpp/gen/callback_gen.py')
-rw-r--r-- | vpp-api/java/jvpp/gen/callback_gen.py | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/vpp-api/java/jvpp/gen/callback_gen.py b/vpp-api/java/jvpp/gen/callback_gen.py index 8a0d20124ae..eadf3b5c50d 100644 --- a/vpp-api/java/jvpp/gen/callback_gen.py +++ b/vpp-api/java/jvpp/gen/callback_gen.py @@ -31,7 +31,7 @@ package $base_package.$callback_package; $docs * </pre> */ -public interface $cls_name extends $base_package.$callback_package.JVppCallback { +public interface $cls_name extends $base_package.$callback_package.$callback_type { $callback_method @@ -61,15 +61,21 @@ def generate_callbacks(func_list, base_package, callback_package, dto_package, i callbacks = [] for func in func_list: - if util.is_notification(func['name']) or util.is_ignored(func['name']): - # FIXME handle notifications + if util.is_ignored(func['name']): continue camel_case_name_with_suffix = util.underscore_to_camelcase_upper(func['name']) - if not util.is_reply(camel_case_name_with_suffix): + if not util.is_reply(camel_case_name_with_suffix) and not util.is_notification(func['name']): continue - camel_case_name = util.remove_reply_suffix(camel_case_name_with_suffix) + if util.is_reply(camel_case_name_with_suffix): + camel_case_name = util.remove_reply_suffix(camel_case_name_with_suffix) + callback_type = "JVppCallback" + else: + camel_case_name_with_suffix = util.add_notification_suffix(camel_case_name_with_suffix) + camel_case_name = camel_case_name_with_suffix + callback_type = "JVppNotificationCallback" + callbacks.append("{0}.{1}.{2}".format(base_package, callback_package, camel_case_name + callback_suffix)) callback_path = os.path.join(callback_package, camel_case_name + callback_suffix + ".java") callback_file = open(callback_path, 'w') @@ -82,7 +88,8 @@ def generate_callbacks(func_list, base_package, callback_package, dto_package, i cls_name=camel_case_name + callback_suffix, callback_method=method, base_package=base_package, - callback_package=callback_package)) + callback_package=callback_package, + callback_type=callback_type)) callback_file.flush() callback_file.close() |