It can certainly be done; I did something exactly analogous ~7 years ago for C++ & Carbon. Basically, you can use the JNI to instantiate a Java runtime instance within your program, then use JNI to call through to Java object instances. Backing out a bit, you can create your own proxy classes whose instances hold a reference to a Java object, and have methods that mirror those of the Java object, and just delegate to the Java object via the JNI. Backing out one more step, you can use reflection to automatically generate a wrapper class for any Java class. Backing out one more step, for a given Javan class, you can generate wrapper classes for any Java class returned by or taken as an argument by a method of that class, recursively. As for memory management, your proxies would be reference-counted like normal Objective-C instances, and on dealloc they would release their Java delegate objects.
There's some work involved, that's for sure. But it's really not all that complicated. One suggestion specific to your stated plan: forget any special annotations for methods, just generate methods in the Objective-C proxy for all methods in the Java class. -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567 voice _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com