Package flumotion :: Package job :: Module job :: Class JobMedium
[show private | hide private]
[frames | no frames]

Class JobMedium

         Loggable --+        
                    |        
Jellyable --+       |        
            |       |        
 Serializable --+   |        
                |   |        
    Referenceable --+        
                    |        
        Referenceable --+    
                        |    
               BaseMedium --+
                            |
                           JobMedium


I am a medium between the job and the worker's job avatar. I live in the job process.
Method Summary
  __init__(self)
  remote_bootstrap(self, workerName, host, port, transport, authenticator, packagePaths)
I receive the information on how to connect to the manager.
  remote_create(self, avatarId, type, moduleName, methodName, nice)
I am called on by the worker's JobAvatar to create a component.
  remote_stop(self)
  shutdown(self)
Shut down the job process completely, cleaning up the component so the reactor can be left from.
  shutdownHandler(self)
  _componentStopped(self)
  _createComponent(self, avatarId, type, moduleName, methodName, nice)
Create a component of the given type.
  _enableCoreDumps(self)
  _setNice(self, nice)
    Inherited from BaseMedium
  callRemote(self, name, *args, **kwargs)
Call the given method with the given arguments remotely on the server-side avatar.
  callRemoteLogging(self, level, stackDepth, name, *args, **kwargs)
Call the given method with the given arguments remotely on the server-side avatar.
  hasRemoteReference(self)
Does the medium have a remote reference to a server-side avatar ?
  runBundledFunction(self, *args, **kwargs)
  setRemoteReference(self, remoteReference)
Set the given remoteReference as the reference to the server-side avatar.
    Inherited from Referenceable
  remoteMessageReceived(self, broker, message, args, kwargs)
    Inherited from Referenceable
  jellyFor(self, jellier)
(internal)
    Inherited from Serializable
  processUniqueID(self)
Return an ID which uniquely represents this object for this process.
    Inherited from Jellyable
  getStateFor(self, jellier)
    Inherited from Loggable
  debug(self, *args)
Log a debug message.
dict doLog(self, level, where, format, *args, **kwargs)
Log a message at the given level, with the possibility of going higher up in the stack.
  error(self, *args)
Log an error.
  info(self, *args)
Log an informational message.
  log(self, *args)
Log a log message.
  logFunction(self, *args)
Overridable log function.
  logObjectName(self)
Overridable object name function.
  warning(self, *args)
Log a warning.
  warningFailure(self, failure, swallow)
Log a warning about a Failure.

Instance Variable Summary
    Inherited from BaseMedium
twisted.spread.pb.RemoteReference remote: a remote reference to the server-side object on which perspective_(methodName) methods can be called

Class Variable Summary
Implements __implemented__ = <implementedBy flumotion.job.job.JobMe...
ClassProvides __provides__ = <zope.interface.declarations.ClassProvide...
flumotion.component.component.BaseComponent component: the component this is a medium for; created as part of remote_create
str logCategory: Implementors can provide a category to log their messages under.
str remoteLogName: name to use to log the other side of the connection
    Inherited from BaseMedium
flumotion.common.bundleclient.BundleLoader bundleLoader = None                                                                  
    Inherited from Referenceable
NoneType perspective = None                                                                  
    Inherited from Jellyable
ClassProvides __providedBy__ = <zope.interface.declarations.ClassProvi...

Method Details

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

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 - the name of the worker running this job
           (type=str)
host - the host that is running the manager
           (type=str)
port - port on which the manager is listening
           (type=int)
transport - 'tcp' or 'ssl'
           (type=str)
authenticator - remote reference to the worker-side authenticator
           (type=twisted.spread.pb.RemoteReference to a flumotion.twisted.pb.Authenticator)
packagePaths - ordered list of (package name, package path) tuples
           (type=list of (str, str))

remote_create(self, avatarId, type, moduleName, methodName, nice=0)

I am called on by the worker's JobAvatar to create a component.
Parameters:
avatarId - avatarId for component to log in to manager
           (type=str)
type - type of component to start
           (type=str)
moduleName - name of the module to create the component from
           (type=str)
methodName - the factory method to use to create the component
           (type=str)
nice - the nice level
           (type=int)

shutdown(self)

Shut down the job process completely, cleaning up the component so the reactor can be left from.

_createComponent(self, avatarId, type, moduleName, methodName, nice=0)

Create a component of the given type. Log in to the manager with the given avatarId.
Parameters:
avatarId - avatarId component will use to log in to manager
           (type=str)
type - type of component to start
           (type=str)
moduleName - name of the module that contains the entry point
           (type=str)
methodName - name of the factory method to create the component
           (type=str)
nice - the nice level to run with
           (type=int)

Class Variable Details

__implemented__

Type:
Implements
Value:
<implementedBy flumotion.job.job.JobMedium>                            

__provides__

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

component

the component this is a medium for; created as part of remote_create
Type:
flumotion.component.component.BaseComponent

logCategory

Implementors can provide a category to log their messages under.
Type:
str
Value:
'jobmedium'                                                            

remoteLogName

name to use to log the other side of the connection
Type:
str
Value:
'jobavatar'                                                            

Generated by Epydoc 2.1 on Fri Apr 6 10:13:41 2007 http://epydoc.sf.net