Administrating a WOApp from Mac OS X
Administrating a WOApp from Mac OS X
- Subject: Administrating a WOApp from Mac OS X
- From: petite_abeille <email@hidden>
- Date: Fri, 24 Oct 2003 17:14:20 +0200
Hello,
While WebObjects provides a tool to control WOApps, sometime it's nice
to be able to do basic administrative tasks from the comfort of a
native application.
Here is some ideas on how to stop and start a java web application from
a System Preference Pane.
Mandatory screenshot:
http://zoe.nu/contents/ZOEPreference.jpg
Stopping a java application is very straightforward: get it's PID and
send the relevant signal to the process. This should cleanly shutdown
the JVM instance running your app. If your app needs to do anything
before exiting the JVM, check java.lang.Runtime.addShutdownHook().
Starting a java web app is slightly more convoluted, but easy enough.
The first thing you will need to know is what to execute to start your
application: is it the jar itself, a shell script or something else.
Whatever you end up using you will need to know it location. If your
web app is packaged as an executable jar, you can use
java.util.prefs.Preferences to advertise it existence to the rest of
the system. On Mac OS X, this will result in a standard plist file
getting created under ~/Library/Preferences. You can then read this
plist using NSUserDefaults and start your app with a one liner:
[[NSWorkspace sharedWorkspace] openFile: aPath]
Et voila. You are done. Managing an app remotely is left as an exercise
to the reader. Alternatively, and if you are running Mac OS X Server,
you may want to consider extending the server admin panel instead.
Cheers,
PA.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.