29 #include <osl/diagnose.h>
31 #include <rtl/alloc.h>
32 #include <rtl/ustring.hxx>
36 #include <uno/environment.h>
37 #include <typelib/typedescription.h>
50 : m_message(
std::move( message ))
67 JNI_info const * jni_info, JNIEnv * env, jobject class_loader )
68 : m_jni_info( jni_info ),
70 m_class_loader( class_loader )
83 void getClassForName(jclass * classClass, jmethodID * methodForName)
const;
88 char const *
name, jclass classClass, jmethodID methodForName,
89 bool inException)
const;
99 if (
m_env->ExceptionCheck())
107 if (
m_env->ExceptionCheck())
109 SAL_WARN(
"bridges",
"unexpected java exception occurred");
110 #if OSL_DEBUG_LEVEL > 0
111 m_env->ExceptionDescribe();
113 m_env->ExceptionClear();
134 static_cast< jobject >(vm_access->getClassLoader()) )
159 {
return (
nullptr != m_jo); }
161 inline void reset( jobject jo );
172 : m_jni( auto_ref.m_jni ),
173 m_jo( auto_ref.m_jo )
175 auto_ref.
m_jo =
nullptr;
199 auto_ref.
m_jo =
nullptr;
207 static void *
operator new (
size_t nSize )
208 {
return std::malloc( nSize ); }
209 static void operator delete (
void * mem )
210 { std::free( mem ); }
211 static void *
operator new ( size_t,
void * mem )
213 static void operator delete (
void *,
void * )
221 void *
p = std::malloc( bytes );
236 inline explicit TypeDescr( typelib_TypeDescriptionReference * td_ref );
238 { TYPELIB_DANGER_RELEASE( m_td ); }
247 TYPELIB_DANGER_GET( &
m_td, td_ref );
251 "cannot get comprehensive type description for " +
252 OUString::unacquired( &td_ref->pTypeName ) );
void java_exc_occurred() const
JNI_context(JNI_info const *jni_info, JNIEnv *env, jobject class_loader)
JNIEnv * get_jni_env() const
std::vector< sal_uInt8 > bytes
JLocalAutoRef(JNI_context const &jni, jobject jo)
JNI_context(JNI_context const &)=delete
bool assert_no_exception() const
JNI_info const * get_info() const
OUString get_stack_trace(jobject jo_exc=nullptr) const
TypeDescr(TypeDescr const &)=delete
JNI_info const * m_jni_info
void ensure_no_exception() const
JLocalAutoRef(JNI_context const &jni)
typelib_TypeDescription * m_td
JNI_guarded_context & operator=(JNI_guarded_context const &)=delete
JNI_guarded_context(JNI_guarded_context const &)=delete
jclass findClass(char const *name, jclass classClass, jmethodID methodForName, bool inException) const
JNI_guarded_context(JNI_info const *jni_info, rtl::Reference< jvmaccess::UnoVirtualMachine > const &vm_access)
JLocalAutoRef & operator=(JLocalAutoRef &auto_ref)
struct _typelib_TypeDescription typelib_TypeDescription
friend friend class AttachGuard
AttachGuard(rtl::Reference< VirtualMachine > xMachine)
JNIEnv * operator->() const
BridgeRuntimeError(OUString message)
void getClassForName(jclass *classClass, jmethodID *methodForName) const
#define SAL_WARN(area, stream)
static rtl_mem * allocate(std::size_t bytes)
JNI_context const & m_jni
TypeDescr & operator=(TypeDescr const &)=delete
JNIEnv * getEnvironment() const
JNI_context & operator=(JNI_context const &)=delete