21#include <com/sun/star/uno/XComponentContext.hpp>
24#ifdef HAVE_64BIT_POINTERS
25#error "no 64 bit pointer"
82 void saveRef( JNIEnv * pEnv, jobject myObj );
89 static void ThrowSQLException(JNIEnv * pEnv,
const css::uno::Reference< css::uno::XInterface> & _rContext);
91 const ::comphelper::EventLogger& _rLogger,
93 const css::uno::Reference< css::uno::XInterface >& _rxContext
95 static void ThrowRuntimeException(JNIEnv * pEnv,
const css::uno::Reference< css::uno::XInterface> & _rContext);
97 static ::rtl::Reference< jvmaccess::VirtualMachine >
getVM(
const css::uno::Reference< css::uno::XComponentContext >& _rxContext=
nullptr);
100 void obtainMethodId_throwSQL(JNIEnv* _pEnv,
const char* _pMethodName,
const char* _pSignature, jmethodID& _inout_MethodID)
const;
101 void obtainMethodId_throwRuntime(JNIEnv* _pEnv,
const char* _pMethodName,
const char* _pSignature, jmethodID& _inout_MethodID)
const;
103 bool callBooleanMethod(
const char* _pMethodName, jmethodID& _inout_MethodID )
const;
105 jobject
callResultSetMethod( JNIEnv& _rEnv,
const char* _pMethodName, jmethodID& _inout_MethodID )
const;
110 sal_Int32
callIntMethodWithStringArg(
const char* _pMethodName, jmethodID& _inout_MethodID,
const OUString& _nArgument )
const;
111 OUString
callStringMethod(
const char* _pMethodName, jmethodID& _inout_MethodID )
const;
120 jobject
callObjectMethod( JNIEnv * pEnv,
const char* _pMethodName,
const char* _pSignature, jmethodID& _inout_MethodID )
const;
121 jobject
callObjectMethodWithIntArg( JNIEnv * pEnv,
const char* _pMethodName,
const char* _pSignature, jmethodID& _inout_MethodID , sal_Int32 _nArgument)
const;
123 template<
typename T >
124 T
callMethodWithIntArg(T (JNIEnv::*pCallMethod)( jobject obj, jmethodID methodID, ... ) ,
const char* _pMethodName,
const char* _pSignature, jmethodID& _inout_MethodID , sal_Int32 _nArgument)
const
128 T out = (
t.pEnv->*pCallMethod)(
object, _inout_MethodID,_nArgument);
133 template<
typename T >
134 void callVoidMethod_ThrowSQL(
const char* _pMethodName,
const char* _pSignature, jmethodID& _inout_MethodID,sal_Int32 _nArgument,
const T& _aValue)
const
138 t.pEnv->CallVoidMethod(
object, _inout_MethodID,_nArgument,_aValue);
jvmaccess::VirtualMachine::AttachGuard m_aGuard
SDBThreadAttach(SDBThreadAttach const &)=delete
SDBThreadAttach & operator=(SDBThreadAttach const &)=delete
jobject callObjectMethod(JNIEnv *pEnv, const char *_pMethodName, const char *_pSignature, jmethodID &_inout_MethodID) const
jobject callResultSetMethod(JNIEnv &_rEnv, const char *_pMethodName, jmethodID &_inout_MethodID) const
virtual ~java_lang_Object() COVERITY_NOEXCEPT_FALSE
sal_Int32 callIntMethod_ThrowSQL(const char *_pMethodName, jmethodID &_inout_MethodID) const
virtual jclass getMyClass() const
bool callBooleanMethod(const char *_pMethodName, jmethodID &_inout_MethodID) const
OUString toString() const
sal_Int32 callIntMethodWithStringArg(const char *_pMethodName, jmethodID &_inout_MethodID, const OUString &_nArgument) const
java_lang_Object(java_lang_Object const &)=delete
static ::rtl::Reference< jvmaccess::VirtualMachine > getVM(const css::uno::Reference< css::uno::XComponentContext > &_rxContext=nullptr)
void callVoidMethod_ThrowSQL(const char *_pMethodName, const char *_pSignature, jmethodID &_inout_MethodID, sal_Int32 _nArgument, const T &_aValue) const
void callVoidMethodWithStringArg(const char *_pMethodName, jmethodID &_inout_MethodID, const OUString &_nArgument) const
void callVoidMethod_ThrowSQL(const char *_pMethodName, jmethodID &_inout_MethodID) const
sal_Int32 callIntMethodWithIntArg_ThrowSQL(const char *_pMethodName, jmethodID &_inout_MethodID, sal_Int32 _nArgument) const
void callVoidMethodWithIntArg_ThrowSQL(const char *_pMethodName, jmethodID &_inout_MethodID, sal_Int32 _nArgument) const
void saveRef(JNIEnv *pEnv, jobject myObj)
void callVoidMethodWithBoolArg_ThrowRuntime(const char *_pMethodName, jmethodID &_inout_MethodID, bool _nArgument) const
void callVoidMethodWithIntArg_ThrowRuntime(const char *_pMethodName, jmethodID &_inout_MethodID, sal_Int32 _nArgument) const
T callMethodWithIntArg(T(JNIEnv::*pCallMethod)(jobject obj, jmethodID methodID,...), const char *_pMethodName, const char *_pSignature, jmethodID &_inout_MethodID, sal_Int32 _nArgument) const
OUString callStringMethod(const char *_pMethodName, jmethodID &_inout_MethodID) const
jobject callObjectMethodWithIntArg(JNIEnv *pEnv, const char *_pMethodName, const char *_pSignature, jmethodID &_inout_MethodID, sal_Int32 _nArgument) const
bool callBooleanMethodWithIntArg(const char *_pMethodName, jmethodID &_inout_MethodID, sal_Int32 _nArgument) const
OUString callStringMethodWithIntArg(const char *_pMethodName, jmethodID &_inout_MethodID, sal_Int32 _nArgument) const
static void ThrowSQLException(JNIEnv *pEnv, const css::uno::Reference< css::uno::XInterface > &_rContext)
sal_Int32 callIntMethod_ThrowRuntime(const char *_pMethodName, jmethodID &_inout_MethodID) const
static void ThrowLoggedSQLException(const ::comphelper::EventLogger &_rLogger, JNIEnv *pEnvironment, const css::uno::Reference< css::uno::XInterface > &_rxContext)
jobject getJavaObject() const
static jclass findMyClass(const char *_pClassName)
void obtainMethodId_throwRuntime(JNIEnv *_pEnv, const char *_pMethodName, const char *_pSignature, jmethodID &_inout_MethodID) const
static void ThrowRuntimeException(JNIEnv *pEnv, const css::uno::Reference< css::uno::XInterface > &_rContext)
java_lang_Object & operator=(java_lang_Object const &)=delete
void callVoidMethod_ThrowRuntime(const char *_pMethodName, jmethodID &_inout_MethodID) const
void callVoidMethodWithBoolArg_ThrowSQL(const char *_pMethodName, jmethodID &_inout_MethodID, bool _nArgument) const
sal_Int32 callIntMethodWithIntArg_ThrowRuntime(const char *_pMethodName, jmethodID &_inout_MethodID, sal_Int32 _nArgument) const
void obtainMethodId_throwSQL(JNIEnv *_pEnv, const char *_pMethodName, const char *_pSignature, jmethodID &_inout_MethodID) const