Acspy.Servants.ComponentLifecycle
index
/alma/ACS-2016.6/ACSSW/lib/python/site-packages/Acspy/Servants/ComponentLifecycle.py

This module provides the ComponentLifecycle class along with
ComponentLifecycleException.
 
Components can be derived from ComponentLifecycle (but do not have to
necessarily) and have startup/shutdown methods that can only be invoked by the
container.
 
ComponentLifecycleException is an exception thrown by ComponentLifecycle, but
will be caught by the container.
 
TODO:
ComponentLifecycleException is not defined in an IDL file, but is not
automatically generated by the ACS Error System. This makes it difficult
to use within components. Submit an SPR which will hopefully result in
ComponentLifeCycleException class in this module being removed.

 
Modules
       
exceptions

 
Classes
       
__builtin__.object
ComponentLifecycle
exceptions.Exception(exceptions.BaseException)
ComponentLifecycleException

 
class ComponentLifecycle(__builtin__.object)
    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.

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class ComponentLifecycleException(exceptions.Exception)
    Class ComponentLifecycleException is provided so that the container can
catch and log non-critical exceptions, but destroy the Component upon
anything else.
 
 
Method resolution order:
ComponentLifecycleException
exceptions.Exception
exceptions.BaseException
__builtin__.object

Methods defined here:
__init__(self, args=None)
Default constructor.
 
Params: args SHOULD be in string format.
 
Returns: Nothing.

Data descriptors defined here:
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from exceptions.Exception:
__new__ = <built-in method __new__ of type object>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from exceptions.BaseException:
__delattr__(...)
x.__delattr__('name') <==> del x.name
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__reduce__(...)
__repr__(...)
x.__repr__() <==> repr(x)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__setstate__(...)
__str__(...)
x.__str__() <==> str(x)
__unicode__(...)

Data descriptors inherited from exceptions.BaseException:
__dict__
args
message

 
Data
        __revision__ = '$Id: ComponentLifecycle.py,v 1.6 2010/02/12 22:15:19 agrimstrup Exp $'