JVMWrapper.h

00001 /*
00002  * @(#)JVMWrapper.h  0.2.0 / 2007-09-11
00003  *
00004  * Copyright (c) 2007, ETF and contributors. All rights reserved.
00005  *
00006  * This software is licensed under the LGPL, version 2.1, license.
00007  * A copy of the license is included in the file LICENSE-LGPL.txt.
00008  */
00009 #ifndef JVMWRAPPER_H
00010 #define JVMWRAPPER_H
00011 
00012 #include "JavaQxCommon.h"
00013 
00014 /*^**************************************************************************^*/
00015 /*- JVMWrapper Class.                                                        -*/
00016 /*^**************************************************************************^*/
00017 
00024 class JAVAQX_EXPORT JVMWrapper
00025 {
00026 public:
00027   static void initialize(JavaVM *jvm);
00028   static JNIEnv *getEnv();
00029   static void exit(int status = -1);
00030   static void exitCritical(int status = -1);
00031   static bool attachCurrentThread();
00032   static bool detachCurrentThread();
00033 private:
00034   void static exitJVM(JNIEnv *env, int status);
00035 private:
00036   static JavaVM *sm_jvm;
00037 };
00038 
00039 #endif // JVMWRAPPER_H
00040 
00041 /*^*****************************************************************************
00042   File History:
00043 
00044  - 2007-09-11 17:57:48 Slobodan
00045    Initial version
00046 
00047 *****************************************************************************^*/

Copyright © 2007 ETF and contributors. All Rights Reserved.