Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Programming \ Role Object of registerNatives () method     - A drop datafile Oracle bug (Database)

- Mistakenly deleted redo log file group being given the lead to start the database ORA-03113 (Database)

- Based on Google Cloud Storage Mirroring open Maven Central Repository (Server)

- Gentoo: existing preserved libs problem solving (Linux)

- OpenSSH version smooth upgrade method (Linux)

- installation of Vim plugin YouCompleteMe under Ubuntu 15.04 (Linux)

- Ubuntu 15.10 under Python + Apache + CGI fully configured (Server)

- Ubuntu Slingscold (Linux)

- C ++ in the elimination Wunused (Programming)

- SpringMVC the use of interceptors (Programming)

- File upload via AngularJS and ASP.NET MVC5 (Programming)

- GO five stages of language learning (Programming)

- Ubuntu 12.04 installation DHCP Server (Server)

- Linux start the process (Linux)

- Java memory area and memory overflow exception (Programming)

- MYSQL root password for the database user passwords are weak attack analysis (Linux)

- Windows 8.1 and Ubuntu 14.04 dual system uninstall Ubuntu Tutorial (Linux)

- JavaScript file loader LABjs API Explanation (Programming)

- Security basics: simple analytical framework for Linux system firewall (Linux)

- JavaScript property of checkbox.disabled (Programming)

 
         
  Role Object of registerNatives () method
     
  Add Date : 2017-08-31      
         
         
         
  Typically, in order to find your JVM native functionality, they are named in a certain way. For example, for java.lang.Object.registerNatives, corresponding to the C function named Java_java_lang_Object_registerNatives. By using registerNatives (or, more precisely, JNI function RegisterNatives), you can name whatever you want your C functions.

Here is the relevant C code (from OpenJDK6):

static JNINativeMethod methods [] = {

{ "HashCode", "() I", (void *) & JVM_IHashCode},

{ "Wait", "(J) V", (void *) & JVM_MonitorWait},

{ "Notify", "() V", (void *) & JVM_MonitorNotify},

{ "NotifyAll", "() V", (void *) & JVM_MonitorNotifyAll},

{ "Clone", "() Ljava / lang / Object;", (void *) & JVM_Clone},

};

JNIEXPORT void JNICALL

Java_java_lang_Object_registerNatives (JNIEnv * env, jclass cls)

{

(* Env) -> RegisterNatives (env, cls, methods, sizeof (methods) / sizeof (methods [0]));

}

(Please note, Object.getClass is not on the list; it is still called Java_java_lang_Object_getClass "standard" name.) For the listed features, as related to C functions in the table, which is more than writing a bunch of handy forwarding .

If you are embedding Java in C program and want to link within the program itself to this function, register the local function it is also useful, because they usually do not find the mechanism by standard methods to be found. Registration of Local functions can also be used to "rebind" a native method to another C function (which can be useful if your application supports dynamic loading and unloading modules).
     
         
         
         
  More:      
 
- OpenWRT environment to build (Linux)
- Linux network security strategy (Linux)
- Computer security perimeter recommendations (Linux)
- Linux / Unix: chroot command examples to explain (Linux)
- How to install Unbound and DNSCrypt in Archlinux (Server)
- Redis configuration file interpretation (Database)
- Linux system security (Linux)
- Java, on the dfile.encoding Systemproperty (Programming)
- Linux System Getting Started Learning: DeVeDe installed on Linux to create a video DVD (Linux)
- Troubleshooting Linux virtual machine device id and the letter of inconsistencies (Linux)
- Docker: installation under Ubuntu (Server)
- Ubuntu install video playback software SMPlayer 14.9.0.7042 (Linux)
- Ubuntu How to install and upgrade Linux Kernel 3.15 (Linux)
- Java uses JDBC connect database (Programming)
- Create several practical points of high security PHP site (Linux)
- MySQL server after an unexpected power outage can not start (Database)
- CentOS install SVN server configuration and automatically synchronized to the Web directory (Server)
- MySQL use benchmarking tool sysbench (Database)
- The hashcode method of Java (Programming)
- Java factory pattern (Factory mode) (Programming)
     
           
     
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.