Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 'use strict'; | 1 'use strict'; |
2 | 2 |
3 /** | 3 /** |
4 * The database models. | 4 * The database models. |
5 * | 5 * |
6 * @module models | 6 * @module models |
7 */ | 7 */ |
8 | 8 |
9 YUI.add('juju-models', function(Y) { | 9 YUI.add('juju-models', function(Y) { |
10 | 10 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
89 } | 89 } |
90 } | 90 } |
91 }); | 91 }); |
92 models.Environment = Environment; | 92 models.Environment = Environment; |
93 | 93 |
94 var ALIVE = 'alive'; | 94 var ALIVE = 'alive'; |
95 | 95 |
96 var Service = Y.Base.create('service', Y.Model, [], { | 96 var Service = Y.Base.create('service', Y.Model, [], { |
97 | 97 |
98 /** | 98 /** |
99 Return true if this service life is "alive", false otherwise. | 99 Return true if this service life is "alive", false otherwise. |
benji
2013/04/17 12:37:59
It might be nice to explain (ether here or in "ali
gary.poster
2013/04/17 12:54:26
+1
frankban
2013/04/17 13:39:01
Done.
| |
100 | |
101 A model instance is alive if its life cycle (i.e. the "life" attribute) | |
102 is set to "alive". Other possible values, as they arrive from the | |
103 juju-core delta stream, are "dying" and "dead", in which cases the | |
104 service is not considered alive. | |
100 | 105 |
101 @method isAlive | 106 @method isAlive |
102 @return {Boolean} Whether this service is alive. | 107 @return {Boolean} Whether this service is alive. |
103 */ | 108 */ |
104 isAlive: function() { | 109 isAlive: function() { |
105 return this.get('life') === ALIVE; | 110 return this.get('life') === ALIVE; |
106 } | 111 } |
107 | 112 |
108 }, { | 113 }, { |
109 ATTRS: { | 114 ATTRS: { |
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
724 'datasource-io', | 729 'datasource-io', |
725 'datasource-jsonschema', | 730 'datasource-jsonschema', |
726 'io-base', | 731 'io-base', |
727 'json-parse', | 732 'json-parse', |
728 'juju-delta-handlers', | 733 'juju-delta-handlers', |
729 'juju-endpoints', | 734 'juju-endpoints', |
730 'juju-view-utils', | 735 'juju-view-utils', |
731 'juju-charm-models' | 736 'juju-charm-models' |
732 ] | 737 ] |
733 }); | 738 }); |
LEFT | RIGHT |