JniExceptionChecker Class Reference

Helper for JniEnvRef. More...

#include <JniUtil.h>

List of all members.

Public Member Functions

 JniExceptionChecker (JNIEnv *pEnvInit)
 ~JniExceptionChecker ()
JNIEnv * operator-> () const

Private Member Functions

void checkExceptions ()
 Checks whether any Java exception has occurred, and if so throws it as a C++ exception.

Private Attributes

JNIEnv * pEnv


Detailed Description

Helper for JniEnvRef.

Definition at line 41 of file JniUtil.h.


Constructor & Destructor Documentation

JniExceptionChecker::JniExceptionChecker ( JNIEnv *  pEnvInit  )  [inline, explicit]

Definition at line 52 of file JniUtil.h.

00053     {
00054         pEnv = pEnvInit;
00055     }

JniExceptionChecker::~JniExceptionChecker (  ) 

Definition at line 518 of file JniUtil.cpp.

References checkExceptions().

00519 {
00520     checkExceptions();
00521 }


Member Function Documentation

void JniExceptionChecker::checkExceptions (  )  [private]

Checks whether any Java exception has occurred, and if so throws it as a C++ exception.

Definition at line 509 of file JniUtil.cpp.

References pEnv.

Referenced by ~JniExceptionChecker().

00510 {
00511     jthrowable excn = pEnv->ExceptionOccurred();
00512     if (excn) {
00513         pEnv->ExceptionClear();
00514         throw JavaExcn(excn);
00515     }
00516 }

JNIEnv* JniExceptionChecker::operator-> (  )  const [inline]

Definition at line 59 of file JniUtil.h.

00060     {
00061         return pEnv;
00062     }


Member Data Documentation

JNIEnv* JniExceptionChecker::pEnv [private]

Definition at line 43 of file JniUtil.h.

Referenced by checkExceptions().


The documentation for this class was generated from the following files:
Generated on Mon Jun 22 04:00:33 2009 for Fennel by  doxygen 1.5.1