summaryrefslogtreecommitdiff
path: root/js/dojo-1.7.2/dojox/app/module/lifecycle.js
blob: d44446350b5bb5899061502b0deb8fcb82af3eab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//>>built
define("dojox/app/module/lifecycle", ["dojo/_base/declare", "dojo/_base/connect"], function(declare, connect){
    return declare(null, {
    
        lifecycle: {
            UNKNOWN: 0, //unknown
            STARTING: 1, //starting
            STARTED: 2, //started
            STOPPING: 3, //stopping
            STOPPED: 4 //stopped
        },
        
        _status: 0, //unknown
        
        getStatus: function(){
            return this._status;
        },
        
        setStatus: function(newStatus){
            this._status = newStatus;
            
            // publish /app/stauts event.
            // application can subscribe this event to do some status change operation.
            connect.publish("/app/status", [newStatus]);
        }
    });
});