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

[frames | no frames]

## Class ApplicationService

     Accessor --+
                |
    Versioned --+
                |
               ApplicationService

Known Subclasses:
  `MultiService`, `Service`

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` and `twisted.spread.pb`. 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.
| ``disownServiceParent`(self)` Have my parent disown me.
| `get_application(self)`
| `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)`
Inherited from Accessor
| ``__delattr__`(self, k)`
| ``__getattr__`(self, k)`
| ``__setattr__`(self, k, v)`
| ``reallyDel`(self, k)` *actually* del self.k without incurring side-effects.
| ``reallySet`(self, k, v)` *actually* set self.k to v without incurring side-effects.
Inherited from Versioned
| ``__getstate__`(self, dict)` Get state, adding a version number to it on its way out.
| ``__setstate__`(self, state)`
| ``versionUpgrade`(self)` (internal) Do a version upgrade.

Class Variable Summary
`int` | `persistenceVersion` = 1
`NoneType` | `serviceName` = None
`NoneType` | `serviceParent` = None
`int` | `serviceRunning` = 0
`NoneType` | `serviceType` = None
Inherited from Versioned
`tuple` | `persistenceForgets` = `()`

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:
    `NoneType`
  Value:

        None

### serviceParent

  Type:
    `NoneType`
  Value:

        None

### serviceRunning

  Type:
    `int`
  Value:

        0

### serviceType

  Type:
    `NoneType`
  Value:

        None

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