Package twisted :: Package internet :: Module app :: Class Application |
[frames | no frames]

## Class Application

    _AbstractServiceCollection --+
                                 |
                      Accessor --+
                                 |
                        Logger --+
                                 |
                     Versioned --+
                                 |
                                Application

I am the `root object' in a Twisted process.

I represent a set of persistent, potentially interconnected listening TCP ports, delayed event schedulers, and service.Services.

Method Summary
| ``__init__`(self, name, uid, gid, authorizer, authorizer_)` Initialize me.
| `__getstate__(self)`
| `__repr__(self)`
| `_afterShutDown(self)`
| `_beforeShutDown(self)`
| `_doBindPorts(self)`
| `bindPorts(self)`
| ``connectSSL`(self, host, port, factory, ctxFactory, timeout, bindAddress)` Connect a given client protocol factory to a specific SSL server.
| ``connectTCP`(self, host, port, factory, timeout, bindAddress)` Connect a given client protocol factory to a specific TCP server.
| ``connectUDP`(self, remotehost, remoteport, protocol, localport, interface, maxPacketSize)` Connects a `ConnectedDatagramProtocol` instance to a UDP port.
| ``connectUNIX`(self, address, factory, timeout)` Connect a given client protocol factory to a specific UNIX socket.
| ``connectWith`(self, connectorType, *args, **kw)` Start an instance of the given `connectorType` connecting.
| `get_authorizer(self)`
| ``listenSSL`(self, port, factory, ctxFactory, backlog, interface)` Connects a given protocol factory to the given numeric TCP/IP port.
| ``listenTCP`(self, port, factory, backlog, interface)` Connects a given protocol factory to the given numeric TCP/IP port.
| ``listenUDP`(self, port, proto, interface, maxPacketSize)` Connects a given DatagramProtocol to the given numeric UDP port.
| ``listenUNIX`(self, filename, factory, backlog, mode)` Connects a given protocol factory to the UNIX socket with the given filename.
| ``listenWith`(self, portType, *args, **kw)` Start an instance of the given `portType` listening.
| ``logPrefix`(self)` A log prefix which describes me.
| ``run`(self, save, installSignalHandlers)` run(save=1, installSignalHandlers=1) Run this application, running the main loop if necessary.
| ``save`(self, tag, filename, passphrase)` Save a pickle of this application to a file in the current directory.
| ``setEUID`(self)` Retrieve persistent uid/gid pair (if possible) and set the current process's euid/egid.
| ``setUID`(self)` Retrieve persistent uid/gid pair (if possible) and set the current process's uid/gid
| ``unlistenSSL`(self, port, interface)` Stop an SSL Port listening on the given interface and port.
| ``unlistenTCP`(self, port, interface)` Stop a Port listening on the given port and interface.
| ``unlistenUDP`(self, port, interface)` Stop a DatagramProtocol listening on the given local port and interface.
| ``unlistenUNIX`(self, filename)` Stop a Port listening on the given filename.
| ``unlistenWith`(self, portType, *args, **kw)` Stop a Port listening with the given parameters.
| ``upgradeToVersion1`(self)` Version 1 Persistence Upgrade
| `upgradeToVersion10(self)`
| `upgradeToVersion11(self)`
| `upgradeToVersion12(self)`
| ``upgradeToVersion2`(self)` Version 2 Persistence Upgrade
| ``upgradeToVersion3`(self)` Version 3 Persistence Upgrade
| ``upgradeToVersion4`(self)` Version 4 Persistence Upgrade
| `upgradeToVersion5(self)`
| `upgradeToVersion6(self)`
| `upgradeToVersion7(self)`
| `upgradeToVersion8(self)`
| `upgradeToVersion9(self)`
Inherited from Versioned
| ``__setstate__`(self, state)`
| ``versionUpgrade`(self)` (internal) Do a version upgrade.
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 _AbstractServiceCollection
| ``addService`(self, service)` Add a service to this collection.
| ``getServiceNamed`(self, serviceName)` Retrieve the named service from this application.
| ``removeService`(self, service)` Remove a service from this collection.

Class Variable Summary
`NoneType` | `_authorizer` = None
`int` | `_boundPorts` = 0
`int` | `persistenceVersion` = 12
`str` | `persistStyle` = `'pickle'`
`NoneType` | `processName` = None
`int` | `running` = 0
Inherited from Versioned
`tuple` | `persistenceForgets` = `()`
Inherited from _AbstractServiceCollection
`tuple` | `__implements__` = `(<class twisted.internet.interfaces.ISe...`

Method Details

### __init__(self, name, uid=None, gid=None, authorizer=None, authorizer_=None) (Constructor) Initialize me. If uid and gid arguments are not provided, this application will default to having the uid and gid of the user and group who created it. Parameters: `name` - a name `uid` - (optional) a POSIX user-id. Only used on POSIX systems. `gid` - (optional) a POSIX group-id. Only used on POSIX systems. Overrides: `twisted.internet.app._AbstractServiceCollection.__init__`

### connectSSL(self, host, port, factory, ctxFactory, timeout=30, bindAddress=None) Connect a given client protocol factory to a specific SSL server.

### connectTCP(self, host, port, factory, timeout=30, bindAddress=None) Connect a given client protocol factory to a specific TCP server.

### connectUDP(self, remotehost, remoteport, protocol, localport=0, interface='', maxPacketSize=8192) Connects a `ConnectedDatagramProtocol` instance to a UDP port.

### connectUNIX(self, address, factory, timeout=30) Connect a given client protocol factory to a specific UNIX socket.

### connectWith(self, connectorType, *args, **kw) Start an instance of the given `connectorType` connecting. Parameters: `connectorType` (type=type which implements `IConnector`)

### listenSSL(self, port, factory, ctxFactory, backlog=5, interface='') Connects a given protocol factory to the given numeric TCP/IP port. The connection is a SSL one, using contexts created by the context factory.

### listenTCP(self, port, factory, backlog=5, interface='') Connects a given protocol factory to the given numeric TCP/IP port.

### listenUDP(self, port, proto, interface='', maxPacketSize=8192) Connects a given DatagramProtocol to the given numeric UDP port.

### listenUNIX(self, filename, factory, backlog=5, mode=438) Connects a given protocol factory to the UNIX socket with the given filename.

### listenWith(self, portType, *args, **kw) Start an instance of the given `portType` listening. Parameters: `portType` (type=type which implements `IListeningPort`)

### logPrefix(self) A log prefix which describes me. Overrides: `twisted.python.log.Logger.logPrefix`

### run(self, save=1, installSignalHandlers=1) run(save=1, installSignalHandlers=1) Run this application, running the main loop if necessary. If 'save' is true, then when this Application is shut down, it will be persisted to a pickle. 'installSignalHandlers' is passed through to reactor.run(), the function that starts the mainloop.

### save(self, tag=None, filename=None, passphrase=None) Save a pickle of this application to a file in the current directory.

### setEUID(self) Retrieve persistent uid/gid pair (if possible) and set the current process's euid/egid.

### setUID(self) Retrieve persistent uid/gid pair (if possible) and set the current process's uid/gid

### unlistenSSL(self, port, interface='') Stop an SSL Port listening on the given interface and port.

### unlistenTCP(self, port, interface='') Stop a Port listening on the given port and interface.

### unlistenUDP(self, port, interface='') Stop a DatagramProtocol listening on the given local port and interface.

### unlistenUNIX(self, filename) Stop a Port listening on the given filename.

### unlistenWith(self, portType, *args, **kw) Stop a Port listening with the given parameters.

### upgradeToVersion1(self) Version 1 Persistence Upgrade

### upgradeToVersion2(self) Version 2 Persistence Upgrade

### upgradeToVersion3(self) Version 3 Persistence Upgrade

### upgradeToVersion4(self) Version 4 Persistence Upgrade

Class Variable Details

    ### _authorizer Type: `NoneType` Value:
        None

    ### _boundPorts Type: `int` Value:
        0

    ### persistenceVersion Type: `int` Value:
        12

    ### persistStyle Type: `str` Value:
        'pickle'

    ### processName Type: `NoneType` Value:
        None

    ### running Type: `int` Value:
        0

Generated by Epydoc 2.0 on Sat Oct 25 00:54:55 2003 | http://epydoc.sf.net