Accessing Native methods from a Java Applet
by Sanket Bakshi, s.bakshi@ebsolutech.com |
|
Previous
section: Table of Contents
o JNI
The Java security model is one of the key
architectural features that make Java a technology for networked environments.
This is necessary as the security is the major concern when the computer is
hooked to a network. Also, the Java code, many a times, has to be downloaded
onto the client machine before executing it, like in case of an applet or a
Jini service object. This makes the computer more vulnerable to network
attacks. The Java security model, better known as the Sandbox addresses this
security concern. In a Sandbox, all the code that comes from a source that is
not trusted is allowed to run in a restricted environment of the ‘Sandbox’.
This gives the code very few privileges and does not allow it to tamper with
the system. Operations like reading or writing a file or loading a native
library etc. performed by such code are strongly opposed by the Sandbox
architecture.
Digital
certificates are online documents that authenticate user identities, provide
the codes that encrypt and decrypt messages over the Web, and ensure that
transmitted data has not been altered.
A Certificate Authority (CA) is the Web-based
mechanism that distributes and revokes certificates and guarantees data
integrity by digitally "signing" a user's certificate.
The JNI
(Java Native Interface) technology is a practical extension of the NMI (Native
Method Interface) model provided in the JDK 1.0. The JNI allows a Java
programmer, access to any native resources. The JNI can be used to access
already written native code or in cases where platform dependant
functionalities not provided by Java are required or it can be even used when a
low level language – e.g. Assembly language, performs a critical task beyond
the scope of Java.
The Java
Plug-in software allows Java applets and Java Beans components to run in a
browser using Sun's Java Runtime Environment, instead of the browser's default
Java runtime. The Java Plug-in works with Netscape Navigator and Microsoft
Internet Explorer. The plug-in requires the <OBJECT> and <EMBED>
tags be embedded in the HTML page instead of the applet tag. This allows code compatibility
between the browsers as a common Runtime environment is created which works
independent of the browser.
Not all versions of Navigator and Explorer
understand signed applets. In fact, only the following do:
The above browser compatibility is valid only
for the Windows platform.
Many of the Java functions and facilities are
also not supported by all the browsers available. Like for instance, Internet
Explorer 4.0 does not support the use of JFC (Java Foundation Classes).
Nevertheless, the use of a Java Plug-in
reduces these compatibility problems to a great extent. The use of a plug-in as
mentioned earlier, runs the Java code in a Runtime Environment, which is common
for all the browsers. The Plug-in overrides the default JRE provided by the
browser.
Next section: Normal
Applet Capabilities
Table of Contents
©
2001 – EBSolute Technologies