shopping cart
Save up to 30% on our Staff Picks
Call us:  800-878-7323 HELP
McAfee SECURE helps keep you safe from identity theft, credit card fraud, spyware, spam, viruses and online scams.
Interviews | November 19, 2009

Dave: IMG Finding John Irving: The Powells.com Interview



johnirving[Editor's note: The following is a reprint of our 2005 interview with John Irving, whose new novel, Last Night in Twisted River, has just come out... Continue »
  1. $19.60 Sale Hardcover add to wish list

Ships free on qualified orders.
Add to Cart
$42.95
New Trade Paper
Ships in 1 to 3 days
Add to Wishlist
available for shipping or prepaid pickup only
Available for In-store Pickup
in 7 to 12 days
Qty Store Section
1 Remote Warehouse Computer Languages- Java

More copies of this ISBN:

Java(tm) Native Interface: Programmer's Guide and Specification (Java)

by Sheng Liang

Java(tm) Native Interface: Programmer's Guide and Specification (Java) Cover

Synopses & Reviews

Publisher Comments:

The Java Native Interface (JNI) enables the integration of code written in the Java programming language with code written in other languages such as C and C++. It allows programmers to take full advantage of the Java platform without having to abandon their investment in legacy code.

This book is the definitive resource and a comprehensive guide to working with the JNI. Entirely up-to-date, the book offers a tutorial, a detailed description of JNI features and programming techniques, JNI design justifications, and the official specification for all JNI types and functions.

You will find coverage of important topics such as:

  • Writing native methods
  • Passing data types between the Java language and native programming languages
  • Embedding a Java virtual machine implementation in native applications
  • Leveraging legacy native libraries
  • Improving the efficiency and reliability of your code

An entire chapter is devoted to avoiding common traps and pitfalls. The book uses numerous examples to illustrate programming techniques that have proven to be effective.

0201325772B04062001

Book News Annotation:

A staff engineer in Java at Sun Microsystems, Liang explains how programmers can integrate code written in the Java programming language with code written in other languages such as C and C++, thus allowing them to take full advantage of the Java platform without having to abandon their investment in legacy code. In addition to a tutorial, he provides descriptions of the interface's features and programming techniques, design justifications, and official specifications, but no bibliography.
Annotation c. Book News, Inc., Portland, OR (booknews.com)

About the Author

Sheng Liang, a staff engineer in Java Software at Sun Microsystems, Inc., designed the JNI and led the Java virtual machine development for the first release of the Java 2 platform. He holds a Ph.D. in computer science from Yale University.

0201325772AB04062001

Table of Contents

I. INTRODUCTION AND TUTORIAL.

1. Introduction.

The Java Platform and Host Environment. Role of the JNI. Implications of Using the JNI. When to Use the JNI. Evolution of the JNI. Example Programs.

2. Getting Started.

Overview. Declare the Native Method. Compile the HelloWorld Class. Create the Native Method Header File. Write the Native Method Implementation. Compile the C Source and Create a Native Library. Run the Program.

II. PROGRAMMER'S GUIDE.

3. Basic Types, Strings, and Arrays.

A Simple Native Method. Accessing Strings. Accessing Arrays.

4. Fields and Methods.

Accessing Fields. Calling Methods. Invoking Constructors. Caching Field and Method Ids. Performance of JNI Field and Method Operations.

5. Local and Global References.

Local and Global References. Freeing References. Rules for Managing References.

6. Exceptions.

Overview. Proper Exception Handling.

7. The Invocation Interface.

Creating the Java Virtual Machine. Linking Native Applications with the Java Virtual Machine. Attaching Native Threads.

8. Additional JNI Features.

JNI and Threads. Writing Internationalized Code. Registering Native Methods. Load and Unload Handlers. Reflection Support. JNI Programming in C++.

9. Leveraging Existing Native Libraries.

One-to-One Mapping. Shared Stubs. One-to-One Mapping versus Shared Stubs. Implementation of Shared Stubs. Peer Classes.

10. Traps and Pitfalls.

Error Checking. Passing Invalid Arguments to JNI Functions. Confusing jclass with jobject. Truncating jboolean Arguments. Boundaries between Java Application and Native Code. Confusing IDs with References. Caching Field and Method Ids. Terminating Unicode Strings. Violating Access Control Rules. Disregarding Internationalization. Retaining Virtual Machine Resources. Excessive Local Reference Creation. Using Invalid Local References. Using the JNIEnv across Threads. Mismatched Thread Models.

III. SPECIFICATION.

11. Overview of the JNI Design.

Design Goals. Loading Native Libraries. Linking Native Methods. Calling Conventions. The JNIEnv Interface Pointer. Passing Data. Accessing Objects. Errors and Exceptions.

12. JNI Types.

Primitive and Reference Types. Field and Method Ids. String Formats. Constants.

13. JNI Functions.

Summary of the JNI Functions. Specification of JNI Functions.

Index. 0201325772T04062001


Product Details

ISBN:
9780201325775
Subtitle:
tm Native Interface: Programmer's Guide and Specification
Author:
Liang, Sheng
Publisher:
Addison-Wesley Professional
Location:
Reading, Mass.
Subject:
Programming Languages - General
Subject:
Java (Computer program language)
Subject:
Programming Languages - Java
Subject:
Java
Subject:
Java native interface
Copyright:
Edition Number:
1st
Edition Description:
Addison-Wesley
Series:
The Java Series
Binding:
Paperback
Grade Level:
Professional and scholarly
Language:
English
Illustrations:
Yes
Pages:
320
Dimensions:
9.17x7.32x.78 in. 1.18 lbs.

Other books you might like

  1. $47.25 New Trade Paper add to wish list
  2. $6.50 Used Trade Paper add to wish list
  3. $77.50 New Trade Paper add to wish list

Related Aisles

  • back to top

Powell's City of Books is an independent bookstore in Portland, Oregon, that fills a whole city block with more than a million new, used, and out of print books. Shop those shelves — plus literally millions more books, DVDs, and eBooks — here at Powells.com.