4. Cleanly disconnect from the IPC system when the program quits.
Is there a way that I can capture the Quit message in the
CFRunLoop, or invoke the JVM with the Carbon loop? (Or even better,
does cmd-Q/Quit menu item generate a BSD signal I can capture
before my program dies?)
It usually generates an AppleEvent you can capture, Apple provides
the com.apple.eawt package for handling some of the events from java.
Like...
addApplicationListener(new ApplicationAdapter() {
public void handleOpenFile(ApplicationEvent e) {
System.out.println(e.getFilename() + "\nFEED ME ANOTHER!");
}
public void handleQuit(ApplicationEvent e) {
System.out.println("URP!");
System.exit(0);
}
});
Java could tell your native code that it's time to disconnect I would
think before the jvm itself is gone?
Or install a native event handler for the quit event. I'm not sure
where I have any laying around but there should be many examples on
the Apple site.
Unless this code doesn't receive AppleEvent's for some reason, Then,
sorry, never mind, I am not exactly familiar with what you're doing.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden
This email sent to email@hidden