20 Commits

Author SHA1 Message Date
Marek Gradzki
66ea26b1bc VPP-205: jvpp plugin support.
Splits jvpp into two jars
jvpp-registry.jar - base jvpp functionality
jvpp-core.jar - Java wrapper for vpe.api

Plugins can be generated the same way jvpp-core.jar is.
Example (nsh):
https://gerrit.fd.io/r/#/c/2118/

Change-Id: I2254f90b2c3e423563bb91bf70877979f1e90a7d
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2016-08-16 21:26:19 +00:00
Ed Warnicke
adeb749d13 Create python package for jvpp generation.
Change-Id: I2254f90b2c3e423563bb91bf70877979f1e86a6b
Signed-off-by: Ed Warnicke <eaw@cisco.com>
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2016-08-16 17:55:55 +00:00
Marek Gradzki
8a1531dfb7 VPP-233: disallow array[0] in reply messages
- updates jvpp generator to raise exception
  if array[0] is present in reply/detail/counter message

- fixes vpe.api reply/detail/counter messages
  that use incorrect variable array syntax.

Additional info:

Variable arrays in reply/detail/counter messages needs to have
lenght defined in other variable within the message.
The other variable can have any name, so it is impossible to
generate Java/Python code handling.

New syntax introduced by
https://gerrit.fd.io/r/#/c/1617/
fixes the problem:

u32 some_var;
XX array[some_var];

Change-Id: I0af50f1ef1d94d95b56d9326d4e944e72b4edcdd
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2016-08-03 11:42:34 +02:00
Marek Gradzki
8e5458caea VPP-229: fix NPE in JNI array handling
Change-Id: Ieb5182a7a3612e09bd2b28eb6a4abbdb4d29d34b
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2016-08-02 14:27:33 +00:00
Marek Gradzki
b6737a10ac Jvpp: add handling for mising unsigned array types
Change-Id: I239082622ceabdd1d0a7b6b6489a2789096a01fc
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2016-08-01 07:41:16 +02:00
Keith Burns (alagalah)
d038dbf4aa Addition of u16[] to JVPP generator
Change-Id: I8d746cfae4d64ae200ff0053de23b80ee951c290
Signed-off-by: Keith Burns (alagalah) <alagalah@gmail.com>
2016-07-30 11:43:14 -07:00
Marek Gradzki
3659a5aa36 VPP-190: support variable length array syntax in request messages
The information is aleardy stored in array.length field, but
vpe.api syntax should be uniform.

Change-Id: Id84cd95c088281609c70548346cf0e408a6f49ff
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2016-07-11 23:03:40 +00:00
Jan Srnicek
2e95f5a1d1 VPP-184 - Bad type translation in jvpp
Change-Id: I6dda9eb8d58a2bc9a1e4d6636688dfa1f8bb88c6
Signed-off-by: Jan Srnicek <jan.srnicek@pantheon.tech>
2016-07-06 19:16:58 +00:00
Marek Gradzki
fa42e25c4e VPP-118: add support for variable length arrays to jvpp
* extends VPP's message definition language with the following syntax:

u32 count:
u8 array[count];

which is traslated to:

u32 count;
u8 array[0];

but now, python API representation generated by vppapigen
contains information about where the array length is stored.

* modifies existing response messages to use the new syntax

Change-Id: I68210bc7a3a755d03d067e9b79a567f40e2d31f3
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2016-06-24 13:23:16 +00:00
Maros Marsalek
7becd08c4b 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>
2016-06-09 02:41:57 +00:00
Tibor Sirovatka
42bb61fd16 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>
2016-06-09 02:22:34 +00:00
Marek Gradzki
97d99518d7 Add u32[] type handling in reply messages to jvpp
Change-Id: I9fd0cd49e4636d5d8978567fa914487785035c8a
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2016-06-07 11:28:58 +00:00
Marek Gradzki
34e7772443 Fix u16 type handling in jvpp
Change-Id: I6e5ed2562c65dde6c9f6f085c8b9d40f80684894
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2016-05-31 21:19:07 +00:00
Marek Gradzki
c4cb44c05d VPP-86: fix array copy in generated JNI code
Change-Id: Ic67b3c0623d98c5ee3f1ffa1e1bd9cfb96b233bd
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2016-05-24 15:44:28 +00:00
Tibor Sirovatka
071d610dc4 Changed JVPP interface for construction and connectivity
Simplified construction, autoconnected; possible connect/close
See updated sample test cases with changed interface usage

Change-Id: Ib53e855880bc414868aa2b9bb8f5df086917e375
Signed-off-by: Tibor Sirovatka <tsirovat@cisco.com>
2016-05-23 06:25:05 +00:00
Tibor Sirovatka
c288066921 JVPP - null checks changed to Objects.requireNonNull usage
Review changes incorporated

Change-Id: Ia04b62144a0d3643095b518db538c7eb5137c048
Signed-off-by: Tibor Sirovatka <tsirovat@cisco.com>
2016-05-12 03:15:23 +00:00
Marek Gradzki
0aaf92ffbb HONEYCOMB-10: fix issues with FindClass in multithreaded environments
Added jclass reference caching and updated JNI version to 1.8

Change-Id: Ie8dbbd4b91b90bf9e4e9a6148313e46056b0d67e
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2016-05-04 15:52:22 +00:00
Maros Marsalek
72c7a2eadb HONEYCOMB-10: Add specific methods for each request to Future facade
These specific methods remove the need for casting on client
side code while using generic send method

Change-Id: Ic0240359333831b676a7d205f63ac1c3f3f8af4c
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
2016-05-02 21:19:11 +00:00
Marek Gradzki
d85036fd6b HONEYCOMB-10: jVpp - the new java API. C code and jar file generation
Added comments generation for C and Java files.

Change-Id: Ifb670a5592eb871bfe68804f0a8d8f9b5b14f00a
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Signed-off-by: Ed Warnicke <eaw@cisco.com>
2016-05-02 20:58:54 +00:00
Maros Marsalek
45a42b5d7f HONEYCOMB-10: jVpp - the new java API. Java code generation
The old japi has two main drawbacks:

* it is not fully generated (requres manual coding for
every new api call that returns data other thanstatus code)

* it is not asynchronous from Java perspective (requires
active wait loops - big overhead due to JNI boundary being
crossed lots of times).

The new api is lightweight (fully generated except for connect,
disconenct and ping) and truly asynchronous (uses callbacks,
utilities that offer java.util.concurrent.Future interface
are also provided).

Change-Id: I531080ef651e8a74f19210490c71d161221ab600
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
Signed-off-by: Ed Warnicke <eaw@cisco.com>
2016-05-02 08:46:21 -05:00