26#include "org_direct_bt_DBGattDesc.h"
27#include "org_direct_bt_DBGattChar.h"
28#include "org_direct_bt_DBGattService.h"
29#include "org_direct_bt_DBGattServer.h"
30#include "org_direct_bt_DBGattServer_Listener.h"
57 jbyteArray jval = env_->NewByteArray( (jsize) value.
size() );
58 env_->SetByteArrayRegion(jval, 0, (jsize) value.
size(), (
const jbyte*)(value.
get_ptr()));
61 jobject jDBGattValue = env_->NewObject(clazz, clazz_ctor, jval, (jint)value.
capacity(), valueHolder->hasVariableLength());
64 env_->DeleteLocalRef(jval);
71 jbyteArray jval = env_->NewByteArray( (jsize) value.
size() );
72 env_->SetByteArrayRegion(jval, 0, (jsize) value.
size(), (
const jbyte*)(value.
get_ptr()));
75 jobject jDBGattValue = env_->NewObject(clazz, clazz_ctor, jval, (jint)value.
capacity(), valueHolder->hasVariableLength());
78 env_->DeleteLocalRef(jval);
104 if(
nullptr == jsource ) {
108 const jau::nsize_t source_len0 = env->GetArrayLength(jsource);
113 if( 0 < source_len0 && 0 < source_len1 && source_pos1 + source_len1 <= source_len0 ) {
115 const uint8_t * source = criticalArray.
get(jsource, criticalArray.Mode::NO_UPDATE_AND_RELEASE);
116 if(
nullptr == source ) {
119 return ref->setValue(source+source_pos1, source_len1, dest_pos) ? JNI_TRUE : JNI_FALSE;
135 jbyteArray jvalue_, jint jcapacity_, jboolean jvariable_length_) {
137 if(
nullptr == jvalue_ ) {
144 if( 0 < value.
size() ) {
146 const uint8_t * value_ptr = criticalArray.
get(jvalue_, criticalArray.Mode::NO_UPDATE_AND_RELEASE);
147 if(
nullptr == value_ptr ) {
160 ref->setJavaObject( std::make_shared<JavaGlobalObj>( std::move(global_obj),
nullptr ) );
161 JavaGlobalObj::check(ref->getJavaObject(),
E_FILE_LINE);
167 return (jlong) (intptr_t)
nullptr;
174 if(
nullptr != sref.
pointer() ) {
178 sref->setJavaObject();
180 std::shared_ptr<DBGattDesc>* sref_ptr = castInstance<DBGattDesc>(nativeInstance);
192 return (jshort)( ref->getHandle() );
242 if(
nullptr == jsource ) {
246 const jau::nsize_t source_len0 = env->GetArrayLength(jsource);
251 if( 0 < source_len0 && 0 < source_len1 && source_pos1 + source_len1 <= source_len0 ) {
253 const uint8_t * source = criticalArray.
get(jsource, criticalArray.Mode::NO_UPDATE_AND_RELEASE);
254 if(
nullptr == source ) {
257 return ref->setValue(source+source_pos1, source_len1, dest_pos) ? JNI_TRUE : JNI_FALSE;
274 jbyte jproperties, jlongArray jDescriptors,
275 jbyteArray jvalue_, jint jcapacity_, jboolean jvariable_length_) {
277 if(
nullptr == jvalue_ ) {
280 if(
nullptr == jDescriptors ) {
287 if( 0 < value.
size() ) {
289 const uint8_t * value_ptr = criticalArray.
get(jvalue_, criticalArray.Mode::NO_UPDATE_AND_RELEASE);
290 if(
nullptr == value_ptr ) {
301 jlong * jlong_desc_ref_array = criticalArray.
get(jDescriptors, criticalArray.Mode::NO_UPDATE_AND_RELEASE);
302 if(
nullptr == jlong_desc_ref_array ) {
306 std::shared_ptr<DBGattDesc> desc_ref = *( (std::shared_ptr<DBGattDesc> *) (intptr_t) jlong_desc_ref_array[i] );
320 std::move(descriptors),
321 std::move(value), JNI_TRUE == jvariable_length_) );
323 ref->setJavaObject( std::make_shared<JavaGlobalObj>( std::move(global_obj),
nullptr ) );
324 JavaGlobalObj::check(ref->getJavaObject(),
E_FILE_LINE);
330 return (jlong) (intptr_t)
nullptr;
337 if(
nullptr != sref.
pointer() ) {
341 sref->setJavaObject();
343 std::shared_ptr<BTGattChar>* sref_ptr = castInstance<BTGattChar>(nativeInstance);
355 return (jshort)( ref->getHandle() );
366 return (jshort)( ref->getEndHandle() );
377 return (jshort)( ref->getValueHandle() );
416 jboolean jprimary, jstring jtype_,
417 jlongArray jCharacteristics) {
419 if(
nullptr == jCharacteristics ) {
429 jlong * jlong_char_ref_array = criticalArray.
get(jCharacteristics, criticalArray.Mode::NO_UPDATE_AND_RELEASE);
430 if(
nullptr == jlong_char_ref_array ) {
434 std::shared_ptr<DBGattChar> char_ref = *( (std::shared_ptr<DBGattChar> *) (intptr_t) jlong_char_ref_array[i] );
446 ref->setJavaObject( std::make_shared<JavaGlobalObj>( std::move(global_obj),
nullptr ) );
447 JavaGlobalObj::check(ref->getJavaObject(),
E_FILE_LINE);
453 return (jlong) (intptr_t)
nullptr;
460 if(
nullptr != sref.
pointer() ) {
464 sref->setJavaObject();
466 std::shared_ptr<DBGattService>* sref_ptr = castInstance<DBGattService>(nativeInstance);
478 return (jshort)( ref->getHandle() );
489 return (jshort)( ref->getEndHandle() );
517 jlongArray jService) {
519 if(
nullptr == jService ) {
529 jlong * jlong_service_ref_array = criticalArray.
get(jService, criticalArray.Mode::NO_UPDATE_AND_RELEASE);
530 if(
nullptr == jlong_service_ref_array ) {
534 std::shared_ptr<DBGattService> service_ref = *( (std::shared_ptr<DBGattService> *) (intptr_t) jlong_service_ref_array[i] );
542 ref->setJavaObject( std::make_shared<JavaGlobalObj>( std::move(global_obj),
nullptr ) );
543 JavaGlobalObj::check(ref->getJavaObject(),
E_FILE_LINE);
549 return (jlong) (intptr_t)
nullptr;
556 if(
nullptr != sref.
pointer() ) {
560 sref->setJavaObject();
562 std::shared_ptr<DBGattServer>* sref_ptr = castInstance<DBGattServer>(nativeInstance);
574 return (jint)( ref->getMaxAttMTU() );
585 ref->setMaxAttMTU(v);
611 jmethodID mConnected =
nullptr;
612 jmethodID mDisconnected =
nullptr;
613 jmethodID mMtuChanged =
nullptr;
614 jmethodID mReadCharValue =
nullptr;
615 jmethodID mReadDescValue =
nullptr;
616 jmethodID mWriteCharValue =
nullptr;
617 jmethodID mWriteCharValueDone =
nullptr;
618 jmethodID mWriteDescValue =
nullptr;
619 jmethodID mWriteDescValueDone =
nullptr;
620 jmethodID mCCDChanged =
nullptr;
624 : listenerObjRef(obj, nullptr)
626 mConnected =
search_method(env, clazz,
"connected",
"(Lorg/direct_bt/BTDevice;I)V",
false);
627 mDisconnected =
search_method(env, clazz,
"disconnected",
"(Lorg/direct_bt/BTDevice;)V",
false);
628 mMtuChanged =
search_method(env, clazz,
"mtuChanged",
"(Lorg/direct_bt/BTDevice;I)V",
false);
629 mReadCharValue =
search_method(env, clazz,
"readCharValue",
"(Lorg/direct_bt/BTDevice;Lorg/direct_bt/DBGattService;Lorg/direct_bt/DBGattChar;)Z",
false);
630 mReadDescValue =
search_method(env, clazz,
"readDescValue",
"(Lorg/direct_bt/BTDevice;Lorg/direct_bt/DBGattService;Lorg/direct_bt/DBGattChar;Lorg/direct_bt/DBGattDesc;)Z",
false);
631 mWriteCharValue =
search_method(env, clazz,
"writeCharValue",
"(Lorg/direct_bt/BTDevice;Lorg/direct_bt/DBGattService;Lorg/direct_bt/DBGattChar;[BI)Z",
false);
632 mWriteCharValueDone =
search_method(env, clazz,
"writeCharValueDone",
"(Lorg/direct_bt/BTDevice;Lorg/direct_bt/DBGattService;Lorg/direct_bt/DBGattChar;)V",
false);
633 mWriteDescValue =
search_method(env, clazz,
"writeDescValue",
"(Lorg/direct_bt/BTDevice;Lorg/direct_bt/DBGattService;Lorg/direct_bt/DBGattChar;Lorg/direct_bt/DBGattDesc;[BI)Z",
false);
634 mWriteDescValueDone =
search_method(env, clazz,
"writeDescValueDone",
"(Lorg/direct_bt/BTDevice;Lorg/direct_bt/DBGattService;Lorg/direct_bt/DBGattChar;Lorg/direct_bt/DBGattDesc;)V",
false);
635 mCCDChanged =
search_method(env, clazz,
"clientCharConfigChanged",
"(Lorg/direct_bt/BTDevice;Lorg/direct_bt/DBGattService;Lorg/direct_bt/DBGattChar;Lorg/direct_bt/DBGattDesc;ZZ)V",
false);
641 jobject j_device = JavaGlobalObj::checkAndGetObject(device->getJavaObject(),
E_FILE_LINE);
644 env->CallVoidMethod(listenerObjRef.
getObject(), mConnected, j_device, (jint)initialMTU);
649 jobject j_device = JavaGlobalObj::checkAndGetObject(device->getJavaObject(),
E_FILE_LINE);
652 env->CallVoidMethod(listenerObjRef.
getObject(), mDisconnected, j_device);
657 jobject j_device = JavaGlobalObj::checkAndGetObject(device->getJavaObject(),
E_FILE_LINE);
660 env->CallVoidMethod(listenerObjRef.
getObject(), mMtuChanged, j_device, (jint)mtu);
665 jobject j_device = JavaGlobalObj::checkAndGetObject(device->getJavaObject(),
E_FILE_LINE);
666 jobject j_s = JavaGlobalObj::checkAndGetObject(s->getJavaObject(),
E_FILE_LINE);
667 jobject j_c = JavaGlobalObj::checkAndGetObject(c->getJavaObject(),
E_FILE_LINE);
670 jboolean res = env->CallBooleanMethod(listenerObjRef.
getObject(), mReadCharValue, j_device, j_s, j_c);
672 return JNI_TRUE == res;
676 jobject j_device = JavaGlobalObj::checkAndGetObject(device->getJavaObject(),
E_FILE_LINE);
677 jobject j_s = JavaGlobalObj::checkAndGetObject(s->getJavaObject(),
E_FILE_LINE);
678 jobject j_c = JavaGlobalObj::checkAndGetObject(c->getJavaObject(),
E_FILE_LINE);
679 jobject j_d = JavaGlobalObj::checkAndGetObject(d->getJavaObject(),
E_FILE_LINE);
682 jboolean res = env->CallBooleanMethod(listenerObjRef.
getObject(), mReadDescValue, j_device, j_s, j_c, j_d);
684 return JNI_TRUE == res;
688 jobject j_device = JavaGlobalObj::checkAndGetObject(device->getJavaObject(),
E_FILE_LINE);
689 jobject j_s = JavaGlobalObj::checkAndGetObject(s->getJavaObject(),
E_FILE_LINE);
690 jobject j_c = JavaGlobalObj::checkAndGetObject(c->getJavaObject(),
E_FILE_LINE);
693 const size_t value_size = value.
size();
694 jbyteArray j_value = env->NewByteArray((jsize)value_size);
695 env->SetByteArrayRegion(j_value, 0, (jsize)value_size, (
const jbyte *)value.
get_ptr());
698 jboolean res = env->CallBooleanMethod(listenerObjRef.
getObject(), mWriteCharValue, j_device, j_s, j_c, j_value, (jint)value_offset);
700 env->DeleteLocalRef(j_value);
701 return JNI_TRUE == res;
704 jobject j_device = JavaGlobalObj::checkAndGetObject(device->getJavaObject(),
E_FILE_LINE);
705 jobject j_s = JavaGlobalObj::checkAndGetObject(s->getJavaObject(),
E_FILE_LINE);
706 jobject j_c = JavaGlobalObj::checkAndGetObject(c->getJavaObject(),
E_FILE_LINE);
709 env->CallVoidMethod(listenerObjRef.
getObject(), mWriteCharValueDone, j_device, j_s, j_c);
714 jobject j_device = JavaGlobalObj::checkAndGetObject(device->getJavaObject(),
E_FILE_LINE);
715 jobject j_s = JavaGlobalObj::checkAndGetObject(s->getJavaObject(),
E_FILE_LINE);
716 jobject j_c = JavaGlobalObj::checkAndGetObject(c->getJavaObject(),
E_FILE_LINE);
717 jobject j_d = JavaGlobalObj::checkAndGetObject(d->getJavaObject(),
E_FILE_LINE);
720 const size_t value_size = value.
size();
721 jbyteArray j_value = env->NewByteArray((jsize)value_size);
722 env->SetByteArrayRegion(j_value, 0, (jsize)value_size, (
const jbyte *)value.
get_ptr());
725 jboolean res = env->CallBooleanMethod(listenerObjRef.
getObject(), mWriteDescValue, j_device, j_s, j_c, j_d, j_value, (jint)value_offset);
727 env->DeleteLocalRef(j_value);
728 return JNI_TRUE == res;
731 jobject j_device = JavaGlobalObj::checkAndGetObject(device->getJavaObject(),
E_FILE_LINE);
732 jobject j_s = JavaGlobalObj::checkAndGetObject(s->getJavaObject(),
E_FILE_LINE);
733 jobject j_c = JavaGlobalObj::checkAndGetObject(c->getJavaObject(),
E_FILE_LINE);
734 jobject j_d = JavaGlobalObj::checkAndGetObject(d->getJavaObject(),
E_FILE_LINE);
737 env->CallVoidMethod(listenerObjRef.
getObject(), mWriteDescValueDone, j_device, j_s, j_c, j_d);
742 jobject j_device = JavaGlobalObj::checkAndGetObject(device->getJavaObject(),
E_FILE_LINE);
743 jobject j_s = JavaGlobalObj::checkAndGetObject(s->getJavaObject(),
E_FILE_LINE);
744 jobject j_c = JavaGlobalObj::checkAndGetObject(c->getJavaObject(),
E_FILE_LINE);
745 jobject j_d = JavaGlobalObj::checkAndGetObject(d->getJavaObject(),
E_FILE_LINE);
748 env->CallVoidMethod(listenerObjRef.
getObject(), mCCDChanged, j_device, j_s, j_c, j_d,
749 notificationEnabled? JNI_TRUE : JNI_FALSE, indicationEnabled? JNI_TRUE : JNI_FALSE);
764 bool res = ref->addListener(listener_ref.
shared_ptr());
765 return res ? JNI_TRUE : JNI_FALSE;
781 bool res = ref->removeListener(listener_ref.
shared_ptr());
782 return res ? JNI_TRUE : JNI_FALSE;
799 env->DeleteLocalRef(clazz);
805 return (jlong) (intptr_t)
nullptr;
817 if(
nullptr != sref.
pointer() ) {
818 std::shared_ptr<JNIDBGattServerListener>* sref_ptr = castInstance<JNIDBGattServerListener>(nativeInstance);
jobject Java_org_direct_1bt_DBGattDesc_getValue(JNIEnv *env, jobject obj)
DBGattDesc.
jshort Java_org_direct_1bt_DBGattService_getEndHandle(JNIEnv *env, jobject obj)
jint Java_org_direct_1bt_DBGattServer_getMaxAttMTU(JNIEnv *env, jobject obj)
void Java_org_direct_1bt_DBGattServer_setMaxAttMTU(JNIEnv *env, jobject obj, jint v)
jboolean Java_org_direct_1bt_DBGattServer_addListenerImpl(JNIEnv *env, jobject obj, jobject jlistener)
jlong Java_org_direct_1bt_DBGattChar_ctorImpl(JNIEnv *env, jobject obj, jstring jtype_, jbyte jproperties, jlongArray jDescriptors, jbyteArray jvalue_, jint jcapacity_, jboolean jvariable_length_)
private native long ctorImpl(final String type, final byte properties,...
void Java_org_direct_1bt_DBGattServer_00024Listener_dtorImpl(JNIEnv *env, jclass clazz, jlong nativeInstance)
jstring Java_org_direct_1bt_DBGattServer_toString(JNIEnv *env, jobject obj)
static const std::string _dbGattValueClazzName("org/direct_bt/DBGattValue")
DBGattValue.
static const std::string _dbGattValueClazzCtorArgs("([BIZ)V")
jboolean Java_org_direct_1bt_DBGattChar_setValue(JNIEnv *env, jobject obj, jbyteArray jsource, jint jsource_pos, jint jsource_len, jint jdest_pos)
jshort Java_org_direct_1bt_DBGattDesc_getHandle(JNIEnv *env, jobject obj)
jlong Java_org_direct_1bt_DBGattServer_ctorImpl(JNIEnv *env, jobject obj, jint jmax_att_mtu, jlongArray jService)
DBGattServer.
jboolean Java_org_direct_1bt_DBGattDesc_setValue(JNIEnv *env, jobject obj, jbyteArray jsource, jint jsource_pos, jint jsource_len, jint jdest_pos)
jstring Java_org_direct_1bt_DBGattChar_toString(JNIEnv *env, jobject obj)
jshort Java_org_direct_1bt_DBGattChar_getHandle(JNIEnv *env, jobject obj)
void Java_org_direct_1bt_DBGattChar_bzero(JNIEnv *env, jobject obj)
void Java_org_direct_1bt_DBGattDesc_bzero(JNIEnv *env, jobject obj)
jstring Java_org_direct_1bt_DBGattDesc_toString(JNIEnv *env, jobject obj)
jlong Java_org_direct_1bt_DBGattDesc_ctorImpl(JNIEnv *env, jobject obj, jstring jtype_, jbyteArray jvalue_, jint jcapacity_, jboolean jvariable_length_)
private native long ctorImpl(final String type, final byte[] value,...
jobject Java_org_direct_1bt_DBGattChar_getValue(JNIEnv *env, jobject obj)
DBGattChar.
static jobject _createDBGattValueFromChar(JNIEnv *env_, jclass clazz, jmethodID clazz_ctor, const DBGattCharRef &valueHolder)
jlong Java_org_direct_1bt_DBGattService_ctorImpl(JNIEnv *env, jobject obj, jboolean jprimary, jstring jtype_, jlongArray jCharacteristics)
DBGattService.
jlong Java_org_direct_1bt_DBGattServer_00024Listener_ctorImpl(JNIEnv *env, jobject obj)
jshort Java_org_direct_1bt_DBGattChar_getEndHandle(JNIEnv *env, jobject obj)
jstring Java_org_direct_1bt_DBGattService_toString(JNIEnv *env, jobject obj)
void Java_org_direct_1bt_DBGattServer_dtorImpl(JNIEnv *env, jclass clazz, jlong nativeInstance)
jshort Java_org_direct_1bt_DBGattService_getHandle(JNIEnv *env, jobject obj)
jboolean Java_org_direct_1bt_DBGattServer_removeListenerImpl(JNIEnv *env, jobject obj, jobject jlistener)
jshort Java_org_direct_1bt_DBGattChar_getValueHandle(JNIEnv *env, jobject obj)
void Java_org_direct_1bt_DBGattService_dtorImpl(JNIEnv *env, jclass clazz, jlong nativeInstance)
void Java_org_direct_1bt_DBGattChar_dtorImpl(JNIEnv *env, jclass clazz, jlong nativeInstance)
void Java_org_direct_1bt_DBGattDesc_dtorImpl(JNIEnv *env, jclass clazz, jlong nativeInstance)
static jobject _createDBGattValueFromDesc(JNIEnv *env_, jclass clazz, jmethodID clazz_ctor, const DBGattDescRef &valueHolder)
DBGattServer.Listener and related DBGattServer methods.
void connected(const BTDeviceRef &device, const uint16_t initialMTU) override
Notification that device got connected.
JNIDBGattServerListener(JNIEnv *env, jclass clazz, jobject obj)
void mtuChanged(const BTDeviceRef &device, const uint16_t mtu) override
Notification that the MTU has changed.
void writeCharValueDone(const BTDeviceRef &device, const DBGattServiceRef &s, const DBGattCharRef &c) override
Notifies completion of single or bulk writeCharValue() after having accepted and performed all write ...
bool writeDescValue(const BTDeviceRef &device, const DBGattServiceRef &s, const DBGattCharRef &c, const DBGattDescRef &d, const jau::TROOctets &value, const uint16_t value_offset) override
Signals attempt to write a single or bulk (prepare) value.
void writeDescValueDone(const BTDeviceRef &device, const DBGattServiceRef &s, const DBGattCharRef &c, const DBGattDescRef &d) override
Notifies completion of single or bulk writeCharValue() after having accepted and performed all write ...
~JNIDBGattServerListener() noexcept override=default
void clientCharConfigChanged(const BTDeviceRef &device, const DBGattServiceRef &s, const DBGattCharRef &c, const DBGattDescRef &d, const bool notificationEnabled, const bool indicationEnabled) override
Notifies a change of the Client Characteristic Configuration Descriptor (CCCD) value.
bool writeCharValue(const BTDeviceRef &device, const DBGattServiceRef &s, const DBGattCharRef &c, const jau::TROOctets &value, const uint16_t value_offset) override
Signals attempt to write a single or bulk (prepare) value.
bool readCharValue(const BTDeviceRef &device, const DBGattServiceRef &s, const DBGattCharRef &c) override
Signals attempt to read a value.
void disconnected(const BTDeviceRef &device) override
Notification that device got disconnected.
bool readDescValue(const BTDeviceRef &device, const DBGattServiceRef &s, const DBGattCharRef &c, const DBGattDescRef &d) override
Signals attempt to read a value.
PropertyBitVal
BT Core Spec v5.2: Vol 3, Part G GATT: 3.3.1.1 Characteristic Properties.
Representing a Gatt Characteristic object from the GATTRole::Server perspective.
Representing a Gatt Characteristic Descriptor object from the GATTRole::Server perspective.
Listener to remote master device's operations on the local GATT-Server.
Representing a complete list of Gatt Service objects from the GATTRole::Server perspective,...
Representing a Gatt Service object from the GATTRole::Server perspective.
Persistent endian aware octet data, i.e.
constexpr nsize_t capacity() const noexcept
Returns the memory capacity, never zero, greater or equal size().
void put_bytes_nc(const nsize_t i, const uint8_t *source, const nsize_t byte_count) noexcept
Transient read only and endian aware octet data, i.e.
constexpr nsize_t size() const noexcept
Returns the used memory size for read and write operations, may be zero.
constexpr uint8_t const * get_ptr() const noexcept
constexpr size_type capacity() const noexcept
Return the current capacity.
constexpr void push_back(const value_type &x)
Like std::vector::push_back(), copy.
T * get(U jarray_val, Mode mode_val=UPDATE_AND_RELEASE)
Acquired the primitive array.
Implementation for JavaAnon, by simply wrapping a JNIGlobalRef instance.
jobject getObject() const noexcept
A std::shared_ptr<T> storage instance to be copied from and released into a java object's long native...
bool is_null() const noexcept
Returns true if either this instances shared_ptr<T> storage or the managed object reference is nullpt...
const std::shared_ptr< T > & shared_ptr() const
Provides access to const reference of shared_ptr<T>, r-value.
std::shared_ptr< T > * pointer() noexcept
Provides access to the shared_ptr<T> pointer, l-value of storage.
std::string toString() const noexcept
jlong release_to_jlong() noexcept
Release ownership and return the jlong representation of the shared_ptr<T> storage.
static std::unique_ptr< uuid_t > create(TypeSize const t, uint8_t const *const buffer, lb_endian_t const le_or_be)
@ little
Identifier for little endian, equivalent to endian::little.
std::shared_ptr< BTDevice > BTDeviceRef
std::shared_ptr< DBGattDesc > DBGattDescRef
std::shared_ptr< DBGattService > DBGattServiceRef
std::shared_ptr< DBGattChar > DBGattCharRef
uint_fast32_t nsize_t
Natural 'size_t' alternative using uint_fast32_t as its natural sized type.
void java_exception_check_and_throw(JNIEnv *env, const char *file, int line)
Throws a C++ exception if a java exception occurred, otherwise do nothing.
thread_local JNIEnvContainer jni_env
jstring from_string_to_jstring(JNIEnv *env, const std::string &str)
jmethodID search_method(JNIEnv *env, jclass clazz, const char *method_name, const char *prototype, bool is_static)
std::shared_ptr< JavaAnon > JavaAnonRef
std::string from_jstring_to_string(JNIEnv *env, jstring str)
jclass search_class(JNIEnv *env, const char *clazz_name)
#define rethrow_and_raise_java_exception(E)
Re-throw current exception and raise respective java exception using any matching function above.