Package flumotion :: Package manager :: Module component :: Class ComponentHeaven
[hide private]

Class ComponentHeaven

source code

 twisted.spread.jelly.Jellyable --+                
                                  |                
twisted.spread.flavors.Serializable --+            
                                      |            
   twisted.spread.flavors.Referenceable --+        
                                          |        
                twisted.spread.flavors.Root --+    
                                              |    
                        common.log.Loggable --+    
                                              |    
                             base.ManagerHeaven --+
                                                  |
                                                 ComponentHeaven

I handle all registered components and provide ComponentAvatars for them.

Nested Classes [hide private]
  avatarClass
the class object this heaven instantiates avatars from.
Instance Methods [hide private]
 
__init__(self, vishnu) source code
 
_componentIsLocal(self, componentAvatar) source code
 
removeComponent(self, componentAvatar)
Remove a component avatar from the heaven.
source code
 
_getComponentEatersData(self, componentAvatar)
Retrieve the information about the feeders this component's eaters are eating from.
source code
tuple of (str, str, int) tuple
_getComponentFeedersData(self, component)
Retrieves the data of feeders (feed producer elements) for a component.
source code
 
_startComponent(self, *args, **kwargs) source code
 
_tryWhatCanBeStarted(self, result=True)
I try to start nodes in the depgraph if they should be started.
source code
 
_setupComponent(self, componentAvatar) source code
 
setupComponent(self, *args, **kwargs) source code
 
registerComponent(self, componentAvatar)
This function registers a component in the heaven.
source code
 
unregisterComponent(self, componentAvatar)
This function unregisters a component in the heaven.
source code
twisted.internet.defer.Deferred
provideMasterClock(self, componentAvatar)
Tell the given component to provide a master clock.
source code
 
removeMasterClock(self, componentAvatar)
Tell the given component to stop providing a master clock.
source code
twisted.internet.defer.Deferred
getMasterClockInfo(self, avatarId, waiterId=None)
Get the master clock information from the given clock master component.
source code
ComponentAvatar
getComponentAvatarForState(self, state)
Return a component avatar for the given state.
source code

Inherited from base.ManagerHeaven: createAvatar, getAvatar, getAvatars, hasAvatar, removeAvatar

Inherited from twisted.spread.flavors.Root: rootObject

Inherited from twisted.spread.flavors.Referenceable: jellyFor, remoteMessageReceived

Inherited from twisted.spread.flavors.Serializable: processUniqueID

Inherited from twisted.spread.jelly.Jellyable: __providedBy__, getStateFor

Inherited from common.log.Loggable: debug, doLog, error, info, log, logFunction, logObjectName, warning, warningFailure

Class Variables [hide private]
  logCategory = 'comp-heaven'
Implementors can provide a category to log their messages under.
  __implemented__ = <implementedBy flumotion.manager.component.C...
  __provides__ = <zope.interface.declarations.ClassProvides obje...

Inherited from twisted.spread.flavors.Referenceable: perspective

Instance Variables [hide private]

Inherited from base.ManagerHeaven: avatars, vishnu

Method Details [hide private]

__init__(self, vishnu)
(Constructor)

source code 
Parameters:
  • vishnu - the Vishnu in control of all the heavens
Overrides: base.ManagerHeaven.__init__
(inherited documentation)

removeComponent(self, componentAvatar)

source code 

Remove a component avatar from the heaven.

Parameters:

_getComponentEatersData(self, componentAvatar)

source code 

Retrieve the information about the feeders this component's eaters are eating from.

Parameters:
Returns:
list of fullFeedIds

_getComponentFeedersData(self, component)

source code 

Retrieves the data of feeders (feed producer elements) for a component.

Parameters:
Returns: tuple of (str, str, int) tuple
tuple of (feedId, host, port) for each feeder

_tryWhatCanBeStarted(self, result=True)

source code 

I try to start nodes in the depgraph if they should be started. I am a recursive method, because the depgraph's list of what should be started may change when nodes start/stop.

Parameters:
  • result - only needed because this method is added as a callback

registerComponent(self, componentAvatar)

source code 

This function registers a component in the heaven. It is triggered when the mind is attached.

Parameters:

unregisterComponent(self, componentAvatar)

source code 

This function unregisters a component in the heaven. It is triggered when the mind is detached.

Parameters:

provideMasterClock(self, componentAvatar)

source code 

Tell the given component to provide a master clock. Trigger all deferreds waiting on this componentAvatar to provide a master clock.

Parameters:
Returns: twisted.internet.defer.Deferred

removeMasterClock(self, componentAvatar)

source code 

Tell the given component to stop providing a master clock.

Parameters:

getMasterClockInfo(self, avatarId, waiterId=None)

source code 

Get the master clock information from the given clock master component.

Parameters:
  • avatarId (str) - the id of the clock master
  • waiterId (str) - the id of the requesting component
Returns: twisted.internet.defer.Deferred
a deferred firing an (ip, port, base_time) triple.

getComponentAvatarForState(self, state)

source code 

Return a component avatar for the given state.

Parameters:
Returns: ComponentAvatar

Class Variable Details [hide private]

__implemented__

Value:
<implementedBy flumotion.manager.component.ComponentHeaven>

__provides__

Value:
<zope.interface.declarations.ClassProvides object at 0x95636cc>