Package spoon :: Package transports :: Class TransportHub
[show private | hide private]
[frames | no frames]

Type TransportHub

object --+
         |
        TransportHub


Where all of your transports connect to form your glorious new node.
Method Summary
  addTransport(t)
Must be called after a transport is initialized to initiate the spoonRPC protocol. (Static method)
  removeTransport(t)
Must be called after a transport has been made inactive. (Static method)
  setLogger(logger)
Sets a logger object for SpoonRPC to use. (Static method)
    Inherited from object
  __init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
x.__repr__() <==> repr(x)
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Class Variable Summary
NullLogger _log = <spoon.NullLogger.NullLogger object at 0xa7bbd84c...
list activeTransports: A simple list of the transports that are currently active
dict links: A dict, keys are the node id of the directly connected neighbor and the values are the associated transport
int nodeId: The local node id.

Static Method Details

addTransport(t)

Must be called after a transport is initialized to initiate the spoonRPC protocol.
Parameters:
t - The transport being initialized
Returns:
Nothing
Raises:
TransportException - If the protocol initialization fails for some reason.

removeTransport(t)

Must be called after a transport has been made inactive.

setLogger(logger)

Sets a logger object for SpoonRPC to use.

This can be a python logger object, or just anything that supports that general protocol. It defaults to NullLogger which does nothing with the messages.

Class Variable Details

_log

Type:
NullLogger
Value:
<spoon.NullLogger.NullLogger object at 0xa7bbd84c>                     

activeTransports

A simple list of the transports that are currently active
Type:
list
Value:
[]                                                                     

links

A dict, keys are the node id of the directly connected neighbor and the values are the associated transport
Type:
dict
Value:
{}                                                                     

nodeId

The local node id. This must be set to the node's integer id before the spoon transport hub is started. The nodeId is just a network wide, unique int. How this is determined is left as an excercise for the implementation. In most cases, it should probably be something that is constant for the host/program between instances.
Type:
int
Value:
None                                                                  

Generated by Epydoc 2.1 on Sun Nov 26 15:32:15 2006 http://epydoc.sf.net