LibreOffice Module bridges (master)  1
jni_info.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <sal/config.h>
21 
22 #include <cassert>
23 
24 #include "jni_bridge.h"
25 
26 #include <com/sun/star/uno/RuntimeException.hpp>
27 
29 #include <rtl/string.hxx>
30 #include <rtl/strbuf.hxx>
31 #include <rtl/ustrbuf.hxx>
32 
33 #include <uno/lbnames.h>
34 
35 
36 using namespace ::std;
37 using namespace ::osl;
38 
39 namespace jni_uno
40 {
41 
42 
44  JNI_context const & jni, typelib_TypeDescription * td )
45  : m_td( td ),
46  m_class( nullptr )
47 {
48  m_td.makeComplete();
49  if (! m_td.get()->bComplete)
50  {
51  throw BridgeRuntimeError(
52  "cannot make type complete: "
53  + OUString::unacquired( &m_td.get()->pTypeName )
54  + jni.get_stack_trace() );
55  }
56 }
57 
58 
59 void JNI_interface_type_info::destroy( JNIEnv * jni_env )
60 {
61  JNI_type_info::destruct( jni_env );
62  jni_env->DeleteGlobalRef( m_proxy_ctor );
63  jni_env->DeleteGlobalRef( m_type );
64  m_methods.reset();
65  delete this;
66 }
67 
68 
70  JNI_context const & jni, typelib_TypeDescription * td_ )
71  : JNI_type_info( jni, td_ )
72 {
73  assert( m_td.get()->eTypeClass == typelib_TypeClass_INTERFACE );
74 
75  OUString const & uno_name = OUString::unacquired( &m_td.get()->pTypeName );
76  JNI_info const * jni_info = jni.get_info();
77 
78  JLocalAutoRef jo_class(
79  jni,
80  find_class(
81  jni,
82  ( OUStringToOString( uno_name, RTL_TEXTENCODING_JAVA_UTF8 ).
83  getStr() ) ) );
84  JLocalAutoRef jo_type( jni, create_type( jni, static_cast<jclass>(jo_class.get()) ) );
85 
86  // get proxy ctor
87  jvalue arg;
88  arg.l = jo_class.get();
89  JLocalAutoRef jo_proxy_ctor(
90  jni, jni->CallStaticObjectMethodA(
91  jni_info->m_class_JNI_proxy,
92  jni_info->m_method_JNI_proxy_get_proxy_ctor, &arg ) );
93 
94  if (is_XInterface( m_td.get()->pWeakRef ))
95  {
96  m_methods = nullptr; // no methods
97  }
98  else
99  {
100  // retrieve method ids for all direct members
101  try
102  {
103  typelib_InterfaceTypeDescription * td =
104  reinterpret_cast< typelib_InterfaceTypeDescription * >(
105  m_td.get() );
106  // coverity[ctor_dtor_leak] - on purpose
107  m_methods.reset(new jmethodID[ td->nMapFunctionIndexToMemberIndex ]);
108  sal_Int32 nMethodIndex = 0;
109  typelib_TypeDescriptionReference ** ppMembers = td->ppMembers;
110  sal_Int32 nMembers = td->nMembers;
111 
112  for ( sal_Int32 nPos = 0; nPos < nMembers; ++nPos )
113  {
114  TypeDescr member_td( ppMembers[ nPos ] );
115 
116  OStringBuffer sig_buf( 64 );
117 
118  if (member_td.get()->eTypeClass ==
119  typelib_TypeClass_INTERFACE_METHOD) // method
120  {
121  typelib_InterfaceMethodTypeDescription * method_td =
122  reinterpret_cast<
123  typelib_InterfaceMethodTypeDescription * >(
124  member_td.get() );
125 
126  sig_buf.append( '(' );
127  for ( sal_Int32 i = 0; i < method_td->nParams; ++i )
128  {
129  typelib_MethodParameter const & param =
130  method_td->pParams[ i ];
131  if (param.bOut)
132  sig_buf.append( '[' );
133  JNI_info::append_sig( &sig_buf, param.pTypeRef );
134  }
135  sig_buf.append( ')' );
136  JNI_info::append_sig( &sig_buf, method_td->pReturnTypeRef );
137 
138  OString method_signature( sig_buf.makeStringAndClear() );
139  OString method_name(
140  OUStringToOString( OUString::unacquired(
141  &method_td->aBase.pMemberName ),
142  RTL_TEXTENCODING_JAVA_UTF8 ) );
143 
144  m_methods[ nMethodIndex ] = jni->GetMethodID(
145  static_cast<jclass>(jo_class.get()), method_name.getStr(),
146  method_signature.getStr() );
147  jni.ensure_no_exception();
148  assert( m_methods[ nMethodIndex ] != nullptr );
149  ++nMethodIndex;
150  }
151  else // attribute
152  {
153  assert(
154  member_td.get()->eTypeClass ==
155  typelib_TypeClass_INTERFACE_ATTRIBUTE );
156  typelib_InterfaceAttributeTypeDescription * attribute_td =
157  reinterpret_cast<
158  typelib_InterfaceAttributeTypeDescription * >(
159  member_td.get() );
160 
161  // type sig
163  &sig_buf, attribute_td->pAttributeTypeRef );
164  OString type_sig( sig_buf.makeStringAndClear() );
165  sig_buf.ensureCapacity( 64 );
166  // member name
167  OUString const & member_name =
168  OUString::unacquired(
169  &attribute_td->aBase.pMemberName );
170 
171  // getter
172  sig_buf.append( "()" );
173  sig_buf.append( type_sig );
174  OString method_signature( sig_buf.makeStringAndClear() );
175  OUStringBuffer name_buf( 3 + member_name.getLength() );
176  name_buf.append( "get" );
177  name_buf.append( member_name );
178  OString method_name(
180  name_buf.makeStringAndClear(),
181  RTL_TEXTENCODING_JAVA_UTF8 ) );
182  m_methods[ nMethodIndex ] = jni->GetMethodID(
183  static_cast<jclass>(jo_class.get()), method_name.getStr(),
184  method_signature.getStr() );
185  jni.ensure_no_exception();
186  assert( m_methods[ nMethodIndex ] != nullptr );
187  ++nMethodIndex;
188  if (! attribute_td->bReadOnly)
189  {
190  // setter
191  sig_buf.ensureCapacity( 64 );
192  sig_buf.append( '(' );
193  sig_buf.append( type_sig );
194  sig_buf.append( ")V" );
195  method_signature = sig_buf.makeStringAndClear();
196  name_buf.ensureCapacity( 3 + member_name.getLength() );
197  name_buf.append( "set" );
198  name_buf.append( member_name );
199  method_name = OUStringToOString(
200  name_buf.makeStringAndClear(),
201  RTL_TEXTENCODING_JAVA_UTF8 );
202  m_methods[ nMethodIndex ] = jni->GetMethodID(
203  static_cast<jclass>(jo_class.get()), method_name.getStr(),
204  method_signature.getStr() );
205  jni.ensure_no_exception();
206  assert( m_methods[ nMethodIndex ] != nullptr );
207  ++nMethodIndex;
208  }
209  }
210  }
211  }
212  catch (...)
213  {
214  m_methods.reset();
215  throw;
216  }
217  }
218  m_class = static_cast<jclass>(jni->NewGlobalRef( jo_class.get() ));
219  m_type = jni->NewGlobalRef( jo_type.get() );
220  m_proxy_ctor = jni->NewGlobalRef( jo_proxy_ctor.get() );
221 }
222 
223 
224 void JNI_compound_type_info::destroy( JNIEnv * jni_env )
225 {
226  JNI_type_info::destruct( jni_env );
227  m_fields.reset();
228  delete this;
229 }
230 
231 
233  JNI_context const & jni, typelib_TypeDescription * td_ )
234  : JNI_type_info( jni, td_ ),
235  m_exc_ctor( nullptr )
236 {
237  assert( m_td.get()->eTypeClass == typelib_TypeClass_STRUCT ||
238  m_td.get()->eTypeClass == typelib_TypeClass_EXCEPTION );
239  typelib_CompoundTypeDescription * td =
240  reinterpret_cast< typelib_CompoundTypeDescription * >( m_td.get() );
241 
242  OUString const & uno_name =
243  OUString::unacquired( &td->aBase.pTypeName );
244 
245  // Erase type arguments of instantiated polymorphic struct types:
246  OUString nucleus;
247  sal_Int32 i = uno_name.indexOf( '<' );
248  if ( i < 0 ) {
249  nucleus = uno_name;
250  } else {
251  nucleus = uno_name.copy( 0, i );
252  }
253  JLocalAutoRef jo_class(
254  jni,
255  find_class(
256  jni,
258  nucleus, RTL_TEXTENCODING_JAVA_UTF8 ).getStr() ) );
259 
260  JNI_info const * jni_info = jni.get_info();
261 
262  if (m_td.get()->eTypeClass == typelib_TypeClass_EXCEPTION)
263  {
264  // retrieve exc ctor( msg )
265  m_exc_ctor = jni->GetMethodID(
266  static_cast<jclass>(jo_class.get()), "<init>", "(Ljava/lang/String;)V" );
267  jni.ensure_no_exception();
268  assert( m_exc_ctor != nullptr );
269  }
270 
271  // retrieve info for base type
272  typelib_TypeDescription * base_td =
273  type_equals(
274  td->aBase.pWeakRef,
275  jni_info->m_RuntimeException_type.getTypeLibType())
276  ? nullptr
277  : reinterpret_cast< typelib_TypeDescription * >(
278  td->pBaseTypeDescription );
279  m_base = (base_td == nullptr ? nullptr : jni_info->get_type_info( jni, base_td ));
280 
281  try
282  {
283  if (type_equals(
284  td->aBase.pWeakRef,
285  jni_info->m_Exception_type.getTypeLibType() ) ||
286  type_equals(
287  td->aBase.pWeakRef,
288  jni_info->m_RuntimeException_type.getTypeLibType() ))
289  {
290  // coverity[ctor_dtor_leak] - on purpose
291  m_fields.reset(new jfieldID[ 2 ]);
292  m_fields[ 0 ] = nullptr; // special Throwable.getMessage()
293  // field Context
294  m_fields[ 1 ] = jni->GetFieldID(
295  static_cast<jclass>(jo_class.get()), "Context", "Ljava/lang/Object;" );
296  jni.ensure_no_exception();
297  assert( m_fields[ 1 ] != nullptr );
298  }
299  else
300  {
301  // retrieve field ids for all direct members
302  sal_Int32 nMembers = td->nMembers;
303  m_fields.reset(new jfieldID[ nMembers ]);
304 
305  for ( sal_Int32 nPos = 0; nPos < nMembers; ++nPos )
306  {
307  OString sig;
308  if (td->aBase.eTypeClass == typelib_TypeClass_STRUCT
309  && reinterpret_cast< typelib_StructTypeDescription * >(
310  td)->pParameterizedTypes != nullptr
311  && reinterpret_cast< typelib_StructTypeDescription * >(
312  td)->pParameterizedTypes[nPos])
313  {
314  sig = OString( "Ljava/lang/Object;" );
315  } else {
316  OStringBuffer sig_buf( 32 );
317  JNI_info::append_sig( &sig_buf, td->ppTypeRefs[ nPos ] );
318  sig = sig_buf.makeStringAndClear();
319  }
320 
321  OString member_name(
323  OUString::unacquired( &td->ppMemberNames[ nPos ] ),
324  RTL_TEXTENCODING_JAVA_UTF8 ) );
325 
326  m_fields[ nPos ] = jni->GetFieldID(
327  static_cast<jclass>(jo_class.get()), member_name.getStr(),
328  sig.getStr() );
329  jni.ensure_no_exception();
330  assert( m_fields[ nPos ] != nullptr );
331  }
332  }
333  }
334  catch (...)
335  {
336  m_fields.reset();
337  throw;
338  }
339 
340  m_class = static_cast<jclass>(jni->NewGlobalRef( jo_class.get() ));
341 }
342 
343 
345  JNI_context const & jni, typelib_TypeDescription * td ) const
346 {
347  OUString const & uno_name = OUString::unacquired( &td->pTypeName );
348 
349  JNI_type_info * new_info;
350  switch (td->eTypeClass)
351  {
352  case typelib_TypeClass_STRUCT:
353  case typelib_TypeClass_EXCEPTION:
354  {
355  new_info = new JNI_compound_type_info( jni, td );
356  break;
357  }
358  case typelib_TypeClass_INTERFACE:
359  {
360  new_info = new JNI_interface_type_info( jni, td );
361  break;
362  }
363  default:
364  {
365  throw BridgeRuntimeError(
366  "type info not supported for " + uno_name + jni.get_stack_trace() );
367  }
368  }
369 
370  // look up
371  JNI_type_info * info;
372  ClearableMutexGuard guard( m_mutex );
373  JNI_type_info_holder & holder = m_type_map[ uno_name ];
374  if (holder.m_info == nullptr) // new insertion
375  {
376  holder.m_info = new_info;
377  guard.clear();
378  info = new_info;
379  }
380  else // inserted in the meantime
381  {
382  info = holder.m_info;
383  guard.clear();
384  new_info->destroy( jni.get_jni_env() );
385  }
386  return info;
387 }
388 
389 
391  JNI_context const & jni, typelib_TypeDescription * td ) const
392 {
393  if (is_XInterface( td->pWeakRef ))
394  {
395  return m_XInterface_type_info;
396  }
397 
398  OUString const & uno_name = OUString::unacquired( &td->pTypeName );
399  JNI_type_info const * info;
400  ClearableMutexGuard guard( m_mutex );
401 
402  t_str2type::const_iterator iFind( m_type_map.find( uno_name ) );
403  if (iFind == m_type_map.end())
404  {
405  guard.clear();
406  info = create_type_info( jni, td );
407  }
408  else
409  {
410  info = iFind->second.m_info;
411  }
412 
413  return info;
414 }
415 
416 
418  JNI_context const & jni, typelib_TypeDescriptionReference * type ) const
419 {
420  if (is_XInterface( type ))
421  {
422  return m_XInterface_type_info;
423  }
424 
425  OUString const & uno_name = OUString::unacquired( &type->pTypeName );
426  JNI_type_info const * info;
427  ClearableMutexGuard guard( m_mutex );
428  t_str2type::const_iterator iFind( m_type_map.find( uno_name ) );
429  if (iFind == m_type_map.end())
430  {
431  guard.clear();
432  TypeDescr td( type );
433  info = create_type_info( jni, td.get() );
434  }
435  else
436  {
437  info = iFind->second.m_info;
438  }
439 
440  return info;
441 }
442 
443 
445  JNI_context const & jni, OUString const & uno_name ) const
446 {
447  if ( uno_name == "com.sun.star.uno.XInterface" )
448  {
449  return m_XInterface_type_info;
450  }
451 
452  JNI_type_info const * info;
453  ClearableMutexGuard guard( m_mutex );
454  t_str2type::const_iterator iFind( m_type_map.find( uno_name ) );
455  if (iFind == m_type_map.end())
456  {
457  guard.clear();
458  css::uno::TypeDescription td( uno_name );
459  if (! td.is())
460  {
461  throw BridgeRuntimeError(
462  "UNO type not found: " + uno_name + jni.get_stack_trace() );
463  }
464  info = create_type_info( jni, td.get() );
465  }
466  else
467  {
468  info = iFind->second.m_info;
469  }
470 
471  return info;
472 }
473 
474 
476  JNIEnv * jni_env, jobject class_loader, jclass classClass,
477  jmethodID methodForName )
478  : m_class_Class( classClass ),
479  m_method_Class_forName( methodForName ),
480  m_class_JNI_proxy( nullptr ),
481  m_XInterface_queryInterface_td(
482  (reinterpret_cast< typelib_InterfaceTypeDescription * >(
483  css::uno::TypeDescription(
484  cppu::UnoType<css::uno::XInterface>::get())
485  .get())->ppMembers[ 0 ] ) ),
486  m_Exception_type(cppu::UnoType<css::uno::Exception>::get()),
487  m_RuntimeException_type(cppu::UnoType<css::uno::RuntimeException>::get()),
488  m_void_type(cppu::UnoType<void>::get()),
489  m_XInterface_type_info( nullptr )
490 {
491  JNI_context jni( this, jni_env, class_loader ); // !no proper jni_info!
492 
493  // class lookup
494  JLocalAutoRef jo_Object(
495  jni, find_class( jni, "java.lang.Object" ) );
496  JLocalAutoRef jo_Class(
497  jni, find_class( jni, "java.lang.Class" ) );
498  JLocalAutoRef jo_Throwable(
499  jni, find_class( jni, "java.lang.Throwable" ) );
500  JLocalAutoRef jo_Character(
501  jni, find_class( jni, "java.lang.Character" ) );
502  JLocalAutoRef jo_Boolean(
503  jni, find_class( jni, "java.lang.Boolean" ) );
504  JLocalAutoRef jo_Byte(
505  jni, find_class( jni, "java.lang.Byte" ) );
506  JLocalAutoRef jo_Short(
507  jni, find_class( jni, "java.lang.Short" ) );
508  JLocalAutoRef jo_Integer(
509  jni, find_class( jni, "java.lang.Integer" ) );
510  JLocalAutoRef jo_Long(
511  jni, find_class( jni, "java.lang.Long" ) );
512  JLocalAutoRef jo_Float(
513  jni, find_class( jni, "java.lang.Float" ) );
514  JLocalAutoRef jo_Double(
515  jni, find_class( jni, "java.lang.Double" ) );
516  JLocalAutoRef jo_String(
517  jni, find_class( jni, "java.lang.String" ) );
518  JLocalAutoRef jo_RuntimeException(
519  jni, find_class( jni, "com.sun.star.uno.RuntimeException" ) );
520  JLocalAutoRef jo_UnoRuntime(
521  jni, find_class( jni, "com.sun.star.uno.UnoRuntime" ) );
522  JLocalAutoRef jo_Any(
523  jni, find_class( jni, "com.sun.star.uno.Any" ) );
524  JLocalAutoRef jo_Enum(
525  jni, find_class( jni, "com.sun.star.uno.Enum" ) );
526  JLocalAutoRef jo_Type(
527  jni, find_class( jni, "com.sun.star.uno.Type" ) );
528  JLocalAutoRef jo_TypeClass(
529  jni, find_class( jni, "com.sun.star.uno.TypeClass" ) );
530  JLocalAutoRef jo_IEnvironment(
531  jni, find_class( jni, "com.sun.star.uno.IEnvironment" ) );
532  JLocalAutoRef jo_JNI_proxy(
533  jni, find_class( jni, "com.sun.star.bridges.jni_uno.JNI_proxy" ) );
534  JLocalAutoRef jo_AsynchronousFinalizer(
535  jni, find_class( jni, "com.sun.star.lib.util.AsynchronousFinalizer" ) );
536 
537  // method Object.toString()
538  m_method_Object_toString = jni->GetMethodID(
539  static_cast<jclass>(jo_Object.get()), "toString", "()Ljava/lang/String;" );
540  jni.ensure_no_exception();
541  assert( m_method_Object_toString != nullptr );
542  // method Class.getName()
543  m_method_Class_getName = jni->GetMethodID(
544  static_cast<jclass>(jo_Class.get()), "getName", "()Ljava/lang/String;" );
545  jni.ensure_no_exception();
546  assert( m_method_Class_getName != nullptr );
547 
548  // method Throwable.getMessage()
549  m_method_Throwable_getMessage = jni->GetMethodID(
550  static_cast<jclass>(jo_Throwable.get()), "getMessage", "()Ljava/lang/String;" );
551  jni.ensure_no_exception();
552  assert( m_method_Throwable_getMessage != nullptr );
553 
554  // method Character.charValue()
555  m_method_Character_charValue = jni->GetMethodID(
556  static_cast<jclass>(jo_Character.get()), "charValue", "()C" );
557  jni.ensure_no_exception();
558  assert( m_method_Character_charValue != nullptr );
559  // method Boolean.booleanValue()
560  m_method_Boolean_booleanValue = jni->GetMethodID(
561  static_cast<jclass>(jo_Boolean.get()), "booleanValue", "()Z" );
562  jni.ensure_no_exception();
563  assert( m_method_Boolean_booleanValue != nullptr );
564  // method Byte.byteValue()
565  m_method_Byte_byteValue = jni->GetMethodID(
566  static_cast<jclass>(jo_Byte.get()), "byteValue", "()B" );
567  jni.ensure_no_exception();
568  assert( m_method_Byte_byteValue != nullptr );
569  // method Short.shortValue()
570  m_method_Short_shortValue = jni->GetMethodID(
571  static_cast<jclass>(jo_Short.get()), "shortValue", "()S" );
572  jni.ensure_no_exception();
573  assert( m_method_Short_shortValue != nullptr );
574  // method Integer.intValue()
575  m_method_Integer_intValue = jni->GetMethodID(
576  static_cast<jclass>(jo_Integer.get()), "intValue", "()I" );
577  jni.ensure_no_exception();
578  assert( m_method_Integer_intValue != nullptr );
579  // method Long.longValue()
580  m_method_Long_longValue = jni->GetMethodID(
581  static_cast<jclass>(jo_Long.get()), "longValue", "()J" );
582  jni.ensure_no_exception();
583  assert( m_method_Long_longValue != nullptr );
584  // method Float.floatValue()
585  m_method_Float_floatValue = jni->GetMethodID(
586  static_cast<jclass>(jo_Float.get()), "floatValue", "()F" );
587  jni.ensure_no_exception();
588  assert( m_method_Float_floatValue != nullptr );
589  // method Double.doubleValue()
590  m_method_Double_doubleValue = jni->GetMethodID(
591  static_cast<jclass>(jo_Double.get()), "doubleValue", "()D" );
592  jni.ensure_no_exception();
593  assert( m_method_Double_doubleValue != nullptr );
594 
595  // ctor Character( char )
596  m_ctor_Character_with_char = jni->GetMethodID(
597  static_cast<jclass>(jo_Character.get()), "<init>", "(C)V" );
598  jni.ensure_no_exception();
599  assert( m_ctor_Character_with_char != nullptr );
600  // ctor Boolean( boolean )
601  m_ctor_Boolean_with_boolean = jni->GetMethodID(
602  static_cast<jclass>(jo_Boolean.get()), "<init>", "(Z)V" );
603  jni.ensure_no_exception();
604  assert( m_ctor_Boolean_with_boolean != nullptr );
605  // ctor Byte( byte )
606  m_ctor_Byte_with_byte = jni->GetMethodID(
607  static_cast<jclass>(jo_Byte.get()), "<init>", "(B)V" );
608  jni.ensure_no_exception();
609  assert( m_ctor_Byte_with_byte != nullptr );
610  // ctor Short( short )
611  m_ctor_Short_with_short = jni->GetMethodID(
612  static_cast<jclass>(jo_Short.get()), "<init>", "(S)V" );
613  jni.ensure_no_exception();
614  assert( m_ctor_Short_with_short != nullptr );
615  // ctor Integer( int )
616  m_ctor_Integer_with_int = jni->GetMethodID(
617  static_cast<jclass>(jo_Integer.get()), "<init>", "(I)V" );
618  jni.ensure_no_exception();
619  assert( m_ctor_Integer_with_int != nullptr );
620  // ctor Long( long )
621  m_ctor_Long_with_long = jni->GetMethodID(
622  static_cast<jclass>(jo_Long.get()), "<init>", "(J)V" );
623  jni.ensure_no_exception();
624  assert( m_ctor_Long_with_long != nullptr );
625  // ctor Float( float )
626  m_ctor_Float_with_float = jni->GetMethodID(
627  static_cast<jclass>(jo_Float.get()), "<init>", "(F)V" );
628  jni.ensure_no_exception();
629  assert( m_ctor_Float_with_float != nullptr );
630  // ctor Double( double )
631  m_ctor_Double_with_double = jni->GetMethodID(
632  static_cast<jclass>(jo_Double.get()), "<init>", "(D)V" );
633  jni.ensure_no_exception();
634  assert( m_ctor_Double_with_double != nullptr );
635 
636  // static method UnoRuntime.generateOid()
637  m_method_UnoRuntime_generateOid = jni->GetStaticMethodID(
638  static_cast<jclass>(jo_UnoRuntime.get()),
639  "generateOid", "(Ljava/lang/Object;)Ljava/lang/String;" );
640  jni.ensure_no_exception();
641  assert( m_method_UnoRuntime_generateOid != nullptr );
642  // static method UnoRuntime.queryInterface()
643  m_method_UnoRuntime_queryInterface = jni->GetStaticMethodID(
644  static_cast<jclass>(jo_UnoRuntime.get()),
645  "queryInterface",
646  "(Lcom/sun/star/uno/Type;Ljava/lang/Object;)Ljava/lang/Object;" );
647  jni.ensure_no_exception();
648  assert( m_method_UnoRuntime_queryInterface != nullptr );
649 
650  // field Enum.m_value
651  m_field_Enum_m_value = jni->GetFieldID(
652  static_cast<jclass>(jo_Enum.get()), "m_value", "I" );
653  jni.ensure_no_exception();
654  assert( m_field_Enum_m_value != nullptr );
655 
656  // static method TypeClass.fromInt()
657  m_method_TypeClass_fromInt = jni->GetStaticMethodID(
658  static_cast<jclass>(jo_TypeClass.get()),
659  "fromInt", "(I)Lcom/sun/star/uno/TypeClass;" );
660  jni.ensure_no_exception();
661  assert( m_method_TypeClass_fromInt != nullptr );
662 
663  // ctor Type( Class )
664  m_ctor_Type_with_Class = jni->GetMethodID(
665  static_cast<jclass>(jo_Type.get()), "<init>", "(Ljava/lang/Class;)V" );
666  jni.ensure_no_exception();
667  assert( m_ctor_Type_with_Class != nullptr );
668  // ctor Type( String, TypeClass )
669  m_ctor_Type_with_Name_TypeClass = jni->GetMethodID(
670  static_cast<jclass>(jo_Type.get()),
671  "<init>", "(Ljava/lang/String;Lcom/sun/star/uno/TypeClass;)V" );
672  jni.ensure_no_exception();
673  assert( m_ctor_Type_with_Name_TypeClass != nullptr );
674  // field Type._typeName
675  m_field_Type_typeName = jni->GetFieldID(
676  static_cast<jclass>(jo_Type.get()), "_typeName", "Ljava/lang/String;" );
677  jni.ensure_no_exception();
678  assert( m_field_Type_typeName != nullptr );
679 
680  // ctor Any( Type, Object )
681  m_ctor_Any_with_Type_Object = jni->GetMethodID(
682  static_cast<jclass>(jo_Any.get()),
683  "<init>", "(Lcom/sun/star/uno/Type;Ljava/lang/Object;)V" );
684  jni.ensure_no_exception();
685  assert( m_ctor_Any_with_Type_Object != nullptr );
686 
687  // field Any._type
688  m_field_Any_type = jni->GetFieldID(
689  static_cast<jclass>(jo_Any.get()), "_type", "Lcom/sun/star/uno/Type;" );
690  jni.ensure_no_exception();
691  assert( m_field_Any_type != nullptr );
692  // field Any._object
693  m_field_Any_object = jni->GetFieldID(
694  static_cast<jclass>(jo_Any.get()), "_object", "Ljava/lang/Object;" );
695  jni.ensure_no_exception();
696  assert( m_field_Any_object != nullptr );
697 
698  // method IEnvironment.getRegisteredInterface()
700  static_cast<jclass>(jo_IEnvironment.get()),
701  "getRegisteredInterface",
702  "(Ljava/lang/String;Lcom/sun/star/uno/Type;)Ljava/lang/Object;" );
703  jni.ensure_no_exception();
705  // method IEnvironment.registerInterface()
706  m_method_IEnvironment_registerInterface = jni->GetMethodID(
707  static_cast<jclass>(jo_IEnvironment.get()), "registerInterface",
708  "(Ljava/lang/Object;[Ljava/lang/String;Lcom/sun/star/uno/Type;)"
709  "Ljava/lang/Object;" );
710  jni.ensure_no_exception();
711  assert( m_method_IEnvironment_registerInterface != nullptr );
712 
713  // static method JNI_proxy.get_proxy_ctor()
714  m_method_JNI_proxy_get_proxy_ctor = jni->GetStaticMethodID(
715  static_cast<jclass>(jo_JNI_proxy.get()), "get_proxy_ctor",
716  "(Ljava/lang/Class;)Ljava/lang/reflect/Constructor;" );
717  jni.ensure_no_exception();
718  assert( m_method_JNI_proxy_get_proxy_ctor != nullptr );
719  // static method JNI_proxy.create()
720  m_method_JNI_proxy_create = jni->GetStaticMethodID(
721  static_cast<jclass>(jo_JNI_proxy.get()), "create",
722  "(JLcom/sun/star/uno/IEnvironment;JJLcom/sun/star/uno/Type;Ljava/lang"
723  "/String;Ljava/lang/reflect/Constructor;"
724  "Lcom/sun/star/lib/util/AsynchronousFinalizer;)Ljava/lang/Object;" );
725  jni.ensure_no_exception();
726  assert( m_method_JNI_proxy_create != nullptr );
727  // field JNI_proxy.m_receiver_handle
728  m_field_JNI_proxy_m_receiver_handle = jni->GetFieldID(
729  static_cast<jclass>(jo_JNI_proxy.get()), "m_receiver_handle", "J" );
730  jni.ensure_no_exception();
731  assert( m_field_JNI_proxy_m_receiver_handle != nullptr );
732  // field JNI_proxy.m_td_handle
733  m_field_JNI_proxy_m_td_handle = jni->GetFieldID(
734  static_cast<jclass>(jo_JNI_proxy.get()), "m_td_handle", "J" );
735  jni.ensure_no_exception();
736  assert( m_field_JNI_proxy_m_td_handle != nullptr );
737  // field JNI_proxy.m_type
738  m_field_JNI_proxy_m_type = jni->GetFieldID(
739  static_cast<jclass>(jo_JNI_proxy.get()), "m_type", "Lcom/sun/star/uno/Type;" );
740  jni.ensure_no_exception();
741  assert( m_field_JNI_proxy_m_type != nullptr );
742  // field JNI_proxy.m_oid
743  m_field_JNI_proxy_m_oid = jni->GetFieldID(
744  static_cast<jclass>(jo_JNI_proxy.get()), "m_oid", "Ljava/lang/String;" );
745  jni.ensure_no_exception();
746  assert( m_field_JNI_proxy_m_oid != nullptr );
747 
748  // ctor AsynchronousFinalizer
749  m_ctor_AsynchronousFinalizer = jni->GetMethodID(
750  static_cast<jclass>(jo_AsynchronousFinalizer.get()), "<init>", "()V" );
751  jni.ensure_no_exception();
752  assert( m_ctor_AsynchronousFinalizer != nullptr );
753  // method AsynchronousFinalizer.drain()
754  m_method_AsynchronousFinalizer_drain = jni->GetMethodID(
755  static_cast<jclass>(jo_AsynchronousFinalizer.get()), "drain", "()V" );
756  jni.ensure_no_exception();
757  assert( m_method_AsynchronousFinalizer_drain != nullptr );
758 
759  // get java env
760  OUString java_env_type_name( UNO_LB_JAVA );
761  JLocalAutoRef jo_java(
762  jni, ustring_to_jstring( jni, java_env_type_name.pData ) );
763  jvalue args[ 2 ];
764  args[ 0 ].l = jo_java.get();
765  args[ 1 ].l = nullptr;
766  jmethodID method_getEnvironment = jni->GetStaticMethodID(
767  static_cast<jclass>(jo_UnoRuntime.get()), "getEnvironment",
768  "(Ljava/lang/String;Ljava/lang/Object;)"
769  "Lcom/sun/star/uno/IEnvironment;" );
770  jni.ensure_no_exception();
771  assert( method_getEnvironment != nullptr );
772  JLocalAutoRef jo_java_env(
773  jni, jni->CallStaticObjectMethodA(
774  static_cast<jclass>(jo_UnoRuntime.get()), method_getEnvironment, args ) );
775 
776  // get com.sun.star.uno.Any.VOID
777  jfieldID field_Any_VOID = jni->GetStaticFieldID(
778  static_cast<jclass>(jo_Any.get()), "VOID", "Lcom/sun/star/uno/Any;" );
779  jni.ensure_no_exception();
780  assert( field_Any_VOID != nullptr );
781  JLocalAutoRef jo_Any_VOID(
782  jni, jni->GetStaticObjectField(
783  static_cast<jclass>(jo_Any.get()), field_Any_VOID ) );
784  // get com.sun.star.uno.Type.UNSIGNED_SHORT
785  jfieldID field_Type_UNSIGNED_SHORT = jni->GetStaticFieldID(
786  static_cast<jclass>(jo_Type.get()), "UNSIGNED_SHORT", "Lcom/sun/star/uno/Type;" );
787  jni.ensure_no_exception();
788  assert( field_Type_UNSIGNED_SHORT != nullptr );
789  JLocalAutoRef jo_Type_UNSIGNED_SHORT(
790  jni, jni->GetStaticObjectField(
791  static_cast<jclass>(jo_Type.get()), field_Type_UNSIGNED_SHORT ) );
792  // get com.sun.star.uno.Type.UNSIGNED_LONG
793  jfieldID field_Type_UNSIGNED_LONG = jni->GetStaticFieldID(
794  static_cast<jclass>(jo_Type.get()), "UNSIGNED_LONG", "Lcom/sun/star/uno/Type;" );
795  jni.ensure_no_exception();
796  assert( field_Type_UNSIGNED_LONG != nullptr );
797  JLocalAutoRef jo_Type_UNSIGNED_LONG(
798  jni, jni->GetStaticObjectField(
799  static_cast<jclass>(jo_Type.get()), field_Type_UNSIGNED_LONG ) );
800  // get com.sun.star.uno.Type.UNSIGNED_HYPER
801  jfieldID field_Type_UNSIGNED_HYPER = jni->GetStaticFieldID(
802  static_cast<jclass>(jo_Type.get()), "UNSIGNED_HYPER", "Lcom/sun/star/uno/Type;" );
803  jni.ensure_no_exception();
804  assert( field_Type_UNSIGNED_HYPER != nullptr );
805  JLocalAutoRef jo_Type_UNSIGNED_HYPER(
806  jni, jni->GetStaticObjectField(
807  static_cast<jclass>(jo_Type.get()), field_Type_UNSIGNED_HYPER ) );
808 
809  // make global refs
811  static_cast<jclass>(jni->NewGlobalRef( jo_UnoRuntime.get() ));
813  static_cast<jclass>(jni->NewGlobalRef( jo_RuntimeException.get() ));
814  m_class_Any =
815  static_cast<jclass>(jni->NewGlobalRef( jo_Any.get() ));
816  m_class_Type =
817  static_cast<jclass>(jni->NewGlobalRef( jo_Type.get() ));
819  static_cast<jclass>(jni->NewGlobalRef( jo_TypeClass.get() ));
821  static_cast<jclass>(jni->NewGlobalRef( jo_JNI_proxy.get() ));
823  static_cast<jclass>(jni->NewGlobalRef( jo_AsynchronousFinalizer.get() ));
824 
826  static_cast<jclass>(jni->NewGlobalRef( jo_Character.get() ));
828  static_cast<jclass>(jni->NewGlobalRef( jo_Boolean.get() ));
829  m_class_Byte =
830  static_cast<jclass>(jni->NewGlobalRef( jo_Byte.get() ));
831  m_class_Short =
832  static_cast<jclass>(jni->NewGlobalRef( jo_Short.get() ));
834  static_cast<jclass>(jni->NewGlobalRef( jo_Integer.get() ));
835  m_class_Long =
836  static_cast<jclass>(jni->NewGlobalRef( jo_Long.get() ));
837  m_class_Float =
838  static_cast<jclass>(jni->NewGlobalRef( jo_Float.get() ));
840  static_cast<jclass>(jni->NewGlobalRef( jo_Double.get() ));
842  static_cast<jclass>(jni->NewGlobalRef( jo_String.get() ));
844  static_cast<jclass>(jni->NewGlobalRef( jo_Object.get() ));
845  m_class_Class =
846  static_cast<jclass>(jni->NewGlobalRef( m_class_Class ));
847 
849  jni->NewGlobalRef( jo_Any_VOID.get() );
851  jni->NewGlobalRef( jo_Type_UNSIGNED_SHORT.get() );
853  jni->NewGlobalRef( jo_Type_UNSIGNED_LONG.get() );
855  jni->NewGlobalRef( jo_Type_UNSIGNED_HYPER.get() );
856  m_object_java_env = jni->NewGlobalRef( jo_java_env.get() );
857 
858  try
859  {
860  css::uno::TypeDescription XInterface_td(
862  // coverity[ctor_dtor_leak] - on purpose
864  new JNI_interface_type_info( jni, XInterface_td.get() );
865  }
866  catch (...)
867  {
868  destruct( jni_env );
869  throw;
870  }
871 }
872 
873 
874 void JNI_info::destruct( JNIEnv * jni_env )
875 {
876  for (auto & i: m_type_map)
877  {
878  i.second.m_info->destroy( jni_env );
879  }
880  if (m_XInterface_type_info != nullptr)
881  {
882  const_cast< JNI_interface_type_info * >(
883  m_XInterface_type_info )->destroy( jni_env );
884  }
885 
886  // free global refs
887  jni_env->DeleteGlobalRef( m_object_java_env );
888  jni_env->DeleteGlobalRef( m_object_Any_VOID );
889  jni_env->DeleteGlobalRef( m_object_Type_UNSIGNED_SHORT );
890  jni_env->DeleteGlobalRef( m_object_Type_UNSIGNED_LONG );
891  jni_env->DeleteGlobalRef( m_object_Type_UNSIGNED_HYPER );
892 
893  jni_env->DeleteGlobalRef( m_class_Class );
894  jni_env->DeleteGlobalRef( m_class_Object );
895  jni_env->DeleteGlobalRef( m_class_String );
896  jni_env->DeleteGlobalRef( m_class_Double );
897  jni_env->DeleteGlobalRef( m_class_Float );
898  jni_env->DeleteGlobalRef( m_class_Long );
899  jni_env->DeleteGlobalRef( m_class_Integer );
900  jni_env->DeleteGlobalRef( m_class_Short );
901  jni_env->DeleteGlobalRef( m_class_Byte );
902  jni_env->DeleteGlobalRef( m_class_Boolean );
903  jni_env->DeleteGlobalRef( m_class_Character );
904 
905  jni_env->DeleteGlobalRef( m_class_AsynchronousFinalizer );
906  jni_env->DeleteGlobalRef( m_class_JNI_proxy );
907  jni_env->DeleteGlobalRef( m_class_RuntimeException );
908  jni_env->DeleteGlobalRef( m_class_UnoRuntime );
909  jni_env->DeleteGlobalRef( m_class_TypeClass );
910  jni_env->DeleteGlobalRef( m_class_Type );
911  jni_env->DeleteGlobalRef( m_class_Any );
912 }
913 
914 
917 {
918  // !!!no JNI_info available at JNI_context!!!
920  uno_vm->getVirtualMachine() );
921  JNIEnv * jni_env = guard.getEnvironment();
922  JNI_context jni(
923  nullptr, jni_env, static_cast< jobject >(uno_vm->getClassLoader()) );
924 
925  jclass jo_class;
926  jmethodID jo_forName;
927  jni.getClassForName( &jo_class, &jo_forName );
928  jni.ensure_no_exception();
929  JLocalAutoRef jo_JNI_info_holder(
930  jni,
931  jni.findClass(
932  "com.sun.star.bridges.jni_uno.JNI_info_holder", jo_class,
933  jo_forName, false ) );
934  // field JNI_info_holder.m_jni_info_handle
935  jfieldID field_s_jni_info_handle =
936  jni->GetStaticFieldID(
937  static_cast<jclass>(jo_JNI_info_holder.get()), "s_jni_info_handle", "J" );
938  jni.ensure_no_exception();
939  assert( field_s_jni_info_handle != nullptr );
940 
941  JNI_info const * jni_info =
942  reinterpret_cast< JNI_info const * >(
943  jni->GetStaticLongField(
944  static_cast<jclass>(jo_JNI_info_holder.get()), field_s_jni_info_handle ) );
945  if (jni_info == nullptr) // un-initialized?
946  {
947  JNI_info * new_info = new JNI_info(
948  jni_env, static_cast< jobject >(uno_vm->getClassLoader()), jo_class,
949  jo_forName );
950 
951  ClearableMutexGuard g( Mutex::getGlobalMutex() );
952  jni_info =
953  reinterpret_cast< JNI_info const * >(
954  jni->GetStaticLongField(
955  static_cast<jclass>(jo_JNI_info_holder.get()),
956  field_s_jni_info_handle ) );
957  if (jni_info == nullptr) // still un-initialized?
958  {
959  jni->SetStaticLongField(
960  static_cast<jclass>(jo_JNI_info_holder.get()), field_s_jni_info_handle,
961  reinterpret_cast< jlong >( new_info ) );
962  jni_info = new_info;
963  }
964  else
965  {
966  g.clear();
967  new_info->destroy( jni_env );
968  }
969  }
970 
971  return jni_info;
972 }
973 
974 }
975 
976 extern "C"
977 {
978 
979 
980 SAL_JNI_EXPORT void
982  JNIEnv * jni_env, SAL_UNUSED_PARAMETER jobject, jlong jni_info_handle )
984 {
985  ::jni_uno::JNI_info * jni_info =
986  reinterpret_cast< ::jni_uno::JNI_info * >( jni_info_handle );
987  jni_info->destroy( jni_env );
988 }
989 
990 }
991 
992 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
jmethodID m_method_Object_toString
Definition: jni_info.h:158
jobject m_object_Type_UNSIGNED_LONG
Definition: jni_info.h:136
jmethodID m_method_Double_doubleValue
Definition: jni_info.h:172
jstring ustring_to_jstring(JNI_context const &jni, rtl_uString const *ustr)
Definition: jni_helper.h:67
jmethodID m_ctor_Any_with_Type_Object
Definition: jni_info.h:182
::com::sun::star::uno::Type const & m_Exception_type
Definition: jni_info.h:202
JNI_compound_type_info(JNI_context const &jni, typelib_TypeDescription *td)
Definition: jni_info.cxx:232
mutable::osl::Mutex m_mutex
Definition: jni_info.h:125
jfieldID m_field_JNI_proxy_m_receiver_handle
Definition: jni_info.h:193
t_str2type m_type_map
Definition: jni_info.h:126
jobject m_object_Type_UNSIGNED_HYPER
Definition: jni_info.h:137
jclass m_class_AsynchronousFinalizer
Definition: jni_info.h:156
jclass m_class_UnoRuntime
Definition: jni_info.h:150
jobject create_type(JNI_context const &jni, jclass clazz)
Definition: jni_helper.h:101
JNIEnv * get_jni_env() const
Definition: jni_base.h:77
jclass m_class_TypeClass
Definition: jni_info.h:154
virtual void destroy(JNIEnv *jni_env) override
Definition: jni_info.cxx:59
jclass m_class_Class
Definition: jni_info.h:130
tuple args
jobject m_object_Any_VOID
Definition: jni_info.h:134
JNI_info const * get_info() const
Definition: jni_base.h:72
jmethodID m_ctor_AsynchronousFinalizer
Definition: jni_info.h:198
JNI_type_info const * create_type_info(JNI_context const &jni, typelib_TypeDescription *td) const
Definition: jni_info.cxx:344
jmethodID m_ctor_Long_with_long
Definition: jni_info.h:166
jmethodID m_method_UnoRuntime_generateOid
Definition: jni_info.h:180
static void append_sig(OStringBuffer *buf, typelib_TypeDescriptionReference *type, bool use_Object_for_type_XInterface=true, bool use_slashes=true)
Definition: jni_info.h:246
jobject get() const
Definition: jni_base.h:155
jmethodID m_method_Boolean_booleanValue
Definition: jni_info.h:169
#define SAL_THROW_EXTERN_C()
jmethodID m_ctor_Float_with_float
Definition: jni_info.h:167
jclass m_class_JNI_proxy
Definition: jni_info.h:155
jmethodID m_method_TypeClass_fromInt
Definition: jni_info.h:188
std::unique_ptr< jmethodID[]> m_methods
Definition: jni_info.h:84
jmethodID m_ctor_Character_with_char
Definition: jni_info.h:161
jclass m_class_Type
Definition: jni_info.h:153
OUString get_stack_trace(jobject jo_exc=nullptr) const
Definition: jni_bridge.cxx:377
jmethodID m_method_Byte_byteValue
Definition: jni_info.h:170
jmethodID m_ctor_Double_with_double
Definition: jni_info.h:168
jmethodID m_ctor_Type_with_Class
Definition: jni_info.h:185
jclass m_class_Object
Definition: jni_info.h:139
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
jclass m_class_Short
Definition: jni_info.h:143
std::unique_ptr< jfieldID[]> m_fields
Definition: jni_info.h:100
jmethodID m_method_JNI_proxy_create
Definition: jni_info.h:192
void ensure_no_exception() const
Definition: jni_base.h:96
jfieldID m_field_JNI_proxy_m_type
Definition: jni_info.h:195
JNI_interface_type_info(JNI_context const &jni, typelib_TypeDescription *td)
Definition: jni_info.cxx:69
jfieldID m_field_Any_object
Definition: jni_info.h:184
jclass m_class_Float
Definition: jni_info.h:146
int i
jclass m_class_Byte
Definition: jni_info.h:142
jfieldID m_field_Type_typeName
Definition: jni_info.h:187
void destroy(JNIEnv *jni_env)
Definition: jni_info.h:240
JNI_type_info(const JNI_type_info &)=delete
jfieldID m_field_JNI_proxy_m_td_handle
Definition: jni_info.h:194
jmethodID m_method_IEnvironment_getRegisteredInterface
Definition: jni_info.h:178
jobject m_object_java_env
Definition: jni_info.h:133
jmethodID m_ctor_Short_with_short
Definition: jni_info.h:164
JNI_interface_type_info const * m_XInterface_type_info
Definition: jni_info.h:205
SAL_JNI_EXPORT void JNICALL Java_com_sun_star_bridges_jni_1uno_JNI_1info_1holder_finalize__J(JNIEnv *jni_env, SAL_UNUSED_PARAMETER jobject, jlong jni_info_handle) SAL_THROW_EXTERN_C()
Definition: jni_info.cxx:981
jclass findClass(char const *name, jclass classClass, jmethodID methodForName, bool inException) const
Definition: jni_bridge.cxx:356
jfieldID m_field_Any_type
Definition: jni_info.h:183
jclass m_class_Integer
Definition: jni_info.h:144
jmethodID m_ctor_Byte_with_byte
Definition: jni_info.h:163
jmethodID m_ctor_Type_with_Name_TypeClass
Definition: jni_info.h:186
jmethodID m_method_Long_longValue
Definition: jni_info.h:175
struct _typelib_TypeDescription typelib_TypeDescription
Definition: msvc/except.hxx:52
JNI_type_info const * get_type_info(JNI_context const &jni, typelib_TypeDescription *type) const
Definition: jni_info.cxx:390
::com::sun::star::uno::TypeDescription m_td
Definition: jni_info.h:67
void destruct(JNIEnv *jni_env)
Definition: jni_info.h:72
jmethodID m_method_Float_floatValue
Definition: jni_info.h:173
jclass m_class_Character
Definition: jni_info.h:140
jclass m_class_RuntimeException
Definition: jni_info.h:151
jmethodID m_method_Character_charValue
Definition: jni_info.h:171
jmethodID m_method_UnoRuntime_queryInterface
Definition: jni_info.h:181
friend friend class AttachGuard
::com::sun::star::uno::Type const & m_RuntimeException_type
Definition: jni_info.h:203
jmethodID m_method_IEnvironment_registerInterface
Definition: jni_info.h:179
jmethodID m_method_Integer_intValue
Definition: jni_info.h:174
jfieldID m_field_Enum_m_value
Definition: jni_info.h:189
jclass m_class_Double
Definition: jni_info.h:147
typelib_TypeDescription * get() const
Definition: jni_base.h:239
virtual void destroy(JNIEnv *jni_env) override
Definition: jni_info.cxx:224
static JNI_info const * get_jni_info(rtl::Reference< jvmaccess::UnoVirtualMachine > const &uno_vm)
Definition: jni_info.cxx:915
void getClassForName(jclass *classClass, jmethodID *methodForName) const
Definition: jni_bridge.cxx:343
jmethodID m_method_AsynchronousFinalizer_drain
Definition: jni_info.h:199
jmethodID m_ctor_Integer_with_int
Definition: jni_info.h:165
jmethodID m_method_Class_getName
Definition: jni_info.h:159
jclass m_class_String
Definition: jni_info.h:148
jclass m_class_Any
Definition: jni_info.h:152
jobject m_object_Type_UNSIGNED_SHORT
Definition: jni_info.h:135
jmethodID m_ctor_Boolean_with_boolean
Definition: jni_info.h:162
bool type_equals(typelib_TypeDescriptionReference *type1, typelib_TypeDescriptionReference *type2)
Definition: jni_info.h:43
bool is_XInterface(typelib_TypeDescriptionReference *type)
Definition: jni_info.h:56
JNI_info(const JNI_info &)=delete
jmethodID m_method_Short_shortValue
Definition: jni_info.h:176
jclass m_class_Boolean
Definition: jni_info.h:141
JNI_type_info * m_info
Definition: jni_info.h:112
jmethodID m_method_JNI_proxy_get_proxy_ctor
Definition: jni_info.h:191
JNI_type_info const * m_base
Definition: jni_info.h:96
void destruct(JNIEnv *jni_env)
Definition: jni_info.cxx:874
jclass m_class_Long
Definition: jni_info.h:145
jfieldID m_field_JNI_proxy_m_oid
Definition: jni_info.h:196
virtual void destroy(JNIEnv *jni_env)=0
sal_uInt16 nPos
jclass find_class(JNI_context const &jni, char const *class_name, bool inException=false)
Definition: jni_helper.h:78
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo
jmethodID m_method_Throwable_getMessage
Definition: jni_info.h:160