<?xml version="1.0" encoding="ascii"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>flumotion.component.component.BaseComponent</title> <link rel="stylesheet" href="epydoc.css" type="text/css" /> <script type="text/javascript" src="epydoc.js"></script> </head> <body bgcolor="white" text="black" link="blue" vlink="#204080" alink="#204080"> <!-- ==================== NAVIGATION BAR ==================== --> <table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> <tr valign="middle"> <!-- Tree link --> <th> <a href="module-tree.html">Trees</a> </th> <!-- Index link --> <th> <a href="identifier-index.html">Indices</a> </th> <!-- Help link --> <th> <a href="help.html">Help</a> </th> <th class="navbar" width="100%"></th> </tr> </table> <table width="100%" cellpadding="0" cellspacing="0"> <tr valign="top"> <td width="100%"> <span class="breadcrumbs"> Package flumotion :: <a href="flumotion.component-module.html">Package component</a> :: <a href="flumotion.component.component-module.html">Module component</a> :: Class BaseComponent </span> </td> <td> <table cellpadding="0" cellspacing="0"> <!-- hide/show private --> <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink" onclick="toggle_private();">hide private</a>]</span></td></tr> </table> </td> </tr> </table> <!-- ==================== CLASS DESCRIPTION ==================== --> <h1 class="epydoc">Class BaseComponent</h1><p class="nomargin-top"><span class="codelink"><a href="flumotion.component.component-pysrc.html#BaseComponent">source code</a></span></p> <pre class="base-tree"> object --+ | <a href="flumotion.common.common.InitMixin-class.html">common.common.InitMixin</a> --+ | <a href="flumotion.extern.log.log.Loggable-class.html">extern.log.log.Loggable</a> --+ | <strong class="uidshort">BaseComponent</strong> </pre> <dl><dt>Known Subclasses:</dt> <dd> <ul class="subclass-list"> <li><a href="flumotion.component.feedcomponent010.FeedComponent-class.html">feedcomponent010.FeedComponent</a></li><li>, <a href="flumotion.component.bouncers.component.Bouncer-class.html">bouncers.component.Bouncer</a></li><li>, <a href="flumotion.component.bouncers.bouncer.Bouncer-class.html">bouncers.bouncer.Bouncer</a></li><li>, <a href="flumotion.component.misc.httpserver.httpserver.HTTPFileStreamer-class.html">misc.httpserver.httpserver.HTTPFileStreamer</a></li><li>, <a href="flumotion.component.misc.porter.porter.Porter-class.html">misc.porter.porter.Porter</a></li> </ul> </dd></dl> <hr /> <p>I am the base class for all Flumotion components.</p> <!-- ==================== NESTED CLASSES ==================== --> <a name="section-NestedClasses"></a> <table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr bgcolor="#70b0f0" class="table-header"> <td colspan="2" class="table-header"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr valign="top"> <td align="left"><span class="table-header">Nested Classes</span></td> <td align="right" valign="top" ><span class="options">[<a href="#section-NestedClasses" class="privatelink" onclick="toggle_private();" >hide private</a>]</span></td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type">child class of <a href="flumotion.component.component.BaseComponentMedium-class.html" class="link">BaseComponentMedium</a></span> </td><td class="summary"> <a href="flumotion.component.component.BaseComponentMedium-class.html" class="summary-name">componentMediumClass</a><br /> the medium class to use for this component </td> </tr> </table> <!-- ==================== INSTANCE METHODS ==================== --> <a name="section-InstanceMethods"></a> <table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr bgcolor="#70b0f0" class="table-header"> <td colspan="2" class="table-header"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr valign="top"> <td align="left"><span class="table-header">Instance Methods</span></td> <td align="right" valign="top" ><span class="options">[<a href="#section-InstanceMethods" class="privatelink" onclick="toggle_private();" >hide private</a>]</span></td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="flumotion.component.component.BaseComponent-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>, <span class="summary-sig-arg">config</span>, <span class="summary-sig-arg">haveError</span>=<span class="summary-sig-default">None</span>)</span><br /> Subclasses should not override __init__ at all.</td> <td align="right" valign="top"> <span class="codelink"><a href="flumotion.component.component-pysrc.html#BaseComponent.__init__">source code</a></span> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="flumotion.component.component.BaseComponent-class.html#init" class="summary-sig-name">init</a>(<span class="summary-sig-arg">self</span>)</span><br /> A subclass should do as little as possible in its init method.</td> <td align="right" valign="top"> <span class="codelink"><a href="flumotion.component.component-pysrc.html#BaseComponent.init">source code</a></span> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="flumotion.component.component.BaseComponent-class.html#do_check" class="summary-sig-name">do_check</a>(<span class="summary-sig-arg">self</span>)</span><br /> Subclasses can implement me to run any checks before the component performs setup.</td> <td align="right" valign="top"> <span class="codelink"><a href="flumotion.component.component-pysrc.html#BaseComponent.do_check">source code</a></span> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="flumotion.component.component.BaseComponent-class.html#check_properties" class="summary-sig-name">check_properties</a>(<span class="summary-sig-arg">self</span>, <span class="summary-sig-arg">properties</span>, <span class="summary-sig-arg">addMessage</span>)</span><br /> BaseComponent convenience vmethod for running checks.</td> <td align="right" valign="top"> <span class="codelink"><a href="flumotion.component.component-pysrc.html#BaseComponent.check_properties">source code</a></span> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="flumotion.component.component.BaseComponent-class.html#do_setup" class="summary-sig-name">do_setup</a>(<span class="summary-sig-arg">self</span>)</span><br /> Subclasses can implement me to set up the component before it is started.</td> <td align="right" valign="top"> <span class="codelink"><a href="flumotion.component.component-pysrc.html#BaseComponent.do_setup">source code</a></span> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="flumotion.component.component.BaseComponent-class.html#do_stop" class="summary-sig-name">do_stop</a>(<span class="summary-sig-arg">self</span>)</span><br /> BaseComponent vmethod for stopping.</td> <td align="right" valign="top"> <span class="codelink"><a href="flumotion.component.component-pysrc.html#BaseComponent.do_stop">source code</a></span> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="flumotion.component.component.BaseComponent-class.html#setup" class="summary-sig-name">setup</a>(<span class="summary-sig-arg">self</span>)</span><br /> Sets up the component.</td> <td align="right" valign="top"> <span class="codelink"><a href="flumotion.component.component-pysrc.html#BaseComponent.setup">source code</a></span> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a name="setup_completed"></a><span class="summary-sig-name">setup_completed</span>(<span class="summary-sig-arg">self</span>)</span></td> <td align="right" valign="top"> <span class="codelink"><a href="flumotion.component.component-pysrc.html#BaseComponent.setup_completed">source code</a></span> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="flumotion.component.component.BaseComponent-class.html#setShutdownHook" class="summary-sig-name">setShutdownHook</a>(<span class="summary-sig-arg">self</span>, <span class="summary-sig-arg">shutdownHook</span>)</span><br /> Set the shutdown hook for this component (replacing any previous hook).</td> <td align="right" valign="top"> <span class="codelink"><a href="flumotion.component.component-pysrc.html#BaseComponent.setShutdownHook">source code</a></span> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="flumotion.component.component.BaseComponent-class.html#stop" class="summary-sig-name">stop</a>(<span class="summary-sig-arg">self</span>)</span><br /> Tell the component to stop.</td> <td align="right" valign="top"> <span class="codelink"><a href="flumotion.component.component-pysrc.html#BaseComponent.stop">source code</a></span> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a name="getName"></a><span class="summary-sig-name">getName</span>(<span class="summary-sig-arg">self</span>)</span></td> <td align="right" valign="top"> <span class="codelink"><a href="flumotion.component.component-pysrc.html#BaseComponent.getName">source code</a></span> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a name="setWorkerName"></a><span class="summary-sig-name">setWorkerName</span>(<span class="summary-sig-arg">self</span>, <span class="summary-sig-arg">workerName</span>)</span></td> <td align="right" valign="top"> <span class="codelink"><a href="flumotion.component.component-pysrc.html#BaseComponent.setWorkerName">source code</a></span> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a name="getWorkerName"></a><span class="summary-sig-name">getWorkerName</span>(<span class="summary-sig-arg">self</span>)</span></td> <td align="right" valign="top"> <span class="codelink"><a href="flumotion.component.component-pysrc.html#BaseComponent.getWorkerName">source code</a></span> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a name="setMedium"></a><span class="summary-sig-name">setMedium</span>(<span class="summary-sig-arg">self</span>, <span class="summary-sig-arg">medium</span>)</span></td> <td align="right" valign="top"> <span class="codelink"><a href="flumotion.component.component-pysrc.html#BaseComponent.setMedium">source code</a></span> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a name="setMood"></a><span class="summary-sig-name">setMood</span>(<span class="summary-sig-arg">self</span>, <span class="summary-sig-arg">mood</span>)</span><br /> Set the given mood on the component if it's different from the current one.</td> <td align="right" valign="top"> <span class="codelink"><a href="flumotion.component.component-pysrc.html#BaseComponent.setMood">source code</a></span> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type">int</span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a name="getMood"></a><span class="summary-sig-name">getMood</span>(<span class="summary-sig-arg">self</span>)</span><br /> Gets the mood on the component.</td> <td align="right" valign="top"> <span class="codelink"><a href="flumotion.component.component-pysrc.html#BaseComponent.getMood">source code</a></span> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a name="waitForHappy"></a><span class="summary-sig-name">waitForHappy</span>(<span class="summary-sig-arg">self</span>)</span></td> <td align="right" valign="top"> <span class="codelink"><a href="flumotion.component.component-pysrc.html#BaseComponent.waitForHappy">source code</a></span> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="flumotion.component.component.BaseComponent-class.html#addMessage" class="summary-sig-name">addMessage</a>(<span class="summary-sig-arg">self</span>, <span class="summary-sig-arg">message</span>)</span><br /> Add a message to the component.</td> <td align="right" valign="top"> <span class="codelink"><a href="flumotion.component.component-pysrc.html#BaseComponent.addMessage">source code</a></span> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="flumotion.component.component.BaseComponent-class.html#fixRenamedProperties" class="summary-sig-name">fixRenamedProperties</a>(<span class="summary-sig-arg">self</span>, <span class="summary-sig-arg">properties</span>, <span class="summary-sig-arg">list</span>)</span><br /> Fix properties that have been renamed from a previous version, and add a warning for them.</td> <td align="right" valign="top"> <span class="codelink"><a href="flumotion.component.component-pysrc.html#BaseComponent.fixRenamedProperties">source code</a></span> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="flumotion.component.component.BaseComponent-class.html#adminCallRemote" class="summary-sig-name">adminCallRemote</a>(<span class="summary-sig-arg">self</span>, <span class="summary-sig-arg">methodName</span>, <span class="summary-sig-arg">*args</span>, <span class="summary-sig-arg">**kwargs</span>)</span><br /> Call a remote method on all admin client views on this component.</td> <td align="right" valign="top"> <span class="codelink"><a href="flumotion.component.component-pysrc.html#BaseComponent.adminCallRemote">source code</a></span> </td> </tr> </table> </td> </tr> <tr class="private"> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a name="_pollCPU"></a><span class="summary-sig-name">_pollCPU</span>(<span class="summary-sig-arg">self</span>)</span></td> <td align="right" valign="top"> <span class="codelink"><a href="flumotion.component.component-pysrc.html#BaseComponent._pollCPU">source code</a></span> </td> </tr> </table> </td> </tr> <tr class="private"> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a name="_pollMemory"></a><span class="summary-sig-name">_pollMemory</span>(<span class="summary-sig-arg">self</span>)</span></td> <td align="right" valign="top"> <span class="codelink"><a href="flumotion.component.component-pysrc.html#BaseComponent._pollMemory">source code</a></span> </td> </tr> </table> </td> </tr> <tr> <td colspan="2" class="summary"> <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>: <code>__delattr__</code>, <code>__format__</code>, <code>__getattribute__</code>, <code>__hash__</code>, <code>__new__</code>, <code>__reduce__</code>, <code>__reduce_ex__</code>, <code>__repr__</code>, <code>__setattr__</code>, <code>__sizeof__</code>, <code>__str__</code>, <code>__subclasshook__</code> </p> <p class="indent-wrapped-lines"><b>Inherited from <code><a href="flumotion.extern.log.log.Loggable-class.html">extern.log.log.Loggable</a></code></b>: <code><a href="flumotion.extern.log.log.Loggable-class.html#debug">debug</a></code>, <code><a href="flumotion.extern.log.log.Loggable-class.html#doLog">doLog</a></code>, <code><a href="flumotion.extern.log.log.Loggable-class.html#error">error</a></code>, <code><a href="flumotion.extern.log.log.Loggable-class.html#info">info</a></code>, <code><a href="flumotion.extern.log.log.Loggable-class.html#log">log</a></code>, <code><a href="flumotion.extern.log.log.Loggable-class.html#logFunction">logFunction</a></code>, <code><a href="flumotion.extern.log.log.Loggable-class.html#logObjectName">logObjectName</a></code>, <code><a href="flumotion.extern.log.log.Loggable-class.html#warning">warning</a></code>, <code><a href="flumotion.extern.log.log.Loggable-class.html#warningFailure">warningFailure</a></code>, <code><a href="flumotion.extern.log.log.Loggable-class.html#writeMarker">writeMarker</a></code> </p> </td> </tr> </table> <!-- ==================== CLASS VARIABLES ==================== --> <a name="section-ClassVariables"></a> <table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr bgcolor="#70b0f0" class="table-header"> <td colspan="2" class="table-header"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr valign="top"> <td align="left"><span class="table-header">Class Variables</span></td> <td align="right" valign="top" ><span class="options">[<a href="#section-ClassVariables" class="privatelink" onclick="toggle_private();" >hide private</a>]</span></td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <a name="logCategory"></a><span class="summary-name">logCategory</span> = <code title="'basecomp'"><code class="variable-quote">'</code><code class="variable-string">basecomp</code><code class="variable-quote">'</code></code><br /> Implementors can provide a category to log their messages under. </td> </tr> </table> <!-- ==================== INSTANCE VARIABLES ==================== --> <a name="section-InstanceVariables"></a> <table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr bgcolor="#70b0f0" class="table-header"> <td colspan="2" class="table-header"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr valign="top"> <td align="left"><span class="table-header">Instance Variables</span></td> <td align="right" valign="top" ><span class="options">[<a href="#section-InstanceVariables" class="privatelink" onclick="toggle_private();" >hide private</a>]</span></td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"><a href="flumotion.component.component.BaseComponentMedium-class.html" class="link">BaseComponentMedium</a></span> </td><td class="summary"> <a name="medium"></a><span class="summary-name">medium</span><br /> the component's medium </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type">string</span> </td><td class="summary"> <a name="name"></a><span class="summary-name">name</span><br /> the name of the component </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"><a href="flumotion.common.componentui.WorkerComponentUIState-class.html" class="link">componentui.WorkerComponentUIState</a></span> </td><td class="summary"> <a href="flumotion.component.component.BaseComponent-class.html#uiState" class="summary-name">uiState</a><br /> state of the component to be shown in a UI. </td> </tr> </table> <!-- ==================== PROPERTIES ==================== --> <a name="section-Properties"></a> <table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr bgcolor="#70b0f0" class="table-header"> <td colspan="2" class="table-header"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr valign="top"> <td align="left"><span class="table-header">Properties</span></td> <td align="right" valign="top" ><span class="options">[<a href="#section-Properties" class="privatelink" onclick="toggle_private();" >hide private</a>]</span></td> </tr> </table> </td> </tr> <tr> <td colspan="2" class="summary"> <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>: <code>__class__</code> </p> </td> </tr> </table> <!-- ==================== METHOD DETAILS ==================== --> <a name="section-MethodDetails"></a> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr bgcolor="#70b0f0" class="table-header"> <td colspan="2" class="table-header"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr valign="top"> <td align="left"><span class="table-header">Method Details</span></td> <td align="right" valign="top" ><span class="options">[<a href="#section-MethodDetails" class="privatelink" onclick="toggle_private();" >hide private</a>]</span></td> </tr> </table> </td> </tr> </table> <a name="__init__"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>, <span class="sig-arg">config</span>, <span class="sig-arg">haveError</span>=<span class="sig-default">None</span>)</span> <br /><em class="fname">(Constructor)</em> </h3> </td><td align="right" valign="top" ><span class="codelink"><a href="flumotion.component.component-pysrc.html#BaseComponent.__init__">source code</a></span> </td> </tr></table> <p>Subclasses should not override __init__ at all.</p> <p>Instead, they should implement init(), which will be called by this implementation automatically.</p> <p><a href="flumotion.common.common.InitMixin-class.html" class="link">flumotion.common.common.InitMixin</a> for more details.</p> <dl class="fields"> <dt>Overrides: object.__init__ </dt> </dl> </td></tr></table> </div> <a name="init"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">init</span>(<span class="sig-arg">self</span>)</span> </h3> </td><td align="right" valign="top" ><span class="codelink"><a href="flumotion.component.component-pysrc.html#BaseComponent.init">source code</a></span> </td> </tr></table> <p>A subclass should do as little as possible in its init method. In particular, it should not try to access resources.</p> <p>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.</p> <dl class="fields"> </dl> </td></tr></table> </div> <a name="do_check"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">do_check</span>(<span class="sig-arg">self</span>)</span> </h3> </td><td align="right" valign="top" ><span class="codelink"><a href="flumotion.component.component-pysrc.html#BaseComponent.do_check">source code</a></span> </td> </tr></table> <p>Subclasses can implement me to run any checks before the component performs setup.</p> <p>Messages can be added to the component state's 'messages' list key. Any error messages added will trigger the component going to sad, with <a href="flumotion.common.errors.ComponentSetupError-class.html" class="link">flumotion.common.errors.ComponentSetupError</a> being raised before getting to setup stage; do_setup() will not be called.</p> <p>In the event of a fatal problem that can't be expressed through an error message, this method should raise an exception or return a failure.</p> <p>It is not necessary to chain up in this function. The return value may be a deferred.</p> <dl class="fields"> </dl> </td></tr></table> </div> <a name="check_properties"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">check_properties</span>(<span class="sig-arg">self</span>, <span class="sig-arg">properties</span>, <span class="sig-arg">addMessage</span>)</span> </h3> </td><td align="right" valign="top" ><span class="codelink"><a href="flumotion.component.component-pysrc.html#BaseComponent.check_properties">source code</a></span> </td> </tr></table> <p>BaseComponent convenience vmethod for running checks.</p> <p>A component implementation can override this method to run any checks that it needs to. Typically, a check_properties implementation will call the provided addMessage() callback to note warnings or errors. For errors, addMessage() will set component's mood to sad, which will abort the init process before getting to do_setup().</p> <dl class="fields"> <dt>Parameters:</dt> <dd><ul class="nomargin-top"> <li><strong class="pname"><code>properties</code></strong> (dict of string => object) - The component's properties</li> <li><strong class="pname"><code>addMessage</code></strong> (<a href="flumotion.common.messages.Message-class.html" class="link">flumotion.common.messages.Message</a> -> None) - Thunk to add a message to the component state. Will raise an exception if the message is of level ERROR.</li> </ul></dd> </dl> </td></tr></table> </div> <a name="do_setup"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">do_setup</span>(<span class="sig-arg">self</span>)</span> </h3> </td><td align="right" valign="top" ><span class="codelink"><a href="flumotion.component.component-pysrc.html#BaseComponent.do_setup">source code</a></span> </td> </tr></table> <p>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.</p> <p>The return value may be a deferred.</p> <dl class="fields"> </dl> </td></tr></table> </div> <a name="do_stop"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">do_stop</span>(<span class="sig-arg">self</span>)</span> </h3> </td><td align="right" valign="top" ><span class="codelink"><a href="flumotion.component.component-pysrc.html#BaseComponent.do_stop">source code</a></span> </td> </tr></table> <p>BaseComponent vmethod for stopping. The component should do any cleanup it needs, but must not set the component's mood to sleeping.</p> <dl class="fields"> <dt>Returns:</dt> <dd><code class="link">twisted.internet.defer.Deferred</code></dd> </dl> </td></tr></table> </div> <a name="setup"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">setup</span>(<span class="sig-arg">self</span>)</span> </h3> </td><td align="right" valign="top" ><span class="codelink"><a href="flumotion.component.component-pysrc.html#BaseComponent.setup">source code</a></span> </td> </tr></table> <p>Sets up the component. Called during __init__, so be sure not to raise exceptions, instead adding messages to the component state.</p> <dl class="fields"> </dl> </td></tr></table> </div> <a name="setShutdownHook"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">setShutdownHook</span>(<span class="sig-arg">self</span>, <span class="sig-arg">shutdownHook</span>)</span> </h3> </td><td align="right" valign="top" ><span class="codelink"><a href="flumotion.component.component-pysrc.html#BaseComponent.setShutdownHook">source code</a></span> </td> </tr></table> <p>Set the shutdown hook for this component (replacing any previous hook). When a component is stopped, then this hook will be fired.</p> <dl class="fields"> </dl> </td></tr></table> </div> <a name="stop"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">stop</span>(<span class="sig-arg">self</span>)</span> </h3> </td><td align="right" valign="top" ><span class="codelink"><a href="flumotion.component.component-pysrc.html#BaseComponent.stop">source code</a></span> </td> </tr></table> <p>Tell the component to stop. The connection to the manager will be closed. The job process will also finish.</p> <dl class="fields"> </dl> </td></tr></table> </div> <a name="addMessage"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">addMessage</span>(<span class="sig-arg">self</span>, <span class="sig-arg">message</span>)</span> </h3> </td><td align="right" valign="top" ><span class="codelink"><a href="flumotion.component.component-pysrc.html#BaseComponent.addMessage">source code</a></span> </td> </tr></table> <p>Add a message to the component. If any of the messages is an error, the component will turn sad.</p> <dl class="fields"> <dt>Parameters:</dt> <dd><ul class="nomargin-top"> <li><strong class="pname"><code>message</code></strong> (<a href="flumotion.common.messages.Message-class.html" class="link">flumotion.common.messages.Message</a>)</li> </ul></dd> </dl> </td></tr></table> </div> <a name="fixRenamedProperties"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">fixRenamedProperties</span>(<span class="sig-arg">self</span>, <span class="sig-arg">properties</span>, <span class="sig-arg">list</span>)</span> </h3> </td><td align="right" valign="top" ><span class="codelink"><a href="flumotion.component.component-pysrc.html#BaseComponent.fixRenamedProperties">source code</a></span> </td> </tr></table> <p>Fix properties that have been renamed from a previous version, and add a warning for them.</p> <dl class="fields"> <dt>Parameters:</dt> <dd><ul class="nomargin-top"> <li><strong class="pname"><code>properties</code></strong> (dict) - properties; will be modified as a result.</li> <li><strong class="pname"><code>list</code></strong> (list of tuple of (str, str)) - list of (old, new) tuples of property names.</li> </ul></dd> </dl> </td></tr></table> </div> <a name="adminCallRemote"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">adminCallRemote</span>(<span class="sig-arg">self</span>, <span class="sig-arg">methodName</span>, <span class="sig-arg">*args</span>, <span class="sig-arg">**kwargs</span>)</span> </h3> </td><td align="right" valign="top" ><span class="codelink"><a href="flumotion.component.component-pysrc.html#BaseComponent.adminCallRemote">source code</a></span> </td> </tr></table> <p>Call a remote method on all admin client views on this component.</p> <p>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.</p> <p>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.</p> <dl class="fields"> </dl> </td></tr></table> </div> <br /> <!-- ==================== INSTANCE VARIABLE DETAILS ==================== --> <a name="section-InstanceVariableDetails"></a> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr bgcolor="#70b0f0" class="table-header"> <td colspan="2" class="table-header"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr valign="top"> <td align="left"><span class="table-header">Instance Variable Details</span></td> <td align="right" valign="top" ><span class="options">[<a href="#section-InstanceVariableDetails" class="privatelink" onclick="toggle_private();" >hide private</a>]</span></td> </tr> </table> </td> </tr> </table> <a name="uiState"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <h3 class="epydoc">uiState</h3> state of the component to be shown in a UI. Contains at least the following keys. <ul> <li> cpu-percent: percentage of CPU use in last interval </li> <li> start-time: time when component was started, in epoch seconds </li> <li> current-time: current time in epoch seconds, as seen on component's machine, which might be out of sync </li> <li> virtual-size: virtual memory size in bytes </li> </ul> <p>Subclasses can add additional keys for their respective UI.</p> <dl class="fields"> <dt>Type:</dt> <dd><a href="flumotion.common.componentui.WorkerComponentUIState-class.html" class="link">componentui.WorkerComponentUIState</a></dd> </dl> </td></tr></table> </div> <br /> <!-- ==================== NAVIGATION BAR ==================== --> <table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> <tr valign="middle"> <!-- Tree link --> <th> <a href="module-tree.html">Trees</a> </th> <!-- Index link --> <th> <a href="identifier-index.html">Indices</a> </th> <!-- Help link --> <th> <a href="help.html">Help</a> </th> <th class="navbar" width="100%"></th> </tr> </table> <table border="0" cellpadding="0" cellspacing="0" width="100%%"> <tr> <td align="left" class="footer"> Generated by Epydoc 3.0.1 on Sun Sep 13 13:14:06 2009 </td> <td align="right" class="footer"> <a target="mainFrame" href="http://epydoc.sourceforge.net" >http://epydoc.sourceforge.net</a> </td> </tr> </table> <script type="text/javascript"> <!-- // Private objects are initially displayed (because if // javascript is turned off then we want them to be // visible); but by default, we want to hide them. So hide // them unless we have a cookie that says to show them. checkCookie(); // --> </script> </body> </html>