
| Direct Action | Return Values | Description |
|---|---|---|
| running | 'YES', 'NO', or error message | checks whether instances are running (alive) |
| stopped | checks whether instances have stopped (are dead) | |
| start | 'OK' or error message | attempts to start instances which have been stopped or are stopping |
| stop | attempts to stops instances which are running or starting | |
| forceQuit | stops instances forcefully | |
| turnAutoRecoverOn | 'OK' or error message | turns Auto Recover on |
| turnAutoRecoverOff | turns Auto Recover off | |
| turnRefuseNewSessionsOn | 'OK' or error message | turns Refuse New Sessions on |
| turnRefuseNewSessionsOff | turns Refuse New Sessions off | |
| turnScheduledOn | 'OK' or error message | turns Scheduled on |
| turnScheduledOff | turns Scheduled off | |
| clearDeaths | 'OK' or error message | sets the number of deaths to 0 |
| bounce | 'OK' or error message | bounces the application (starts a few instances per hosts, set the rest to refusing sessions and auto-recover) |
| info | JSON or error message | returns a JSON encoded list of instances with all the data from the app detail page. Add form value info=full to also return the Additional Arguments. |
All direct actions must be invoked with a type:
| Type | Description | Requires Names |
|---|---|---|
| all | all instances of all applications | no |
| app | all instances of the specified applications | yes |
| ins | all the specified instances |
The direct action 'running' can be invoked with a num argument:
| Num | Description |
|---|---|
| all / -1 | all instances of the application must be running. this is the default if no num argument is set |
| number | a minimum of number instances of the specified application must be running. if there are less instances configured acts like 'all' |
The direct action 'bounce' can be invoked with additional arguments:
| Argument | Value | Description |
|---|---|---|
| bouncetype | graceful | shutdown | graceful bounces the application by starting a few instances per host and setting the rest to refusing sessions shutdown bounces the application by stopping all instances and then restarting them (use this if your application will migrate the database so the old application will crash) The default bouncetype is graceful. |
| maxwait | secs | number of seconds to wait for applications to shut down themselves before force quitting the instances. The default is 30 seconds. |
Possible status codes:
| Code | Circumstance |
|---|---|
| 200 (OK) | return value is 'OK' or 'YES' |
| 403 (Unauthorized) | Monitor is password protected |
| 404 (Not Found) | one or more of the supplied application or instance names can't be found |
| 406 (Not Acceptable) | an unknown type is supplied, or names are required but missing |
| 417 (Not Expected) | return value is 'NO' |
| 500 (Error) | software defect (please send stacktrace from Monitor's log) |
Examples:
| URL | Description |
|---|---|
| .../JavaMonitor.woa/admin/start?type=app&name=AppleStore&name=MemberSite | Starts all instances of the AppleStore and the MemberSite applications. Returns error if any of these applications are unknown to Monitor, OK otherwise. |
| .../JavaMonitor.woa/admin/turnScheduledOff?type=all | Turns scheduling off for all instances of all applications, then returns OK. |
| .../JavaMonitor.woa/admin/stopped?type=ins&name=AppleStore-4&name= MemberSite-8&name=AppleStore-2 | Returns YES if the instances 2 and 4 of the AppleStore and instance 8 of the MemberSite are all dead. Returns NO if at least one of them has not stopped. Returns error if any of these instances are unknown to Monitor. |
A simple deployment script could look as follows:
#!/bin/sh |
Invoking direct actions manually:
curl -w " (status: %{http_code})\n" http://bigserver:1086/cgi-bin/WebObjects/JavaMonitor.woa/admin/forceQuit\?type=ins&name=AppleStore-3 |
| AdminAction | ( | WORequest | worequest | ) |
| void addInstancesForApplication | ( | MApplication | mapplication | ) | [protected] |
| AdminApplicationsPage applicationsPage | ( | ) | [protected] |
| WOActionResults bounceAction | ( | ) |
| void clearDeathsAction | ( | ) |
| void forceQuitAction | ( | ) |
| WOActionResults infoAction | ( | ) |
| WOComponent MainAction | ( | ) |
| Session mySession | ( | ) |
| WOActionResults performActionNamed | ( | String | s | ) |
| WOActionResults performMonitorActionNamed | ( | String | s | ) |
| void prepareApplications | ( | NSArray | nsarray | ) | [protected] |
| void prepareInstances | ( | NSArray | nsarray | ) | [protected] |
| void refreshInformation | ( | ) | [protected] |
| WOActionResults runningAction | ( | ) |
| MSiteConfig siteConfig | ( | ) | [private] |
| void startAction | ( | ) |
| void stopAction | ( | ) |
| WOActionResults stoppedAction | ( | ) |
| void turnAutoRecoverOffAction | ( | ) |
| void turnAutoRecoverOnAction | ( | ) |
| void turnRefuseNewSessionsOffAction | ( | ) |
| void turnRefuseNewSessionsOnAction | ( | ) |
| void turnScheduledOffAction | ( | ) |
| void turnScheduledOnAction | ( | ) |
WOTaskdHandler _handler [private] |
NSMutableArray applications [protected] |
AdminApplicationsPage applicationsPage [protected] |
NSMutableArray instances [protected] |
NSArray supportedActionNames [static, protected] |
Initial value:
1.5.8