Package flumotion :: Package service :: Module service :: Class Servicer
[show private | hide private]
[frames | no frames]

Class Servicer

Loggable --+
           |
          Servicer


I manage running managers and workers on behalf of a service script.
Method Summary
  __init__(self, configDir)
  clean(self, args)
Clean up dead processes as given in the args.
  getManagers(self)
Return a dictionary of manager names -> flow names
  getWorkers(self)
Return a list of worker names
  list(self)
List all service parts managed.
  start(self, args)
Start processes as given in the args.
  startManager(self, name, flowNames)
Start the manager as configured in the manager directory for the given manager name, together with the given flows.
  startProcess(self, command)
Start the given process and block.
  startWorker(self, name)
Start the worker as configured in the worker directory for the given worker name.
  status(self, args)
Give status on processes as given in the args.
  stop(self, args)
Stop processes as given in the args.
  stopManager(self, name)
Stop the given manager if it is running.
  stopProcess(self, pid)
Stop the process with the given pid.
  stopWorker(self, name)
Stop the given worker if it is running.
    Inherited from Loggable
  debug(self, *args)
Log a debug message.
dict doLog(self, level, where, format, *args, **kwargs)
Log a message at the given level, with the possibility of going higher up in the stack.
  error(self, *args)
Log an error.
  info(self, *args)
Log an informational message.
  log(self, *args)
Log a log message.
  logFunction(self, *args)
Overridable log function.
  logObjectName(self)
Overridable object name function.
  warning(self, *args)
Log a warning.
  warningFailure(self, failure, swallow)
Log a warning about a Failure.

Class Variable Summary
str logCategory: Implementors can provide a category to log their messages under.
    Inherited from Loggable
Implements __implemented__ = <implementedBy flumotion.common.log.Lo...
ClassProvides __providedBy__ = <zope.interface.declarations.ClassProvi...
ClassProvides __provides__ = <zope.interface.declarations.ClassProvide...

Method Details

__init__(self, configDir)
(Constructor)

Parameters:
configDir - path to the configuration directory
           (type=string)

clean(self, args)

Clean up dead processes as given in the args.

getManagers(self)

Returns:
a dictionary of manager names -> flow names

getWorkers(self)

Returns:
a list of worker names

list(self)

List all service parts managed.

start(self, args)

Start processes as given in the args.

If nothing specified, start all managers and workers. If first argument is "manager", start given manager, or all if none specified. If first argument is "worker", start given worker, or all if none specified.
Returns:
an exit value reflecting the number of processes that failed to start

startManager(self, name, flowNames)

Start the manager as configured in the manager directory for the given manager name, together with the given flows.
Returns:
whether or not the manager daemon started

startProcess(self, command)

Start the given process and block. Returns the exit status of the process, or -1 in case of another error.

startWorker(self, name)

Start the worker as configured in the worker directory for the given worker name.
Returns:
whether or not the worker daemon started

status(self, args)

Give status on processes as given in the args.

stop(self, args)

Stop processes as given in the args.

If nothing specified, stop all managers and workers. If first argument is "manager", stop given manager, or all if none specified. If first argument is "worker", stop given worker, or all if none specified.
Returns:
an exit value reflecting the number of processes that failed to stop

stopManager(self, name)

Stop the given manager if it is running.

stopProcess(self, pid)

Stop the process with the given pid. Wait until the pid has disappeared.

stopWorker(self, name)

Stop the given worker if it is running.

Class Variable Details

logCategory

Implementors can provide a category to log their messages under.
Type:
str
Value:
'servicer'                                                             

Generated by Epydoc 2.1 on Fri Feb 2 11:29:21 2007 http://epydoc.sf.net