29 #include <osl/diagnose.h>
31 #include <rtl/alloc.h>
32 #include <rtl/ustring.hxx>
35 #include <uno/environment.h>
36 #include <typelib/typedescription.h>
49 : m_message( message )
66 JNI_info const * jni_info, JNIEnv * env, jobject class_loader )
67 : m_jni_info( jni_info ),
69 m_class_loader( class_loader )
82 void getClassForName(jclass * classClass, jmethodID * methodForName)
const;
87 char const *
name, jclass classClass, jmethodID methodForName,
88 bool inException)
const;
98 if (
m_env->ExceptionCheck())
106 if (
m_env->ExceptionCheck())
108 SAL_WARN(
"bridges",
"unexpected java exception occurred");
109 #if OSL_DEBUG_LEVEL > 0
110 m_env->ExceptionDescribe();
112 m_env->ExceptionClear();
133 static_cast< jobject >(vm_access->getClassLoader()) )
158 {
return (
nullptr != m_jo); }
160 inline void reset( jobject jo );
171 : m_jni( auto_ref.m_jni ),
172 m_jo( auto_ref.m_jo )
174 auto_ref.
m_jo =
nullptr;
198 auto_ref.
m_jo =
nullptr;
206 static void *
operator new (
size_t nSize )
207 {
return std::malloc( nSize ); }
208 static void operator delete (
void * mem )
209 { std::free( mem ); }
210 static void *
operator new ( size_t,
void * mem )
212 static void operator delete (
void *,
void * )
220 void *
p = std::malloc( bytes );
235 inline explicit TypeDescr( typelib_TypeDescriptionReference * td_ref );
237 { TYPELIB_DANGER_RELEASE( m_td ); }
246 TYPELIB_DANGER_GET( &
m_td, td_ref );
250 "cannot get comprehensive type description for " +
251 OUString::unacquired( &td_ref->pTypeName ) );
BridgeRuntimeError(OUString const &message)
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
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
AttachGuard(rtl::Reference< VirtualMachine > const &rMachine)
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
JNIEnv * operator->() const
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