X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=android%2Fandroid_api%2Fbase%2Fjni%2FJniOcRequestHandle.cpp;h=b916490d8f10285c1c0bd3aad27beda94fd5b07a;hb=17c68b2fd1e74586f85e552eeab4e32dc121f8a0;hp=444689d829ddf341c2bd70b5c8000f7dc67911cb;hpb=8c01dff2c5bc5496f7dc1632c498943ec6ecb015;p=platform%2Fupstream%2Fiotivity.git diff --git a/android/android_api/base/jni/JniOcRequestHandle.cpp b/android/android_api/base/jni/JniOcRequestHandle.cpp index 444689d..b916490 100644 --- a/android/android_api/base/jni/JniOcRequestHandle.cpp +++ b/android/android_api/base/jni/JniOcRequestHandle.cpp @@ -1,63 +1,63 @@ -/* -* //****************************************************************** -* // -* // Copyright 2015 Intel Corporation. -* // -* //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -* // -* // Licensed under the Apache License, Version 2.0 (the "License"); -* // you may not use this file except in compliance with the License. -* // You may obtain a copy of the License at -* // -* // http://www.apache.org/licenses/LICENSE-2.0 -* // -* // Unless required by applicable law or agreed to in writing, software -* // distributed under the License is distributed on an "AS IS" BASIS, -* // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* // See the License for the specific language governing permissions and -* // limitations under the License. -* // -* //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ -#include "JniOcRequestHandle.h" - -JniOcRequestHandle::JniOcRequestHandle(OCRequestHandle requestHandle) : m_requestHandle(requestHandle) -{} - -JniOcRequestHandle::~JniOcRequestHandle() -{ - LOGD("~JniOcRequestHandle()"); -} - -JniOcRequestHandle* JniOcRequestHandle::getJniOcRequestHandlePtr -(JNIEnv *env, jobject thiz) -{ - JniOcRequestHandle *handle = GetHandle(env, thiz); - if (env->ExceptionCheck()) - { - LOGE("Failed to get native handle from OcRequestHandle"); - } - if (!handle) - { - ThrowOcException(JNI_NO_NATIVE_POINTER, ""); - } - return handle; -} - -OCRequestHandle JniOcRequestHandle::getOCRequestHandle() -{ - return this->m_requestHandle; -} - -/* -* Class: org_iotivity_base_OcRequestHandle -* Method: dispose -* Signature: ()V -*/ -JNIEXPORT void JNICALL Java_org_iotivity_base_OcRequestHandle_dispose -(JNIEnv *env, jobject thiz) -{ - LOGD("OcRequestHandle_dispose"); - JniOcRequestHandle *handle = JniOcRequestHandle::getJniOcRequestHandlePtr(env, thiz); - delete handle; +/* +* //****************************************************************** +* // +* // Copyright 2015 Intel Corporation. +* // +* //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +* // +* // Licensed under the Apache License, Version 2.0 (the "License"); +* // you may not use this file except in compliance with the License. +* // You may obtain a copy of the License at +* // +* // http://www.apache.org/licenses/LICENSE-2.0 +* // +* // Unless required by applicable law or agreed to in writing, software +* // distributed under the License is distributed on an "AS IS" BASIS, +* // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* // See the License for the specific language governing permissions and +* // limitations under the License. +* // +* //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ +#include "JniOcRequestHandle.h" + +JniOcRequestHandle::JniOcRequestHandle(OCRequestHandle requestHandle) : m_requestHandle(requestHandle) +{} + +JniOcRequestHandle::~JniOcRequestHandle() +{ + LOGD("~JniOcRequestHandle()"); +} + +JniOcRequestHandle* JniOcRequestHandle::getJniOcRequestHandlePtr +(JNIEnv *env, jobject thiz) +{ + JniOcRequestHandle *handle = GetHandle(env, thiz); + if (env->ExceptionCheck()) + { + LOGE("Failed to get native handle from OcRequestHandle"); + } + if (!handle) + { + ThrowOcException(JNI_NO_NATIVE_POINTER, ""); + } + return handle; +} + +OCRequestHandle JniOcRequestHandle::getOCRequestHandle() +{ + return this->m_requestHandle; +} + +/* +* Class: org_iotivity_base_OcRequestHandle +* Method: dispose +* Signature: ()V +*/ +JNIEXPORT void JNICALL Java_org_iotivity_base_OcRequestHandle_dispose +(JNIEnv *env, jobject thiz) +{ + LOGD("OcRequestHandle_dispose"); + JniOcRequestHandle *handle = JniOcRequestHandle::getJniOcRequestHandlePtr(env, thiz); + delete handle; } \ No newline at end of file