29#include <osl/diagnose.h>
32#include <rtl/ustring.hxx>
36#include <uno/environment.h>
37#include <typelib/typedescription.h>
67 JNI_info const * jni_info, JNIEnv * env, jobject 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 ) );
JNI_context const & m_jni
JLocalAutoRef(JNI_context const &jni, jobject jo)
JLocalAutoRef(JNI_context const &jni)
JLocalAutoRef & operator=(JLocalAutoRef &auto_ref)
JNI_context(JNI_context const &)=delete
jclass findClass(char const *name, jclass classClass, jmethodID methodForName, bool inException) const
bool assert_no_exception() const
JNI_info const * m_jni_info
OUString get_stack_trace(jobject jo_exc=nullptr) const
JNI_info const * get_info() const
void java_exc_occurred() const
JNIEnv * operator->() const
void ensure_no_exception() const
JNI_context & operator=(JNI_context const &)=delete
JNI_context(JNI_info const *jni_info, JNIEnv *env, jobject class_loader)
JNIEnv * get_jni_env() const
void getClassForName(jclass *classClass, jmethodID *methodForName) const
JNI_guarded_context & operator=(JNI_guarded_context const &)=delete
JNI_guarded_context(JNI_guarded_context const &)=delete
JNI_guarded_context(JNI_info const *jni_info, rtl::Reference< jvmaccess::UnoVirtualMachine > const &vm_access)
TypeDescr & operator=(TypeDescr const &)=delete
typelib_TypeDescription * get() const
typelib_TypeDescription * m_td
TypeDescr(TypeDescr const &)=delete
JNIEnv * getEnvironment() const
AttachGuard(rtl::Reference< VirtualMachine > xMachine)
#define SAL_WARN(area, stream)
const css::uno::Reference< css::xml::crypto::XSecurityEnvironment > & env
struct _typelib_TypeDescription typelib_TypeDescription
std::vector< sal_uInt8 > bytes
BridgeRuntimeError(OUString message)
static rtl_mem * allocate(std::size_t bytes)