Package foolscap :: Module broker :: Class Broker
[hide private]
[frames] | no frames]

Class Broker

source code

twisted.internet.protocol.BaseProtocol --+        
                                         |        
        twisted.internet.protocol.Protocol --+    
                                             |    
                                 banana.Banana --+
                                                 |
                                object --+       |
                                         |       |
           referenceable.OnlyReferenceable --+   |
                                             |   |
                   referenceable.Referenceable --+
                                                 |
                                                Broker
Known Subclasses:

I manage a connection to a remote Broker.

Nested Classes [hide private]
  slicerClass
  unslicerClass
Instance Methods [hide private]
 
__init__(self, remote_tubref, params={}, keepaliveTimeout=None, disconnectTimeout=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
initBroker(self) source code
 
setTub(self, tub) source code
 
connectionMade(self)
Called when a connection is made.
source code
 
_create_remote_broker(self) source code
 
connectionTimedOut(self) source code
 
shutdown(self, why, fireDisconnectWatchers=True)
Stop using this connection.
source code
 
connectionLost(self, why)
Called when the connection is shut down.
source code
 
finish(self, why) source code
 
notifyOnDisconnect(self, callback, *args, **kwargs) source code
 
dontNotifyOnDisconnect(self, marker) source code
 
getTrackerForMyReference(self, puid, obj) source code
 
getTrackerForMyCall(self, puid, obj) source code
 
getTrackerForYourReference(self, clid, interfaceName=None, url=None)
The far end holds a Referenceable and has just sent us a reference to it (expressed as a small integer).
source code
 
freeYourReference(self, tracker, count) source code
 
freeYourReferenceTracker(self, res, tracker) source code
 
getMyReferenceByCLID(self, clid)
clid is the connection-local ID of the Referenceable the other end is trying to invoke or point to.
source code
 
remote_decref(self, clid, count) source code
 
makeGift(self, rref) source code
 
remote_decgift(self, giftID, count) source code
 
getYourReferenceByName(self, name) source code
 
remote_getReferenceByName(self, name) source code
 
newRequestID(self) source code
 
addRequest(self, req) source code
 
removeRequest(self, req) source code
 
getRequest(self, reqID) source code
 
abandonAllRequests(self, why) source code
 
getRemoteInterfaceByName(self, riname) source code
 
getSchemaForMethod(self, rifaces, methodname) source code
 
scheduleCall(self, delivery, ready_deferred) source code
 
doNextCall(self) source code
 
_doCall(self, delivery) source code
 
_callFinished(self, res, delivery) source code
 
callFailed(self, f, reqID, delivery=None) source code

Inherited from banana.Banana: addIncomingVocabulary, addToOutgoingVocabulary, allocateEntryInOutgoingVocabTable, dataReceived, describeReceive, describeSend, disconnectTimerFired, getObject, handleClose, handleData, handleError, handleOpen, handleSendViolation, handleToken, handleViolation, initReceive, initSend, initSlicer, initUnslicer, keepaliveTimerFired, maybeVocabizeString, newSlicerFor, outgoingVocabTableWasAmended, outgoingVocabTableWasReplaced, popSlicer, populateVocabTable, printStack, produce, pushSlicer, receivedObject, replaceIncomingVocabulary, reportReceiveError, reportViolation, send, sendAbort, sendClose, sendError, sendFailed, sendOpen, sendPING, sendPONG, sendToken, setObject, setOutgoingVocabulary

Inherited from banana.Banana (private): _slice_error

Inherited from twisted.internet.protocol.BaseProtocol: __providedBy__, makeConnection

Inherited from referenceable.Referenceable: doRemoteCall, getInterface, getInterfaceName

Inherited from referenceable.OnlyReferenceable: processUniqueID

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variables [hide private]
  unsafeTracebacks = True
  requireSchema = False
  disconnected = False
  factory = None
  remote_broker = None
  startingTLS = False
  startedTLS = False
  use_remote_broker = True
  __implemented__ = <implementedBy foolscap.broker.Broker>
  __provides__ = <zope.interface.declarations.ClassProvides obje...

Inherited from banana.Banana: debugReceive, debugSend, disconnectTimeout, disconnectTimer, keepaliveTimeout, keepaliveTimer, logReceiveErrors, logViolations, paused, streamable, useKeepalives

Inherited from twisted.internet.protocol.BaseProtocol: connected, transport

Instance Variables [hide private]
  tub = None
the Tub which contains us
  yourReferenceByCLID
maps your CLID to a RemoteReferenceData #@ivar yourReferenceByName: maps a per-Tub name to a RemoteReferenceData
  yourReferenceByURL
maps a global URL to a RemoteReferenceData
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, remote_tubref, params={}, keepaliveTimeout=None, disconnectTimeout=None)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Parameters:
  • features - a dictionary of negotiated connection features
Overrides: object.__init__
(inherited documentation)

connectionMade(self)

source code 

Called when a connection is made.

This may be considered the initializer of the protocol, because it is called when the connection is completed. For clients, this is called once the connection to the server has been established; for servers, this is called after an accept() call stops blocking and a socket has been received. If you need to send any greeting or initial message, do it here.

Overrides: twisted.internet.protocol.BaseProtocol.connectionMade
(inherited documentation)

connectionTimedOut(self)

source code 
Overrides: banana.Banana.connectionTimedOut

shutdown(self, why, fireDisconnectWatchers=True)

source code 

Stop using this connection. If fireDisconnectWatchers is False, all disconnect watchers are removed before shutdown, so they will not be called (this is appropriate when the Broker is shutting down because the whole Tub is being shut down). We terminate the connection quickly, rather than waiting for the transmit queue to drain.

connectionLost(self, why)

source code 

Called when the connection is shut down.

Clear any circular references here, and any external references to this Protocol. The connection has been closed.

Overrides: twisted.internet.protocol.Protocol.connectionLost
(inherited documentation)

getTrackerForYourReference(self, clid, interfaceName=None, url=None)

source code 

The far end holds a Referenceable and has just sent us a reference to it (expressed as a small integer). If this is a new reference, they will give us an interface name too, and possibly a global URL for it. Obtain a RemoteReference object (creating it if necessary) to give to the local recipient.

The sender remembers that we hold a reference to their object. When our RemoteReference goes away, we send a decref message to them, so they can possibly free their object.

getMyReferenceByCLID(self, clid)

source code 

clid is the connection-local ID of the Referenceable the other end is trying to invoke or point to. If it is a number, they want an implicitly-created per-connection object that we sent to them at some point in the past. If it is a string, they want an object that was registered with our Factory.


Class Variable Details [hide private]

__provides__

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