diff options
Diffstat (limited to 'vpp-api/java/jvpp/gen')
-rw-r--r-- | vpp-api/java/jvpp/gen/jvpp_callback_facade_gen.py | 15 | ||||
-rw-r--r-- | vpp-api/java/jvpp/gen/jvpp_future_facade_gen.py | 15 | ||||
-rw-r--r-- | vpp-api/java/jvpp/gen/jvpp_impl_gen.py | 15 |
3 files changed, 39 insertions, 6 deletions
diff --git a/vpp-api/java/jvpp/gen/jvpp_callback_facade_gen.py b/vpp-api/java/jvpp/gen/jvpp_callback_facade_gen.py index de239b6d1a3..e8de3fc10c1 100644 --- a/vpp-api/java/jvpp/gen/jvpp_callback_facade_gen.py +++ b/vpp-api/java/jvpp/gen/jvpp_callback_facade_gen.py @@ -51,10 +51,19 @@ public final class CallbackJVppFacade implements $base_package.$callback_facade_ private final $base_package.JVpp jvpp; private final java.util.Map<Integer, $base_package.$callback_package.JVppCallback> callbacks; - public CallbackJVppFacade(final $base_package.JVpp jvpp, - java.util.Map<Integer, $base_package.$callback_package.JVppCallback> callbacks) { + /** + * <p>Create CallbackJVppFacade object for provided JVpp instance. + * Constructor internally creates CallbackJVppFacadeCallback class for processing callbacks + * and then connects to provided JVpp instance + * + * @param jvpp provided $base_package.JVpp instance + * + * @throws java.io.IOException in case instance cannot connect to JVPP + */ + public CallbackJVppFacade(final $base_package.JVpp jvpp) throws java.io.IOException { this.jvpp = java.util.Objects.requireNonNull(jvpp,"jvpp is null"); - this.callbacks = callbacks; + this.callbacks = new java.util.HashMap<>(); + this.jvpp.connect(new CallbackJVppFacadeCallback(this.callbacks)); } @Override diff --git a/vpp-api/java/jvpp/gen/jvpp_future_facade_gen.py b/vpp-api/java/jvpp/gen/jvpp_future_facade_gen.py index 4f63f9bcf4b..5574f120712 100644 --- a/vpp-api/java/jvpp/gen/jvpp_future_facade_gen.py +++ b/vpp-api/java/jvpp/gen/jvpp_future_facade_gen.py @@ -250,9 +250,18 @@ package $base_package.$future_package; */ public class FutureJVppFacade extends FutureJVppInvokerFacade implements FutureJVpp { - public FutureJVppFacade(final $base_package.JVpp jvpp, - final java.util.Map<Integer, java.util.concurrent.CompletableFuture<? extends $base_package.$dto_package.JVppReply<?>>> requestMap) { - super(jvpp, requestMap); + /** + * <p>Create FutureJVppFacade object for provided JVpp instance. + * Constructor internally creates FutureJVppFacadeCallback class for processing callbacks + * and then connects to provided JVpp instance + * + * @param jvpp provided $base_package.JVpp instance + * + * @throws java.io.IOException in case instance cannot connect to JVPP + */ + public FutureJVppFacade(final $base_package.JVpp jvpp) throws java.io.IOException { + super(jvpp, new java.util.HashMap<>()); + jvpp.connect(new FutureJVppFacadeCallback(getRequests())); } $methods } diff --git a/vpp-api/java/jvpp/gen/jvpp_impl_gen.py b/vpp-api/java/jvpp/gen/jvpp_impl_gen.py index 4e2625714a9..4e408c364b1 100644 --- a/vpp-api/java/jvpp/gen/jvpp_impl_gen.py +++ b/vpp-api/java/jvpp/gen/jvpp_impl_gen.py @@ -28,6 +28,16 @@ package $base_package; public interface JVpp extends java.lang.AutoCloseable { /** + * Generic connect with $base_package.callback.JVppCallback callback handler + * providing connecting to VPP + * + * @param callback JVppCallback instance providing callback handling + * + * @throws java.io.IOException if connection cannot be initiated + */ + void connect($base_package.callback.JVppCallback callback) throws java.io.IOException; + + /** * Generic dispatch method for sending requests to VPP */ int send($base_package.$dto_package.JVppRequest request); @@ -56,6 +66,11 @@ public final class JVppImpl implements $base_package.JVpp { } @Override + public void connect($base_package.callback.JVppCallback callback) throws java.io.IOException { + connection.connect(callback); + } + + @Override public void close() { connection.close(); } |