From ac1a7286500c18ac51beb66e4a2b99ea26c8c966 Mon Sep 17 00:00:00 2001 From: Matej Perina Date: Mon, 11 Sep 2017 10:11:51 +0200 Subject: jvpp: adding callbacks for all messages (VPP-914) 1) In the previous version callbacks were generated based on request-replay naming conventions. It turned out they were too strict in case of events (e.g. BFD sends Details messages as notifications). So now we generate callback for all messages, allowing to receive any message as notification.(callback_gen.py) 2) "notification" suffix is no longer added because all messages are treated same (dto_gen.py, jvpp_c_gen_.py) 3) name of property that holds notification/events changed in callback facade and future apis 4) JVppNotification.java is no longer used since all events are treated equally Change-Id: I13f6438affc3473040d63cd4acb3984d03e97482 Signed-off-by: Matej --- .../java/jvpp/gen/jvppgen/jvpp_future_facade_gen.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/vpp-api/java/jvpp/gen/jvppgen/jvpp_future_facade_gen.py') diff --git a/src/vpp-api/java/jvpp/gen/jvppgen/jvpp_future_facade_gen.py b/src/vpp-api/java/jvpp/gen/jvppgen/jvpp_future_facade_gen.py index b2f8d376aca..a31287b3333 100644 --- a/src/vpp-api/java/jvpp/gen/jvppgen/jvpp_future_facade_gen.py +++ b/src/vpp-api/java/jvpp/gen/jvppgen/jvpp_future_facade_gen.py @@ -30,12 +30,12 @@ package $plugin_package.$future_package; public final class FutureJVpp${plugin_name}FacadeCallback implements $plugin_package.$callback_package.JVpp${plugin_name}GlobalCallback { private final java.util.Map>> requests; - private final $plugin_package.$notification_package.Global${plugin_name}NotificationCallback notificationCallback; + private final $plugin_package.$notification_package.Global${plugin_name}EventCallback notificationCallback; private static final java.util.logging.Logger LOG = java.util.logging.Logger.getLogger(FutureJVpp${plugin_name}FacadeCallback.class.getName()); public FutureJVpp${plugin_name}FacadeCallback( final java.util.Map>> requestMap, - final $plugin_package.$notification_package.Global${plugin_name}NotificationCallback notificationCallback) { + final $plugin_package.$notification_package.Global${plugin_name}EventCallback notificationCallback) { this.requests = requestMap; this.notificationCallback = notificationCallback; } @@ -213,7 +213,7 @@ def generate_jvpp(func_list, base_package, plugin_package, plugin_name, dto_pack if util.is_notification(func["name"]): callbacks.append(jvpp_facade_callback_notification_method_template.substitute(plugin_package=plugin_package, dto_package=dto_package, - callback_dto=util.add_notification_suffix(camel_case_name_with_suffix))) + callback_dto=camel_case_name_with_suffix)) jvpp_file = open(os.path.join(future_facade_package, "FutureJVpp%sFacadeCallback.java" % plugin_name), 'w') jvpp_file.write(jvpp_facade_callback_template.substitute(inputfile=inputfile, @@ -264,7 +264,7 @@ public interface FutureJVpp${plugin_name} extends $base_package.$future_package. $methods @Override - public $plugin_package.$notification_package.${plugin_name}NotificationRegistry getNotificationRegistry(); + public $plugin_package.$notification_package.${plugin_name}EventRegistry getEventRegistry(); } ''') @@ -284,7 +284,7 @@ package $plugin_package.$future_package; */ public class FutureJVpp${plugin_name}Facade extends $base_package.$future_package.AbstractFutureJVppInvoker implements FutureJVpp${plugin_name} { - private final $plugin_package.$notification_package.${plugin_name}NotificationRegistryImpl notificationRegistry = new $plugin_package.$notification_package.${plugin_name}NotificationRegistryImpl(); + private final $plugin_package.$notification_package.${plugin_name}EventRegistryImpl eventRegistry = new $plugin_package.$notification_package.${plugin_name}EventRegistryImpl(); /** *

Create FutureJVpp${plugin_name}Facade object for provided JVpp instance. @@ -298,12 +298,12 @@ public class FutureJVpp${plugin_name}Facade extends $base_package.$future_packag public FutureJVpp${plugin_name}Facade(final $base_package.JVppRegistry registry, final $base_package.JVpp jvpp) throws java.io.IOException { super(jvpp, registry, new java.util.HashMap<>()); java.util.Objects.requireNonNull(registry, "JVppRegistry should not be null"); - registry.register(jvpp, new FutureJVpp${plugin_name}FacadeCallback(getRequests(), notificationRegistry)); + registry.register(jvpp, new FutureJVpp${plugin_name}FacadeCallback(getRequests(), eventRegistry)); } @Override - public $plugin_package.$notification_package.${plugin_name}NotificationRegistry getNotificationRegistry() { - return notificationRegistry; + public $plugin_package.$notification_package.${plugin_name}EventRegistry getEventRegistry() { + return eventRegistry; } $methods -- cgit 1.2.3-korg