179 |
raise "Cannot transition to #{state} from #{currentState}" |
raise "Cannot transition to #{state} from #{currentState}" |
180 |
end |
end |
181 |
@base_slot["state"].data = state |
@base_slot["state"].data = state |
182 |
|
self["log/info"] << "State transition: #{currentState} -> #{state}" |
183 |
end |
end |
184 |
|
|
185 |
## |
## |
187 |
# |
# |
188 |
def load |
def load |
189 |
transition(LOADING) |
transition(LOADING) |
|
self["log/info"] << "Loading" |
|
190 |
begin |
begin |
191 |
require @require_file if @require_file |
require @require_file if @require_file |
192 |
rescue => error |
rescue => error |
202 |
# |
# |
203 |
def start |
def start |
204 |
transition(STARTING) |
transition(STARTING) |
|
self["log/info"] << "Starting" |
|
205 |
eval(@startup_module).start(self) |
eval(@startup_module).start(self) |
206 |
end |
end |
207 |
|
|
210 |
# |
# |
211 |
def stop |
def stop |
212 |
transition(STOPPING) |
transition(STOPPING) |
|
self["log/info"] << "Stopping" |
|
213 |
eval(@startup_module).stop(self) |
eval(@startup_module).stop(self) |
214 |
end |
end |
215 |
|
|
218 |
# |
# |
219 |
def unload |
def unload |
220 |
transition(UNLOADING) |
transition(UNLOADING) |
|
self["log/info"] << "Unloading" |
|
221 |
eval(@startup_module).unload(self) |
eval(@startup_module).unload(self) |
222 |
end |
end |
223 |
|
|