Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: ANNOUNCE: JavaNativeFoundation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ANNOUNCE: JavaNativeFoundation



On Oct 26, 2009, at 8:46 AM, Marian Bouček wrote:

> So this is probably replacement for deprecated Cocoa-Java bridge? I don't have much experience with this, but after quick look at JNF it looks like this. So there is no need to make special "Apple Java objects" to access Cocoa API, you just need to convert everything (even exceptions) to native objects using JNF? It looks great!

No, JavaNativeFoundation is not a replacement for the CocoaJava bridge. It's a native framework for JNI developers to ease their interactions with Cocoa (the Foundation classes, specifically). I won't help you unless you are writing a JNI library.

It contains helpers that convert (not wrap) basic object types between Java and Foundation for things like Strings, Numbers, Lists, Maps, and Sets. It also contains cover functions for all of the JNI get/set/call functions which also check if a Java exception occurred, and re-throw it as native ObjC exception. The JNF_COCOA_ENTER() and JNF_COCOA_EXIT() macros also setup/teardown autorelease pools and catch native ObjC exceptions, which are then re-thrown to Java.

We've written the Java runtime using this framework, and thought it would be useful for any other developers working at this level. In Xcode 3.2 (Snow Leopard), the "Java JNI Library" example also uses JavaNativeFoundation, so you should check that out if you want to see other aspects of JNF in action.

Cheers,
Mike Swingler
Java Runtime Engineer
Apple Inc.

> 2009/10/26 Mike Swingler <email@hidden>
>
> On Oct 20, 2009, at 5:05 AM, Andrew Thompson wrote:
>
> > ...
> >
> > Thanks for the information about JNFThread.h in the later part of your email.
>
> Also, we have real documentation on JavaNativeFoundation.framework now (thanks Docs guys!):
>
> Functions (all in one):
> <http://developer.apple.com/mac/library/documentation/CrossPlatform/Reference/JavaNativeFoundation_Functions>
>
> Type conversion classes:
> <http://developer.apple.com/mac/library/documentation/CrossPlatform/Reference/JNFTypeCoercion_Protocol>
> <http://developer.apple.com/mac/library/documentation/CrossPlatform/Reference/JNFTypeCoercer_Class>
> <http://developer.apple.com/mac/library/documentation/CrossPlatform/Reference/JNFDefaultCoercions_Class>
>
> Object and exception wrapping:
> <http://developer.apple.com/mac/library/documentation/CrossPlatform/Reference/JNFJObjectWrapper_Class>
> <http://developer.apple.com/mac/library/documentation/CrossPlatform/Reference/JNFException_Class>
>
> All other Java documentation:
> <http://developer.apple.com/mac/library/navigation/index.html#section=Topics&topic=Cross Platform>

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >ANNOUNCE: Submit Java Tasks to Grand Central Dispatch (GCDExecutorService) (From: Andrew Thompson <email@hidden>)
 >Re: ANNOUNCE: Submit Java Tasks to Grand Central Dispatch (GCDExecutorService) (From: Fabrizio Giudici <email@hidden>)
 >Re: ANNOUNCE: Submit Java Tasks to Grand Central Dispatch (GCDExecutorService) (From: Fabrizio Giudici <email@hidden>)
 >Re: ANNOUNCE: Submit Java Tasks to Grand Central Dispatch (GCDExecutorService) (From: Mike Swingler <email@hidden>)
 >Re: ANNOUNCE: Submit Java Tasks to Grand Central Dispatch (GCDExecutorService) (From: Fabrizio Giudici <email@hidden>)
 >Re: ANNOUNCE: Submit Java Tasks to Grand Central Dispatch (GCDExecutorService) (From: Andrew Thompson <email@hidden>)
 >Re: ANNOUNCE: Submit Java Tasks to Grand Central Dispatch (GCDExecutorService) (From: Mike Swingler <email@hidden>)
 >Re: ANNOUNCE: Submit Java Tasks to Grand Central Dispatch (GCDExecutorService) (From: Andrew Thompson <email@hidden>)
 >Re: ANNOUNCE: Submit Java Tasks to Grand Central Dispatch (GCDExecutorService) (From: Mike Swingler <email@hidden>)
 >Re: ANNOUNCE: Submit Java Tasks to Grand Central Dispatch (GCDExecutorService) (From: Marian Bouček <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.