• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Administrating a WOApp from Mac OS X
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Mixing HTML & WO Pages?
  • Next by Date: Re: Mixing HTML & WO Pages?
  • Previous by thread: Re: Mixing HTML & WO Pages?
  • Next by thread: How to open a .pbproj with PB on Windows 2000 using WO 5.2?
  • Index(es):
    • Date
    • Thread