| |
- ComponentLifecycle
- exceptions.Exception(exceptions.BaseException)
-
- ComponentLifecycleException
class ComponentLifecycle |
|
Class ComponentLifecycle is provided so that the developer does not have to
expose startup/shutdown methods in an IDL interface for their component.
If the component does inherit from this class, it should override at least
one method. Also, note that these methods should only raise
ComponentLifecycleException excepts. Any other exception will result in the
servant not being activated! |
|
Methods defined here:
- __init__(self)
- aboutToAbort(self)
- Called when due to some error condition the component is about to be
forcefully removed some unknown amount of time later (usually not very
much...).
The component should make an effort to die as neatly as possible.
Because of its urgency, this method will be called asynchronously to the execution of
any other method of the component.
Container will catch all exceptions.
Params: None.
Returns: Nothing.
- cleanUp(self)
- Called after the last functional call to the component has finished.
The component should then orderly release resources etc.
Must be implemented as a synchronous (blocking) call.
Container will catch all exceptions.
Params: None.
Returns: Nothing.
- execute(self)
- Called after initialize to tell the component that it has to be ready
to accept incoming functional calls at any time.
Examples:
- last-minute initializations for which initialize seemed too early
- component could start actions which arent triggered by any functional
call, e.g. the Scheduler could start to rank SBs in a separate thread.
Must be implemented as a synchronous (blocking) call (can spawn threads
though).
Container will catch and log ComponentLifecycleExceptions raised by
this method.
Params: None.
Returns: Nothing.
- initialize(self)
- Called to give the component time to initialize itself.
For instance, the component could retrieve connections, read in
configuration files/parameters, build up in-memory tables, ...
Called before execute. In fact, this method might be called quite some
time before functional requests can be sent to the component.
Must be implemented as a synchronous (blocking) call.
Container will catch and log ComponentLifecycleExceptions raised by
this method.
Params: None.
Returns: Nothing.
|
|