Package twisted :: Package application :: Module service :: Class IServiceCollection

[frames | no frames]

## Class IServiceCollection

    Interface --+
                |
               IServiceCollection

Collection of services.

Contain several services, and manage their start-up/shut-down. Services can be accessed by name if they have a name, and it is always possible to iterate over them.

Method Summary
| ``__iter__`(self)` Get an iterator over all child services
| ``addService`(self, service)` Add a child service.
`IService` @raise `KeyError`: Raised if the service has no child with the given name. | ``getServiceNamed`(self, name)` Get the child service with a given name.
`Deferred` | ``removeService`(self, service)` Remove a child service.

Method Details

### __iter__(self)

Get an iterator over all child services

### addService(self, service)

Add a child service.

  Parameters:
    `service`
    (type=`IService` @raise `RuntimeError`: Raised if the service has a child with the given name.)

### getServiceNamed(self, name)

Get the child service with a given name.

  Parameters:
    `name`
    (type=`str`)
  Returns:
    `IService` @raise `KeyError`: Raised if the service has no child with the given name.

### removeService(self, service)

Remove a child service.

  Parameters:
    `service`
    (type=`IService` @raise `ValueError`: Raised if the given service is not a child.)
  Returns:
    a deferred which is triggered when the service has finished shutting down. If shutting down is immediate, a value can be returned (usually, None).
    (type=`Deferred`)

Generated by Epydoc 2.0 on Sat May 15 20:07:39 2004 | http://epydoc.sf.net