source: Dev/branches/rest-dojo-ui/client/dojox/app/module/lifecycle.js @ 256

Last change on this file since 256 was 256, checked in by hendrikvanantwerpen, 13 years ago

Reworked project structure based on REST interaction and Dojo library. As
soon as this is stable, the old jQueryUI branch can be removed (it's
kept for reference).

File size: 750 bytes
Line 
1define(["dojo/_base/declare", "dojo/_base/connect"], function(declare, connect){
2    return declare(null, {
3   
4        lifecycle: {
5            UNKNOWN: 0, //unknown
6            STARTING: 1, //starting
7            STARTED: 2, //started
8            STOPPING: 3, //stopping
9            STOPPED: 4 //stopped
10        },
11       
12        _status: 0, //unknown
13       
14        getStatus: function(){
15            return this._status;
16        },
17       
18        setStatus: function(newStatus){
19            this._status = newStatus;
20           
21            // publish /app/stauts event.
22            // application can subscribe this event to do some status change operation.
23            connect.publish("/app/status", [newStatus]);
24        }
25    });
26});
Note: See TracBrowser for help on using the repository browser.