diff options
author | Matej Perina <mperina@cisco.com> | 2017-09-11 10:11:51 +0200 |
---|---|---|
committer | Damjan Marion <dmarion.lists@gmail.com> | 2017-10-10 16:44:03 +0000 |
commit | ac1a7286500c18ac51beb66e4a2b99ea26c8c966 (patch) | |
tree | 62a4a0430bd0d5623c5e9945ca5bf671745351f9 /src/vpp-api/java/jvpp/gen/jvppgen/jvpp_future_facade_gen.py | |
parent | d91c1dbdb31f80db7d967f2f57c43d0a81d65297 (diff) |
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 <matej.perina@pantheon.tech>
Diffstat (limited to 'src/vpp-api/java/jvpp/gen/jvppgen/jvpp_future_facade_gen.py')
-rw-r--r-- | src/vpp-api/java/jvpp/gen/jvppgen/jvpp_future_facade_gen.py | 16 |
1 files changed, 8 insertions, 8 deletions
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<java.lang.Integer, java.util.concurrent.CompletableFuture<? extends $base_package.$dto_package.JVppReply<?>>> 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<java.lang.Integer, java.util.concurrent.CompletableFuture<? extends $base_package.$dto_package.JVppReply<?>>> 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(); /** * <p>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 |