aboutsummaryrefslogtreecommitdiffstats
path: root/vpp-api/java/jvpp
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2016-09-28 10:12:04 +0200
committerDamjan Marion <dmarion.lists@gmail.com>2016-09-29 08:54:43 +0000
commite85581cd07cf70d19870d8f858420f252ced3405 (patch)
tree58c4e2fcaa02c7f324e684687e328b76f2e8bbe1 /vpp-api/java/jvpp
parent85ecc810ca98550a250c74f32244760e459e3f87 (diff)
VPP-378: rename jvpp package to the same as groupId of deployed jars
Related changes: - NSH: https://gerrit.fd.io/r/#/c/3181/ - Honeycomb: https://gerrit.fd.io/r/#/c/3182 Change-Id: Ifdd6b8b575916fdf99794618dbe604c2e17e8e82 Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'vpp-api/java/jvpp')
-rwxr-xr-xvpp-api/java/jvpp/gen/jvpp_gen.py8
-rw-r--r--vpp-api/java/jvpp/gen/jvppgen/dto_gen.py2
-rw-r--r--vpp-api/java/jvpp/gen/jvppgen/jvpp_c_gen.py10
-rw-r--r--vpp-api/java/jvpp/gen/jvppgen/jvpp_impl_gen.py22
4 files changed, 21 insertions, 21 deletions
diff --git a/vpp-api/java/jvpp/gen/jvpp_gen.py b/vpp-api/java/jvpp/gen/jvpp_gen.py
index 551ce7d264c..d8ee6a14c75 100755
--- a/vpp-api/java/jvpp/gen/jvpp_gen.py
+++ b/vpp-api/java/jvpp/gen/jvpp_gen.py
@@ -29,11 +29,11 @@ from jvppgen import jvpp_c_gen
from jvppgen import util
# Invocation:
-# ~/Projects/vpp/vpp-api/jvpp/gen$ mkdir -p java/org/openvpp/jvpp && cd java/org/openvpp/jvpp
-# ~/Projects/vpp/vpp-api/jvpp/gen/java/org/openvpp/jvpp$ ../../../../jvpp_gen.py -idefs_api_vpp_papi.py
+# ~/Projects/vpp/vpp-api/jvpp/gen$ mkdir -p java/io/fd/vpp/jvpp && cd java/io/fd/vpp/jvpp
+# ~/Projects/vpp/vpp-api/jvpp/gen/java/io/fd/vpp/jvpp$ ../../../../jvpp_gen.py -idefs_api_vpp_papi.py
#
# Compilation:
-# ~/Projects/vpp/vpp-api/jvpp/gen/java/org/openvpp/jvpp$ javac *.java dto/*.java callback/*.java
+# ~/Projects/vpp/vpp-api/jvpp/gen/java/io/fd/vpp/jvpp$ javac *.java dto/*.java callback/*.java
#
# where
# defs_api_vpp_papi.py - vpe.api in python format (generated by vppapigen)
@@ -137,7 +137,7 @@ def get_definitions():
func_list, func_name = get_definitions()
-base_package = 'org.openvpp.jvpp'
+base_package = 'io.fd.vpp.jvpp'
plugin_package = base_package + '.' + plugin_name
dto_package = 'dto'
callback_package = 'callback'
diff --git a/vpp-api/java/jvpp/gen/jvppgen/dto_gen.py b/vpp-api/java/jvpp/gen/jvppgen/dto_gen.py
index 0f74a1dedd9..b117288cdd2 100644
--- a/vpp-api/java/jvpp/gen/jvppgen/dto_gen.py
+++ b/vpp-api/java/jvpp/gen/jvppgen/dto_gen.py
@@ -38,7 +38,7 @@ $methods
field_template = Template(""" public $type $name;\n""")
send_template = Template(""" @Override
- public int send(final $base_package.JVpp jvpp) throws org.openvpp.jvpp.VppInvocationException {
+ public int send(final $base_package.JVpp jvpp) throws io.fd.vpp.jvpp.VppInvocationException {
return (($plugin_package.JVpp${plugin_name})jvpp).$method_name($args);
}""")
diff --git a/vpp-api/java/jvpp/gen/jvppgen/jvpp_c_gen.py b/vpp-api/java/jvpp/gen/jvppgen/jvpp_c_gen.py
index cd3a3566f42..ef077090467 100644
--- a/vpp-api/java/jvpp/gen/jvppgen/jvpp_c_gen.py
+++ b/vpp-api/java/jvpp/gen/jvppgen/jvpp_c_gen.py
@@ -25,7 +25,7 @@ class_reference_template = Template("""jclass ${ref_name}Class;
""")
find_class_invocation_template = Template("""
- ${ref_name}Class = (jclass)(*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/openvpp/jvpp/${plugin_name}/dto/${class_name}"));
+ ${ref_name}Class = (jclass)(*env)->NewGlobalRef(env, (*env)->FindClass(env, "io/fd/vpp/jvpp/${plugin_name}/dto/${class_name}"));
if ((*env)->ExceptionCheck(env)) {
(*env)->ExceptionDescribe(env);
return JNI_ERR;
@@ -86,7 +86,7 @@ def generate_class_cache(func_list, plugin_name):
# add exception class to class cache
ref_name = 'callbackException'
- class_name = 'org/openvpp/jvpp/VppCallbackException'
+ class_name = 'io/fd/vpp/jvpp/VppCallbackException'
class_references.append(class_reference_template.substitute(
ref_name=ref_name))
find_class_invocations.append(find_class_template.substitute(
@@ -102,7 +102,7 @@ def generate_class_cache(func_list, plugin_name):
# TODO: cache method and field identifiers to achieve better performance
# https://jira.fd.io/browse/HONEYCOMB-42
request_class_template = Template("""
- jclass requestClass = (*env)->FindClass(env, "org/openvpp/jvpp/${plugin_name}/dto/${java_name_upper}");""")
+ jclass requestClass = (*env)->FindClass(env, "io/fd/vpp/jvpp/${plugin_name}/dto/${java_name_upper}");""")
request_field_identifier_template = Template("""
jfieldID ${java_name}FieldId = (*env)->GetFieldID(env, requestClass, "${java_name}", "${jni_signature}");
@@ -200,7 +200,7 @@ jni_impl_template = Template("""
* Generated based on $inputfile preparsed data:
$api_data
*/
-JNIEXPORT jint JNICALL Java_org_openvpp_jvpp_${plugin_name}_JVpp${java_plugin_name}Impl_${java_name}0
+JNIEXPORT jint JNICALL Java_io_fd_vpp_jvpp_${plugin_name}_JVpp${java_plugin_name}Impl_${java_name}0
(JNIEnv * env, jclass clazz$args) {
${plugin_name}_main_t *plugin_main = &${plugin_name}_main;
vl_api_${c_name}_t * mp;
@@ -405,7 +405,7 @@ static void vl_api_${handler_name}_t_handler (vl_api_${handler_name}_t * mp)
$err_handler
jmethodID constructor = (*env)->GetMethodID(env, ${class_ref_name}Class, "<init>", "()V");
- jmethodID callbackMethod = (*env)->GetMethodID(env, plugin_main->callbackClass, "on${dto_name}", "(Lorg/openvpp/jvpp/${plugin_name}/dto/${dto_name};)V");
+ jmethodID callbackMethod = (*env)->GetMethodID(env, plugin_main->callbackClass, "on${dto_name}", "(Lio/fd/vpp/jvpp/${plugin_name}/dto/${dto_name};)V");
jobject dto = (*env)->NewObject(env, ${class_ref_name}Class, constructor);
$dto_setters
diff --git a/vpp-api/java/jvpp/gen/jvppgen/jvpp_impl_gen.py b/vpp-api/java/jvpp/gen/jvppgen/jvpp_impl_gen.py
index 41df4f2ae18..16c84ce54e8 100644
--- a/vpp-api/java/jvpp/gen/jvppgen/jvpp_impl_gen.py
+++ b/vpp-api/java/jvpp/gen/jvppgen/jvpp_impl_gen.py
@@ -29,9 +29,9 @@ public interface JVpp${plugin_name} extends $base_package.JVpp {
/**
* Generic dispatch method for sending requests to VPP
*
- * @throws org.openvpp.jvpp.VppInvocationException if send request had failed
+ * @throws io.fd.vpp.jvpp.VppInvocationException if send request had failed
*/
- int send($base_package.$dto_package.JVppRequest request) throws org.openvpp.jvpp.VppInvocationException;
+ int send($base_package.$dto_package.JVppRequest request) throws io.fd.vpp.jvpp.VppInvocationException;
$methods
}
@@ -120,12 +120,12 @@ public final class JVpp${plugin_name}Impl implements $plugin_package.JVpp${plugi
}
@Override
- public int send($base_package.$dto_package.JVppRequest request) throws org.openvpp.jvpp.VppInvocationException {
+ public int send($base_package.$dto_package.JVppRequest request) throws io.fd.vpp.jvpp.VppInvocationException {
return request.send(this);
}
@Override
- public final int controlPing(final org.openvpp.jvpp.dto.ControlPing controlPing) throws org.openvpp.jvpp.VppInvocationException {
+ public final int controlPing(final io.fd.vpp.jvpp.dto.ControlPing controlPing) throws io.fd.vpp.jvpp.VppInvocationException {
return registry.controlPing(JVpp${plugin_name}Impl.class);
}
@@ -133,27 +133,27 @@ $methods
}
""")
-method_template = Template(""" int $name($plugin_package.$dto_package.$request request) throws org.openvpp.jvpp.VppInvocationException;""")
+method_template = Template(""" int $name($plugin_package.$dto_package.$request request) throws io.fd.vpp.jvpp.VppInvocationException;""")
method_native_template = Template(
""" private static native int ${name}0($plugin_package.$dto_package.$request request);""")
-method_impl_template = Template(""" public final int $name($plugin_package.$dto_package.$request request) throws org.openvpp.jvpp.VppInvocationException {
+method_impl_template = Template(""" public final int $name($plugin_package.$dto_package.$request request) throws io.fd.vpp.jvpp.VppInvocationException {
java.util.Objects.requireNonNull(request,"Null request object");
connection.checkActive();
int result=${name}0(request);
if(result<0){
- throw new org.openvpp.jvpp.VppInvocationException("${name}",result);
+ throw new io.fd.vpp.jvpp.VppInvocationException("${name}",result);
}
return result;
}
""")
-no_arg_method_template = Template(""" int $name() throws org.openvpp.jvpp.VppInvocationException;""")
-no_arg_method_native_template = Template(""" private static native int ${name}0() throws org.openvpp.jvpp.VppInvocationException;""")
-no_arg_method_impl_template = Template(""" public final int $name() throws org.openvpp.jvpp.VppInvocationException {
+no_arg_method_template = Template(""" int $name() throws io.fd.vpp.jvpp.VppInvocationException;""")
+no_arg_method_native_template = Template(""" private static native int ${name}0() throws io.fd.vpp.jvpp.VppInvocationException;""")
+no_arg_method_impl_template = Template(""" public final int $name() throws io.fd.vpp.jvpp.VppInvocationException {
connection.checkActive();
int result=${name}0();
if(result<0){
- throw new org.openvpp.jvpp.VppInvocationException("${name}",result);
+ throw new io.fd.vpp.jvpp.VppInvocationException("${name}",result);
}
return result;
}