CACAO
gnu_java_lang_management_VMRuntimeMXBeanImpl.cpp
Go to the documentation of this file.
1 /* src/native/vm/gnuclasspath/gnu_java_lang_management_VMRuntimeMXBeanImpl.cpp
2 
3  Copyright (C) 1996-2013
4  CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
5 
6  This file is part of CACAO.
7 
8  This program is free software; you can redistribute it and/or
9  modify it under the terms of the GNU General Public License as
10  published by the Free Software Foundation; either version 2, or (at
11  your option) any later version.
12 
13  This program is distributed in the hope that it will be useful, but
14  WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this program; if not, write to the Free Software
20  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21  02110-1301, USA.
22 
23 */
24 
25 
26 #include "config.h"
27 
28 #include <stdint.h>
29 
30 #include "native/jni.hpp"
31 #include "native/native.hpp"
32 
33 #include "toolbox/logging.hpp"
34 
35 #if defined(ENABLE_JNI_HEADERS)
36 # include "native/vm/include/gnu_java_lang_management_VMRuntimeMXBeanImpl.h"
37 #endif
38 
39 #include "vm/array.hpp"
40 #include "vm/jit/builtin.hpp"
41 #include "vm/global.hpp"
42 #include "vm/globals.hpp"
43 #include "vm/utf8.hpp"
44 #include "vm/vm.hpp"
45 
46 
47 // Native functions are exported as C functions.
48 extern "C" {
49 
50 /*
51  * Class: gnu/java/lang/management/VMRuntimeMXBeanImpl
52  * Method: getInputArguments
53  * Signature: ()[Ljava/lang/String;
54  */
56 {
57  log_println("Java_gnu_java_lang_management_VMRuntimeMXBeanImpl_getInputArguments: IMPLEMENT ME!");
58 
60 
61  return oa.get_handle();
62 }
63 
64 
65 /*
66  * Class: gnu/java/lang/management/VMRuntimeMXBeanImpl
67  * Method: getStartTime
68  * Signature: ()J
69  */
71 {
72  return VM::get_current()->get_starttime();
73 }
74 
75 } // extern "C"
76 
77 
78 /* native methods implemented by this file ************************************/
79 
80 static JNINativeMethod methods[] = {
81  { (char*) "getInputArguments", (char*) "()[Ljava/lang/String;", (void*) (uintptr_t) &Java_gnu_java_lang_management_VMRuntimeMXBeanImpl_getInputArguments },
82  { (char*) "getStartTime", (char*) "()J", (void*) (uintptr_t) &Java_gnu_java_lang_management_VMRuntimeMXBeanImpl_getStartTime },
83 };
84 
85 
86 /* _Jv_gnu_java_lang_management_VMRuntimeMXBeanImpl_init ***********************
87 
88  Register native functions.
89 
90 *******************************************************************************/
91 
93 {
94  Utf8String u = Utf8String::from_utf8("gnu/java/lang/management/VMRuntimeMXBeanImpl");
95 
98 }
99 
100 
101 /*
102  * These are local overrides for various environment variables in Emacs.
103  * Please do not remove this and leave it at the end of the file, where
104  * Emacs will automagically detect them.
105  * ---------------------------------------------------------------------
106  * Local variables:
107  * mode: c++
108  * indent-tabs-mode: t
109  * c-basic-offset: 4
110  * tab-width: 4
111  * End:
112  * vim:noexpandtab:sw=4:ts=4:
113  */
Table containing all native methods registered with the VM.
Definition: native.hpp:132
NativeMethods & get_nativemethods()
Definition: vm.hpp:128
void register_methods(Utf8String classname, const JNINativeMethod *methods, size_t count)
Register native methods with the VM.
Definition: native.cpp:242
static JNINativeMethod methods[]
_Jv_JNIEnv JNIEnv
Definition: jni.hpp:112
virtual java_handle_array_t * get_handle() const
Definition: array.hpp:103
#define NATIVE_METHODS_COUNT
Definition: native.hpp:45
Actual implementation of access class for Java Object arrays.
Definition: array.hpp:381
void log_println(const char *text,...)
Definition: logging.cpp:193
void _Jv_gnu_java_lang_management_VMRuntimeMXBeanImpl_init(void)
JNIEXPORT int64_t JNICALL Java_gnu_java_lang_management_VMRuntimeMXBeanImpl_getStartTime(JNIEnv *env, jclass clazz)
int64_t get_starttime()
Definition: vm.hpp:110
static Utf8String from_utf8(const char *, size_t)
Definition: utf8.cpp:335
classinfo * class_java_lang_String
Definition: globals.cpp:39
JNIEXPORT java_handle_objectarray_t *JNICALL Java_gnu_java_lang_management_VMRuntimeMXBeanImpl_getInputArguments(JNIEnv *env, jclass clazz)
static VM * get_current()
Definition: vm.hpp:99