Package ZenHub :: Module PBDaemon :: Class PBDaemon
[hide private]
[frames] | no frames]

Class PBDaemon

source code

Products.ZenUtils.ZenDaemon.ZenDaemon --+
                                        |
      twisted.spread.pb.Referenceable --+
                                        |
                                       PBDaemon

Instance Methods [hide private]
 
__init__(self, noopts=0, keeproot=False) source code
 
gotPerspective(self, perspective)
This gets called every time we reconnect.
source code
 
connect(self) source code
 
eventService(self) source code
 
getServiceNow(self, svcName) source code
 
getService(self, serviceName, serviceListeningInterface=None)
Attempt to get a service from zenhub.
source code
 
getInitialServices(self)
After connecting to zenhub, gather our initial list of services.
source code
 
connected(self) source code
 
run(self) source code
 
sigTerm(self, signum=None, frame=None) source code
 
setExitCode(self, exitcode) source code
 
stop(self, ignored='') source code
 
sendEvents(self, events) source code
 
sendEvent(self, event, **kw)
Add event to queue of events to be sent.
source code
 
pushEventsLoop(self)
Periodially, wake up and flush events to ZenHub.
source code
 
pushEvents(self, driver)
Flush events to ZenHub.
source code
 
heartbeat(self)
if cycling, send a heartbeat, else, shutdown
source code
 
remote_getName(self) source code
 
remote_shutdown(self, unused) source code
 
remote_setPropertyItems(self, items) source code
 
remote_updateThresholdClasses(self, classes) source code
 
buildOptions(self) source code
Class Variables [hide private]
  name = 'pbdaemon'
  initialServices = ['EventService']
  heartbeatEvent = {'eventClass': Heartbeat}
  heartbeatTimeout = 60* 3
  _customexitcode = 0
  _sendingEvents = False
Method Details [hide private]

gotPerspective(self, perspective)

source code 
This gets called every time we reconnect.
Parameters:
  • perspective (Twisted perspective object) - Twisted perspective object

getService(self, serviceName, serviceListeningInterface=None)

source code 
Attempt to get a service from zenhub. Returns a deferred. When service is retrieved it is stashed in self.services with serviceName as the key. When getService is called it will first check self.services and if serviceName is already there it will return the entry from self.services wrapped in a defer.succeed

sendEvent(self, event, **kw)

source code 
Add event to queue of events to be sent. If we have an event service then process the queue.

remote_updateThresholdClasses(self, classes)

source code 
Decorators:
  • @translateError