Trees | Index | Help |
---|
Package flumotion :: Package component :: Module component :: Class BaseComponent |
|
object
--+ |GObject
--+ |object
--+ | | |InitMixin
--+ |Loggable
--+ | BaseComponent
Bouncer
,
FeedComponent
Method Summary | |
---|---|
Subclasses should not override __init__ at all. | |
Add a message to the component. | |
Call a remote method on all admin client views on this component. | |
Subclasses can implement me to run any checks before the component performs setup. | |
Subclasses can implement me to set up the component before it is started. | |
BaseComponent vmethod for starting up. | |
BaseComponent vmethod for stopping. | |
emit(self,
name,
*args)
| |
Fix properties that have been renamed from a previous version, and add a warning for them. | |
int |
Gets the mood on the component. |
getName(self)
| |
getWorkerName(self)
| |
A subclass should do as little as possible in its init method. | |
setMedium(self,
medium)
| |
Set the given mood on the component if it's different from the current one. | |
Set the shutdown hook for this component (replacing any previous hook). | |
Sets up the component with the given config. | |
setWorkerName(self,
workerName)
| |
Tell the component to start. | |
Tell the component to stop. | |
_setConfig(self,
config)
| |
_updateCPUUsage(self)
| |
Inherited from Loggable | |
Log a debug message. | |
dict |
Log a message at the given level, with the possibility of going higher up in the stack. |
Log an error. | |
Log an informational message. | |
Log a log message. | |
Overridable log function. | |
Overridable object name function. | |
Log a warning. | |
Log a warning about a Failure. | |
Inherited from GObject | |
x.__cmp__(y) <==> cmp(x,y) | |
| |
x.__hash__() <==> hash(x) | |
T.__new__(S, ...) -> a new object with type S, a subtype of T | |
x.__repr__() <==> repr(x) | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
helper for pickle | |
helper for pickle | |
x.__setattr__('name', value) <==> x.name = value | |
x.__str__() <==> str(x) |
Instance Variable Summary | |
---|---|
BaseComponentMedium |
medium : the component's medium |
string | name : the name of the component |
Class Variable Summary | |
---|---|
GType |
__gtype__ = <GType flumotion+component+component+BaseCom...
|
child class of BaseComponentMedium |
componentMediumClass = flumotion.component.component.BaseComponentMedium |
str |
logCategory : Implementors can provide a category to log their messages under. |
Inherited from Loggable | |
Implements |
__implemented__ = <implementedBy flumotion.common.log.Lo...
|
ClassProvides |
__providedBy__ = <zope.interface.declarations.ClassProvi...
|
ClassProvides |
__provides__ = <zope.interface.declarations.ClassProvide...
|
Inherited from GObject | |
str |
__gdoc__ = 'Object GObject\n\nSignals from GObject:\n n...
|
getset_descriptor |
__grefcount__ = <attribute '__grefcount__' of 'gobject.G...
|
GProps |
props = <gobject.GProps object at 0x2b41a748e090>
|
Method Details |
---|
__init__(self)
|
addMessage(self, message)Add a message to the component. If any of the messages is an error, the component will turn sad.
|
adminCallRemote(self, methodName, *args, **kwargs)Call a remote method on all admin client views on this component. This gets serialized through the manager and multiplexed to all admin clients, and from there on to all views connected to each admin client model. Because there can be any number of admin clients that this call will go out do, it does not make sense to have one return value. This function will return None always. |
do_check(self)Subclasses can implement me to run any checks before the component performs setup. Messages can be added to the component state's 'messages' list key.
Any error messages added will trigger the component going to sad an In the event of a fatal problem that can't be expressed through an error message, this method should set the mood to sad and raise the error on its own. self.config will be set before this is called.
|
do_setup(self)Subclasses can implement me to set up the component before it is started. It should set up the component, possibly opening files and resources. Non-programming errors should not be raised, but returned as a failing deferred. self.config will be set before this is called.
|
do_start(self, *args, **kwargs)BaseComponent vmethod for starting up. If you override this method, you are responsible for arranging that the component becomes happy.
|
do_stop(self)BaseComponent vmethod for stopping. The component should do any cleanup it needs, but must not set the component's mood to sleeping.
|
fixRenamedProperties(self, properties, list)Fix properties that have been renamed from a previous version, and add a warning for them.
|
getMood(self)Gets the mood on the component.
|
init(self)A subclass should do as little as possible in its init method. In particular, it should not try to access resources. Failures during init are marshalled back to the manager through the worker's remote_create method, since there is no component state proxied to the manager yet at the time of init. |
setMood(self, mood)Set the given mood on the component if it's different from the current one. |
setShutdownHook(self, shutdownHook)Set the shutdown hook for this component (replacing any previous hook). When a component is stopped, then this hook will be fired. |
setup(self, config, *args, **kwargs)Sets up the component with the given config. Called by the manager through the medium.
|
start(self, *args, **kwargs)Tell the component to start. This is called when all its dependencies are already started. To hook onto this method, implement your own do_start method. See BaseComponent.do_start() for what your do_start method is responsible for doing. Again, don't override this method. Thanks. |
stop(self)Tell the component to stop. The connection to the manager will be closed. The job process will also finish. |
Instance Variable Details |
---|
mediumthe component's medium
|
namethe name of the component
|
Class Variable Details |
---|
__gtype__
|
logCategoryImplementors can provide a category to log their messages under.
|
Trees | Index | Help |
---|
Generated by Epydoc 2.1 on Fri Apr 6 10:13:42 2007 | http://epydoc.sf.net |