MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MemberIdStrongCache< C > Struct Template Reference

#include <jtie_tconv_idcache_impl.hpp>

Inheritance diagram for MemberIdStrongCache< C >:
Collaboration diagram for MemberIdStrongCache< C >:

Public Types

typedef MemberId< C > A
typedef MemberIdCache< C > Base
- Public Types inherited from MemberIdCache< C >
typedef C::memberID_t ID_t
- Public Types inherited from MemberId< C >
typedef C::memberID_t ID_t

Static Public Member Functions

static void setClass (JNIEnv *env, jclass cls)
static jclass getClass (JNIEnv *env)
static void releaseRef (JNIEnv *env, jclass cls)
- Static Public Member Functions inherited from MemberIdCache< C >
static ID_t getId (JNIEnv *env, jclass cls)

Additional Inherited Members

- Static Public Attributes inherited from MemberId< C >
static unsigned long nIdLookUps = 0
- Static Protected Attributes inherited from MemberIdCache< C >
static jclass gClassRef = NULL
static ID_t mid = NULL

Detailed Description

template<typename C>
struct MemberIdStrongCache< C >

Provides caching of JNI Field/Method IDs using strong class references, preventing classes from being unloaded even if no longer used by Java code.

Definition at line 330 of file jtie_tconv_idcache_impl.hpp.

Member Function Documentation

template<typename C >
static jclass MemberIdStrongCache< C >::getClass ( JNIEnv *  env)
inlinestatic

Returns a JNI Reference to the class declaring the member specified by info type 'C'.

Depending upon the underlying caching strategy, a returned reference may be local or global, weak or strong; the scope of its use must be demarcated by releaseRef().

Pre condition:

  • this thread has no pending JNI exception (!env->ExceptionCheck())

Post condition:

  • return value is NULL:
    • this thread has a pending JNI exception (env->ExceptionCheck()) otherwise:
    • this thread has no pending JNI exception (!env->ExceptionCheck())
    • the returned reference is valid (at least) until releaseRef()

Reimplemented from MemberId< C >.

Reimplemented in MemberIdPreloadedStrongCache< C >.

Definition at line 344 of file jtie_tconv_idcache_impl.hpp.

Here is the call graph for this function:

template<typename C >
static void MemberIdStrongCache< C >::releaseRef ( JNIEnv *  env,
jclass  cls 
)
inlinestatic

Allows for a class reference to be released along with any member IDs.

Pre condition:

  • a valid class reference obtained by getClass(): assert(cls != NULL)
  • this thread may have a pending JNI exception (env->ExceptionCheck())

Reimplemented from MemberId< C >.

Definition at line 357 of file jtie_tconv_idcache_impl.hpp.

template<typename C >
static void MemberIdStrongCache< C >::setClass ( JNIEnv *  env,
jclass  cls 
)
inlinestatic

Allows for storing a (global) class reference.

Usually only called from getClass(), but enables "cache preloading" from a (native, static) function called at class initialization.

Pre condition:

  • this thread has no pending JNI exception (!env->ExceptionCheck())
  • a valid local or global class reference: assert(cls != NULL)

Reimplemented from MemberId< C >.

Definition at line 334 of file jtie_tconv_idcache_impl.hpp.

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this struct was generated from the following file: