Package twisted :: Package sibling :: Module parentserv :: Class MotherService

[show private | hide private]
[frames | no frames]

## Class MotherService

    OriginalAccessor --+
                       |
           Versioned --+
                       |
      ApplicationService --+
                           |
                     Service --+
                               |
                         Service --+
                                   |
                 Perspective --+   |
                               |   |
                     Perspective --+
                                   |
                                  MotherService

A `mother' object, managing many sibling-servers.

I maintain a list of all "sibling" servers who are connected, so that all servers can connect to each other. I also negotiate which distributed objects are owned by which sibling servers, so that if any sibling-server needs to locate an object it can be made available.

Method Summary
| `__init__(self, sharedSecret, serviceName, application)`
| `__delattr__(self, k)` (inherited from `OriginalAccessor`)
| `__getattr__(self, k)` (inherited from `OriginalAccessor`)
| ``__getstate__`(self, dict)` Get state, adding a version number to it on its way out. (inherited from `Versioned`)
| `__setattr__(self, k, v)` (inherited from `OriginalAccessor`)
| `__setstate__(self, state)` (inherited from `Versioned`)
| ``addPerspective`(self, perspective)` Add a perspective to this Service. (inherited from `Service`)
| ``attached`(self, reference, identity)` Called when a remote reference is 'attached' to me. (inherited from `Perspective`)
| ``brokerAttached`(self, reference, identity, broker)` An intermediary method to override. (inherited from `Perspective`)
| ``brokerDetached`(self, reference, identity, broker)` See `brokerAttached`. (inherited from `Perspective`)
| ``cachePerspective`(self, perspective)` Cache a perspective loaded from an external data source. (inherited from `Service`)
| ``createPerspective`(self, name)` Create a perspective from self.perspectiveClass and add it to this service. (inherited from `Service`)
| `detached(self, client, identity)`
| ``disownServiceParent`(self)` Have my parent disown me. (inherited from `ApplicationService`)
| `get_application(self)` (inherited from `ApplicationService`)
| ``getIdentityRequest`(self)` Request my identity. (inherited from `Perspective`)
| ``getPerspectiveForIdentity`(self, name, identity)` A hook to use if the identity is required when getting the perspective. (inherited from `Service`)
| ``getPerspectiveName`(self)` Return the unique name of this perspective. (inherited from `Perspective`)
| ``getPerspectiveNamed`(self, name)` Return a perspective that represents a user for this service. (inherited from `Service`)
| ``getPerspectiveRequest`(self, name)` Return a Deferred which is a request for a perspective on this service. (inherited from `Service`)
| ``getService`(self)` Return a service. (inherited from `Perspective`)
| ``getServiceName`(self)` The name of this service. (inherited from `Service`)
| ``getServiceType`(self)` Get a string describing the type of this service. (inherited from `Service`)
Deferred Perspective | ``loadPerspective`(self, name)` Load a perspective from an external data-source. (inherited from `Service`)
| ``loadRemoteResource`(self, resourceType, resourceName, generateTicket, *args)` Request a sibling-server to load a resource.
| ``loadRemoteResourceFor`(self, siblingPerspective, resourceType, resourceName, generateTicket, *args)` Use to load a remote resource on a specified sibling service.
| ``makeIdentity`(self, password)` Make an identity from this perspective with a password. (inherited from `Perspective`)
| ``perspective_callDistributed`(self, srcResourceType, srcResourceName, destResourceType, destResourceName, methodName, *args, **kw)` Call a remote method on a resources that is managed by the system.
| ``perspective_publishIP`(self, host, port, clientRef)` called by sibling to set the host and port to publish for clients.
| ``perspective_unloadResource`(self, resourceType, resourceName)` This is called by sibling services to unload a resource
| ``perspectiveMessageReceived`(self, broker, message, args, kw)` This method is called when a network message is received. (inherited from `Perspective`)
| ``reallyDel`(self, k)` *actually* del self.k without incurring side-effects. (inherited from `OriginalAccessor`)
| ``reallySet`(self, k, v)` *actually* set self.k to v without incurring side-effects. (inherited from `OriginalAccessor`)
| `set_application(self, application)` (inherited from `ApplicationService`)
| `setApplication(self, application)` (inherited from `ApplicationService`)
| ``setIdentity`(self, ident)` Determine which identity I connect to. (inherited from `Perspective`)
| `setIdentityName(self, name)` (inherited from `Perspective`)
| ``setService`(self, service)` Change what service I am a part of. (inherited from `Perspective`)
| ``setServiceParent`(self, serviceParent)` Set my parent, which must be a service collection of some kind. (inherited from `ApplicationService`)
| ``startService`(self)` This call is made as a service starts up. (inherited from `ApplicationService`)
| ``stopService`(self)` This call is made before shutdown. (inherited from `ApplicationService`)
| ``uncachePerspective`(self, perspective)` Uncache a perspective loaded from an external data source. (inherited from `Service`)
| `upgradeToVersion1(self)` (inherited from `ApplicationService`)
| ``versionUpgrade`(self)` (internal) Do a version upgrade. (inherited from `Versioned`)
| `_cbLoadedResource(self, ticket, resourceType, resourceName, host, port, siblingPerspective)`

Method Details

### loadRemoteResource(self, resourceType, resourceName, generateTicket, *args)

Request a sibling-server to load a resource.

NOTE: caching of ticket resources could be an issue... do we cache tickets??

Return a Deferred which will fire with (ticket, host, port), that will describe where and how a resource can be located.

### loadRemoteResourceFor(self, siblingPerspective, resourceType, resourceName, generateTicket, *args)

Use to load a remote resource on a specified sibling service. Dont load it if already loaded on a sibling.

### perspective_callDistributed(self, srcResourceType, srcResourceName, destResourceType, destResourceName, methodName, *args, **kw)

Call a remote method on a resources that is managed by the system.

### perspective_publishIP(self, host, port, clientRef)

called by sibling to set the host and port to publish for clients.

### perspective_unloadResource(self, resourceType, resourceName)

This is called by sibling services to unload a resource

Generated by Epydoc 1.1 on Thu May 8 13:19:00 2003 | http://epydoc.sf.net