Using JDK splash screen from Web Start
Scott Kovatch
scott.kovatch at oracle.com
Wed May 2 09:38:26 PDT 2012
On May 2, 2012, at 8:35 AM, Anthony Petrov wrote:
> On 5/2/2012 7:08 PM, Scott Kovatch wrote:
>>> And yes, I think you have to do something similar to what we do in java_md.
>> Okay. I'm not a fan of replicating code like that, but if I have to, I have to.
>>> We decided to drop this idea because it would involve inter-process communication between the _spalsh and java processes because a java app may want to manipulate the splash screen. I'm not saying that this is impossible to implement, but it looks like too much of an effort for such a toy feature as the splash screen. Besides, I don't see why would such an approach be preferable to what we have already implemented, why would we have to re-implement it. Are there any issues with the current implementation?
>> In general, no. I had no problems with using the splash feature in a simple AWT app. It's just that I won't be able to reuse as much code as I thought to implement a small feature, and that leaves me grouchy. :-)
>> Web Start, in fact, does exactly the kind of cross-process communication you describe to hide the splash screen after a short delay.
>
> Well, one thing is to send a simple "hide" signal through the IPC, and the other one is to update the rendered image dynamically, which seems to be slightly more heavyweight than sending a simple signal, eh? :) I investigated this possibility actually, and there exist some memory restrictions for this kind of communication which complicates the matter even further. It just doesn't seem to be worth it.
>
> As to the code replication, why not export necessary functions from the Java Launcher dynamic library and call them from the WebStart? After all, the Web Start is actually a kind of a launcher, so there must be some room for code sharing I believe (perhaps in future releases only, but still.)
Web Start itself has no problems starting Java to do its work -- it just calls 'java' with a list of arguments. The issue here is that for the splash screen we don't use the JVM's splash support. Web Start can run JREs back to at least 1.4.2, so we can't assume the JVM handles the splash option. So, we spawn another process and call 'javaws -splash <port> <filename>'. This calls the minimum set of splash routines and quits.
However, in the Mac implementation I ought to be able to remove that assumption since we won't be supporting older JREs. I tried passing along '-splash:<path>' with the other Web Start arguments and it worked fine. That's okay for AWT-based Web Start apps, but I'm concerned about JavaFX apps. I know libosxapp doesn't actually pull in the AWT, but now I need to test that JavaFX will work okay if it finds an NSApplicationAWT already started when Glass creates its application.
-- Scott K.
More information about the macosx-port-dev
mailing list