24 #define DEBUG_LOG(...) clib_warning(__VA_ARGS__) 26 #define DEBUG_LOG(...) 33 jclass callbackClass, jobject callbackObject,
34 jclass callbackExceptionClass) {
35 DEBUG_LOG(
"\nCallOnError : callback=%s, retval=%d, context=%d\n", callName,
36 clib_net_to_host_u32(retval), clib_net_to_host_u32(context));
39 DEBUG_LOG(
"CallOnError : jm->callbackClass is null!\n");
42 jmethodID excConstructor = (*env)->GetMethodID(env, callbackExceptionClass,
43 "<init>",
"(Ljava/lang/String;II)V");
44 if (!excConstructor) {
45 DEBUG_LOG(
"CallOnError : excConstructor is null!\n");
48 jmethodID callbackExcMethod = (*env)->GetMethodID(env, callbackClass,
49 "onError",
"(Lio/fd/vpp/jvpp/VppCallbackException;)V");
50 if (!callbackExcMethod) {
51 DEBUG_LOG(
"CallOnError : callbackExcMethod is null!\n");
55 jobject excObject = (*env)->NewObject(env, callbackExceptionClass,
56 excConstructor, (*env)->NewStringUTF(env, callName),
57 clib_net_to_host_u32(contextId), clib_net_to_host_u32(retval));
59 DEBUG_LOG(
"CallOnError : excObject is null!\n");
63 (*env)->CallVoidMethod(env, callbackObject, callbackExcMethod, excObject);
64 DEBUG_LOG(
"CallOnError : Response sent\n");
void call_on_error(const char *callName, int contextId, int retval, jclass callbackClass, jobject callbackObject, jclass callbackExceptionClass)
Calls onError callback on callbackObject reference.