1 /******************************************************************
3 * Copyright 2015 Samsung Electronics All Rights Reserved.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
19 ******************************************************************/
22 * @file jni_easy_setup_jvm.h
24 * @brief This file contains the essential declarations and functions required
25 * for JNI implementation
28 #ifndef __JNI_EASY_SETUP_JVM_H_
29 #define __JNI_EASY_SETUP_JVM_H_
35 #define EASY_SETUP_SERVICE_NATIVE_API_CLASS_PATH "org/iotivity/service/easysetup/mediator/EasySetupManager"
36 #define EASY_SETUP_SERVICE_NATIVE_API_CLASS_TYPE "Lorg/iotivity/service/easysetup/mediator/EasySetupManager;"
37 #define EASY_SETUP_SERVICE_CALLBACK_NATIVE_API_CLASS_PATH "org/iotivity/service/easysetup/mediator/EasySetupCallbackHandler"
38 #define EASY_SETUP_SERVICE_CALLBACK_NATIVE_API_CLASS_TYPE "Lorg/iotivity/service/easysetup/mediator/EasySetupCallbackHandler;"
40 #define EASY_SETUP_JAVA_STRING_TYPE "Ljava/lang/String;"
41 #define EASY_SETUP_JAVA_INTEGER_TYPE "I"
45 * @brief This class provides functions related to JNI Environment.
58 * @brief Get JVM instance
60 static JNIEnv *getEnv();
63 * @brief Release aquired JVM instance
65 static void releaseEnv();
80 * Mutex for thread synchronization
82 static std::mutex m_currentThreadMutex;
88 jclass GetJClass(const char *szClassPath);
89 jobject GetJObjectInstance(const char *szClassPath);
93 #endif //__JNI_EASY_SETUP_JVM_H_