Merge branch 'master' into resource-container
[platform/upstream/iotivity.git] / service / resource-container / android / resource-container / src / main / java / org / iotivity / service / resourcecontainer / RcsObject.java
1 /******************************************************************
2  *
3  * Copyright 2015 Samsung Electronics All Rights Reserved.
4  *
5  *
6  *
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
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  ******************************************************************/
20 package org.iotivity.service.resourcecontainer;
21
22 public class RcsObject {
23     /*static {
24         System.loadLibrary("gnustl_shared");
25         System.loadLibrary("oc_logger");
26         System.loadLibrary("connectivity_abstraction");
27         System.loadLibrary("ca-interface");
28         System.loadLibrary("octbstack");
29         System.loadLibrary("oc");
30         System.loadLibrary("rcs_client");
31         System.loadLibrary("rcs_server");
32         System.loadLibrary("rcs_common");
33         System.loadLibrary("rcs_jni");
34     }*/
35
36     private long mNativeHandle;
37
38     private native void nativeDispose();
39
40     protected RcsObject() {
41     }
42
43     @Override
44     protected void finalize() throws Throwable {
45         super.finalize();
46
47         dispose();
48     }
49
50     protected void dispose() {
51         if (mNativeHandle != 0L) nativeDispose();
52     }
53
54     protected boolean hasHandle() {
55         return mNativeHandle != 0L;
56     }
57 }