Package flumotion :: Package job :: Module job :: Class JobMedium
[hide private]

Class JobMedium

source code

 twisted.spread.jelly.Jellyable --+                
                                  |                
twisted.spread.flavors.Serializable --+            
                                      |            
   twisted.spread.flavors.Referenceable --+        
                                          |        
                extern.log.log.Loggable --+        
                                          |        
                   twisted.pb.Referenceable --+    
                                              |    
                       common.medium.BaseMedium --+
                                                  |
                                                 JobMedium

I am a medium between the job and the worker's job avatar. I live in the job process.

Instance Methods [hide private]
 
__init__(self) source code
 
remote_bootstrap(self, workerName, host, port, transport, authenticator, packagePaths)
I receive the information on how to connect to the manager.
source code
 
remote_getPid(self) source code
 
remote_runFunction(self, moduleName, methodName, *args, **kwargs)
I am called on by the worker's JobAvatar to run a function, normally on behalf of the flumotion wizard.
source code
 
remote_create(self, avatarId, type, moduleName, methodName, nice, conf)
I am called on by the worker's JobAvatar to create a component.
source code
 
_componentStopped(self) source code
 
remote_stop(self) source code
 
shutdownHandler(self) source code
 
shutdown(self)
Shut down the job process completely, cleaning up the component so the reactor can be left from.
source code
 
_setNice(self, nice) source code
 
_enableCoreDumps(self) source code
 
_createComponent(self, avatarId, type, moduleName, methodName, nice, conf)
Create a component of the given type.
source code

Inherited from common.medium.BaseMedium: callRemote, callRemoteLogging, getBundledFunction, hasRemoteReference, runBundledFunction, setRemoteReference

Inherited from twisted.pb.Referenceable: remoteMessageReceived

Inherited from twisted.spread.flavors.Referenceable: jellyFor

Inherited from twisted.spread.flavors.Serializable: processUniqueID

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

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

Class Variables [hide private]
  logCategory = 'jobmedium'
Implementors can provide a category to log their messages under.
str remoteLogName = 'jobavatar'
name to use to log the other side of the connection
  __implemented__ = <implementedBy flumotion.job.job.JobMedium>
  __provides__ = <zope.interface.declarations.ClassProvides obje...
flumotion.component.component.BaseComponent component
the component this is a medium for; created as part of remote_create

Inherited from common.medium.BaseMedium: bundleLoader

Inherited from twisted.spread.flavors.Referenceable: perspective

Instance Variables [hide private]

Inherited from common.medium.BaseMedium: remote

Method Details [hide private]

remote_bootstrap(self, workerName, host, port, transport, authenticator, packagePaths)

source code 

I receive the information on how to connect to the manager. I also set up package paths to be able to run the component.

Called by the worker's JobAvatar.

Parameters:
  • workerName (str) - the name of the worker running this job
  • host (str) - the host that is running the manager
  • port (int) - port on which the manager is listening
  • transport (str) - 'tcp' or 'ssl'
  • authenticator (twisted.spread.pb.RemoteReference to a flumotion.twisted.pb.Authenticator) - remote reference to the worker-side authenticator
  • packagePaths (list of (str, str)) - ordered list of (package name, package path) tuples

remote_runFunction(self, moduleName, methodName, *args, **kwargs)

source code 

I am called on by the worker's JobAvatar to run a function, normally on behalf of the flumotion wizard.

Parameters:
  • moduleName (str) - name of the module containing the function
  • methodName (str) - the method to run
  • args (tuple) - args to pass to the method
  • kwargs (dict) - kwargs to pass to the method
Returns:
the result of invoking the method

remote_create(self, avatarId, type, moduleName, methodName, nice, conf)

source code 

I am called on by the worker's JobAvatar to create a component.

Parameters:
  • avatarId (str) - avatarId for component to log in to manager
  • type (str) - type of component to start
  • moduleName (str) - name of the module to create the component from
  • methodName (str) - the factory method to use to create the component
  • nice (int) - the nice level
  • conf (dict) - the component configuration

_createComponent(self, avatarId, type, moduleName, methodName, nice, conf)

source code 

Create a component of the given type. Log in to the manager with the given avatarId.

Parameters:
  • avatarId (str) - avatarId component will use to log in to manager
  • type (str) - type of component to start
  • moduleName (str) - name of the module that contains the entry point
  • methodName (str) - name of the factory method to create the component
  • nice (int) - the nice level to run with
  • conf (dict) - the component configuration

Class Variable Details [hide private]

__provides__

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