Package Halberd :: Module crew :: Class BaseScanner

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

## Type BaseScanner

    object --+
             |
      _Verbose --+
                 |
            Thread --+
                     |
                    BaseScanner

Known Subclasses:
  `Manager`, `Scanner`

Base class for load balancer scanning threads.

Method Summary
| ``__init__`(self, state, scantask)` Initializes the scanning thread.
`bool` | ``hasExpired`(self)` Expiration predicate.
| ``process`(self)` Perform a scanning task.
`int` | ``remaining`(self, end)` Seconds left until a given point in time.
| ``run`(self)` Perform the scan.
`float` | ``setTimeout`(self, secs)` Compute an expiration time.
Inherited from Thread
| ``__repr__`(self)`
| ``getName`(self)`
| ``isAlive`(self)`
| ``isDaemon`(self)`
| ``join`(self, timeout)`
| ``setDaemon`(self, daemonic)`
| ``setName`(self, name)`
| ``start`(self)`
| ``_set_daemon`(self)`
Inherited from _Verbose
| ``_note`(self, format, *args)`
Inherited from object
| ``__delattr__`(...)` x.__delattr__('name') <==> del x.name
| ``__getattribute__`(...)` x.__getattribute__('name') <==> x.name
| ``__hash__`(x)` x.__hash__() <==> hash(x)
| ``__new__`(T, S, ...)` T.__new__(S, ...) -> a new object with type S, a subtype of T
| ``__reduce__`(...)` helper for pickle
| ``__reduce_ex__`(...)` helper for pickle
| ``__setattr__`(...)` x.__setattr__('name', value) <==> x.name = value
| ``__str__`(x)` x.__str__() <==> str(x)

Instance Variable Summary
`float` | `timeout`: Time (in seconds since the UNIX Epoch) when the scan will be stopped.

Class Variable Summary
Inherited from Thread
`bool` | `_Thread__initialized` = `False`

Method Details

### __init__(self, state, scantask)
(Constructor)

Initializes the scanning thread.

  Parameters:
    `state` - Container to store the results of the scan (shared among scanning threads).
    (type=`instanceof(ScanState)`)
    `scantask` - Object providing information needed to perform the scan.
    (type=`instanceof(ScanTask)`)
  Overrides:
    `threading.Thread.__init__`

### hasExpired(self)

Expiration predicate.

  Returns:
    True if the timeout has expired, False otherwise.
    (type=`bool`)

### process(self)

Perform a scanning task.

This method should be overriden to do actual work.

### remaining(self, end=None)

Seconds left until a given point in time.

  Parameters:
    `end` - Ending time.
    (type=`float`)
  Returns:
    Remaining time until `self.timeout`
    (type=`int`)

### run(self)

Perform the scan.

  Overrides:
    `threading.Thread.run`

### setTimeout(self, secs)

Compute an expiration time.

  Parameters:
    `secs` - Amount of seconds to spend scanning the target.
    (type=`int`)
  Returns:
    The moment in time when the task expires.
    (type=`float`)

Instance Variable Details

### timeout

Time (in seconds since the UNIX Epoch) when the scan will be stopped.

  Type:
    `float`

Generated by Epydoc 2.1 on Wed Jul 18 22:25:57 2007 | http://epydoc.sf.net