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

Class JobClientFactory

source code

  twisted.internet.protocol.Factory --+        
                                      |        
twisted.internet.protocol.ClientFactory --+    
                                          |    
          twisted.spread.pb.PBClientFactory --+
                                              |
                    extern.log.log.Loggable --+
                                              |
                                             JobClientFactory

I am a client factory that logs in to the WorkerBrain. I live in the flumotion-job process spawned by the worker.

Nested Classes [hide private]
  perspectiveInterface
I am an interface for job-side mediums interfacing with worker-side avatars.

Inherited from twisted.spread.pb.PBClientFactory: protocol

Instance Methods [hide private]
 
__init__(self, id) source code
 
buildProtocol(self, addr)
Create an instance of a subclass of Protocol.
source code
 
login(self, username)
Login and get perspective from remote PB server.
source code
 
stopFactory(self)
This will be called before I stop listening on all Ports/Connectors.
source code

Inherited from twisted.spread.pb.PBClientFactory: clientConnectionFailed, clientConnectionLost, clientConnectionMade, disconnect, getPerspective, getRootObject

Inherited from twisted.spread.pb.PBClientFactory (private): _cbResponse, _cbSendUsername, _failAll, _reset

Inherited from twisted.internet.protocol.ClientFactory: startedConnecting

Inherited from twisted.internet.protocol.Factory: __providedBy__, doStart, doStop, startFactory

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

Class Variables [hide private]
  logCategory = 'job'
Implementors can provide a category to log their messages under.
JobMedium medium
the medium for the JobHeaven to access us through

Inherited from twisted.spread.pb.PBClientFactory: unsafeTracebacks

Inherited from twisted.internet.protocol.Factory: __implemented__, __provides__, noisy, numPorts

Method Details [hide private]

__init__(self, id)
(Constructor)

source code 
Parameters:
  • id (str) - the avatar id used for logging into the workerbrain
Overrides: twisted.spread.pb.PBClientFactory.__init__

buildProtocol(self, addr)

source code 

Create an instance of a subclass of Protocol.

The returned instance will handle input on an incoming server connection, and an attribute "factory" pointing to the creating factory.

Override this method to alter how Protocol instances get created.

Parameters:
  • addr - an object implementing twisted.internet.interfaces.IAddress
Overrides: twisted.internet.protocol.Factory.buildProtocol
(inherited documentation)

login(self, username)

source code 

Login and get perspective from remote PB server.

Currently only credentials implementing IUsernamePassword are supported.

Returns:
Deferred of RemoteReference to the perspective.
Overrides: __main__.login
(inherited documentation)

stopFactory(self)

source code 

This will be called before I stop listening on all Ports/Connectors.

This can be overridden to perform 'shutdown' tasks such as disconnecting database connections, closing files, etc.

It will be called, for example, before an application shuts down, if it was connected to a port. User code should not call this function directly.

Overrides: twisted.internet.protocol.Factory.stopFactory
(inherited documentation)