Package flumotion :: Package manager :: Module worker :: Class WorkerAvatar
[hide private]

Class WorkerAvatar

source code

twisted.spread.pb.Avatar --+            
                           |            
     common.log.Loggable --+            
                           |            
           twisted.pb.Avatar --+        
                               |        
       twisted.pb.PingableAvatar --+    
                                   |    
             common.log.Loggable --+    
                                   |    
                  base.ManagerAvatar --+
                                       |
                                      WorkerAvatar

I am an avatar created for a worker. A reference to me is given when logging in and requesting a worker avatar. I live in the manager.

Instance Methods [hide private]
 
getName(self) source code
 
attached(self, *args, **kwargs)
Tell the avatar that the given mind has been attached.
source code
 
detached(self, mind)
Tell the avatar that the peer's client referenced by the mind has detached.
source code
 
reservePorts(self, numPorts)
Reserve the given number of ports on the worker.
source code
 
releasePorts(self, ports)
Release the given list of ports on the worker.
source code
 
createComponent(self, avatarId, type, nice)
Create a component of the given type with the given nice level.
source code
 
getComponents(self)
Get a list of components that the worker is running.
source code
 
perspective_componentAddMessage(self, avatarId, message)
Called by the worker to tell the manager to add a given message to the given component.
source code

Inherited from base.ManagerAvatar: __init__, disconnect, getClientAddress, hasRemoteReference, mindCallRemote, perspective_authenticate, perspective_getBundleSums, perspective_getBundleSumsByFile, perspective_getBundleZips, perspective_getKeycardClasses, timeoutDisconnect

Inherited from base.ManagerAvatar (private): _mindCallRemoteErrback

Inherited from twisted.pb.PingableAvatar: perspective_ping, setMind, startPingChecking, stopPingChecking

Inherited from twisted.pb.PingableAvatar (private): _pingCheck

Inherited from twisted.pb.Avatar: mindCallRemoteLogging, perspectiveMessageReceived

Inherited from twisted.spread.pb.Avatar: __providedBy__

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

Class Variables [hide private]
  logCategory = 'worker-avatar'
Implementors can provide a category to log their messages under.
  _portSet = None

Inherited from base.ManagerAvatar: remoteLogName

Inherited from twisted.pb.PingableAvatar (private): _pingCheckInterval

Inherited from twisted.spread.pb.Avatar: __implemented__, __provides__

Instance Variables [hide private]
int feedServerPort = None
TCP port the feed server is listening on

Inherited from base.ManagerAvatar: avatarId, heaven, mind, vishnu

Method Details [hide private]

attached(self, *args, **kwargs)

source code 

Tell the avatar that the given mind has been attached. This gives the avatar a way to call remotely to the client that requested this avatar. This is scheduled by the portal after the client has logged in.

Overrides: base.ManagerAvatar.attached
(inherited documentation)

detached(self, mind)

source code 

Tell the avatar that the peer's client referenced by the mind has detached.

Called through the manager's PB logout trigger calling flumotion.manager.manager.Dispatcher.removeAvatar

Overrides: base.ManagerAvatar.detached
(inherited documentation)

reservePorts(self, numPorts)

source code 

Reserve the given number of ports on the worker.

Parameters:
  • numPorts (int) - how many ports to reserve

releasePorts(self, ports)

source code 

Release the given list of ports on the worker.

Parameters:
  • ports (list of int) - list of ports to release

createComponent(self, avatarId, type, nice)

source code 

Create a component of the given type with the given nice level.

Parameters:
  • avatarId (str) - avatarId the component should use to log in
  • type (str) - type of the component to create
  • nice (int) - the nice level to create the component at
Returns:
a deferred that will give the avatarId the component will use to log in to the manager

getComponents(self)

source code 

Get a list of components that the worker is running.

Returns:
a deferred that will give the avatarIds running on the worker

perspective_componentAddMessage(self, avatarId, message)

source code 

Called by the worker to tell the manager to add a given message to the given component.

Useful in cases where the component can't report messages itself, for example because it crashed.

Parameters: