From: Paul P. <bay...@gm...> - 2010-07-12 05:22:43
|
Regarding categories & cross-compiling the original JRE classes, I am trying to implement: wait() wait(long) notify() notifyAll() 1) If cross-compiling the original JRE, we will of course still need to implement the native methods, including java.lang.Object's wait/notify 2) Unfortunately my implementation of wait/notify requires me to keep some state in java_lang_Object & I cannot do so since it is a category. Is there a way around this in XMLVM's current state? I believe I have everything written out, although it's a theoretical solution right now. However, because I need member variables, I cannot try it out without changing java_lang_Object to inherit from NSObject rather than be a category. That causes other issues though. For example, many XMLVM objects represented as categories of objective-c objects automatically share the benefits of java_lang_Object without explicitly saying so, as needed. Using inheritance for java_lang_Object instead of categories removes this currently necessary benefit. Does anyone have any suggestions? If we can get that working, implementing Thread interruptions shouldn't be very difficult building upon this. Thanks! Paul Poley On Sun, Jul 11, 2010 at 6:47 AM, Arno Puder <ar...@pu...> wrote: > > there are always trait-offs when you map from one platform to another. > The efficiency of using categories comes with the downside you've > described. > > We are currently working on cross-compiling the original JRE classes > from OpenJDK. For one, it would give us instant 100% compatibility and > the issues you have described would also be resolved. Note that this is > ongoing work and will take some time to complete. > > Arno > > > On 7/7/10 7:31 PM, bar...@ao... wrote: > > > > I think that having java_util_ArrayList.m be a category on > > NSMutableArray is a clever use of categories, but wouldn't encapsulation > > generally be a more flexible option? One potential issue I see with the > > category approach is that since java_util_ArrayList.m and > > java_util_LinkedList.m are both categories on NSMutableArray, what > > happens if the client java code relies on checking the kind of the list > > using reflection? Won't java_util_ArrayList and java_util_LinkedList > > then be indistinguishable from each other at runtime? > > > > The same goes for the other classes where categories are used: String, > > StringBuffer, HashMap/Set, URI/URL, etc. > > > > > > > > > ------------------------------------------------------------------------------ > > This SF.net email is sponsored by Sprint > > What will you do first with EVO, the first 4G phone? > > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > > > > > > > > _______________________________________________ > > xmlvm-users mailing list > > xml...@li... > > https://lists.sourceforge.net/lists/listinfo/xmlvm-users > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > xmlvm-users mailing list > xml...@li... > https://lists.sourceforge.net/lists/listinfo/xmlvm-users > |