Package twisted :: Package internet :: Module app :: Class ApplicationService

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

## Class ApplicationService

    OriginalAccessor --+
                       |
           Versioned --+
                       |
                      ApplicationService

Known Subclasses:
  `Service`, `MultiService`, `ProcessMonitor`, `SpiderSender`

I am a service you can add to an application.

I represent some chunk of functionality which may be bound to many or no event sources. By adding an ApplicationService to an `Application`, it will be notified when the Application starts and stops (or removes/shuts down the service). See the `startService` and `stopService` calls.

Since services may want to incorporate certain other elements, notably Perspective Broker (remote invocation) accessibility and authentication, derivatives of ApplicationService exist in `twisted.cred.service<twisted.cred.service.Service>` and `twisted.spread.pb<twisted.spread.pb.Service>`. These may be more suitable for your service than directly subclassing ApplicationService.

Method Summary
| ``__init__`(self, serviceName, serviceParent, application)` Create me, attached to the given 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`)
| ``disownServiceParent`(self)` Have my parent disown me.
| `get_application(self)`
| ``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)`
| `setApplication(self, application)`
| ``setServiceParent`(self, serviceParent)` Set my parent, which must be a service collection of some kind.
| ``startService`(self)` This call is made as a service starts up.
| ``stopService`(self)` This call is made before shutdown.
| `upgradeToVersion1(self)`
| ``versionUpgrade`(self)` (internal) Do a version upgrade. (inherited from `Versioned`)

Class Variable Summary
`int` | `persistenceVersion`
`None` | `serviceName`
`None` | `serviceParent`
`int` | `serviceRunning`
`None` | `serviceType`

Method Details

### __init__(self, serviceName, serviceParent=None, application=None)
(Constructor)

Create me, attached to the given application.

Arguments: application, a twisted.internet.app.Application instance.

### disownServiceParent(self)

Have my parent disown me.

### setServiceParent(self, serviceParent)

Set my parent, which must be a service collection of some kind.

### startService(self)

This call is made as a service starts up.

### stopService(self)

This call is made before shutdown.

Class Variable Details

### persistenceVersion

  Type:
    `int`
  Value:

        1

### serviceName

  Type:
    `None`
  Value:

        None

### serviceParent

  Type:
    `None`
  Value:

        None

### serviceRunning

  Type:
    `int`
  Value:

        0

### serviceType

  Type:
    `None`
  Value:

        None

Generated by Epydoc 1.1 on Sat Feb 15 21:17:51 2003 | http://epydoc.sf.net