Module watchdog
[hide private]
[frames] | no frames]

Source Code for Module watchdog

 1  # 
 2  # Copyright (c) 2011 Red Hat, Inc. 
 3  # 
 4  # This software is licensed to you under the GNU Lesser General Public 
 5  # License as published by the Free Software Foundation; either version 
 6  # 2 of the License (LGPLv2) or (at your option) any later version. 
 7  # There is NO WARRANTY for this software, express or implied, 
 8  # including the implied warranties of MERCHANTABILITY, 
 9  # NON-INFRINGEMENT, or FITNESS FOR A PARTICULAR PURPOSE. You should 
10  # have received a copy of LGPLv2 along with this software; if not, see 
11  # http://www.gnu.org/licenses/old-licenses/lgpl-2.0.txt. 
12  # 
13  # Jeff Ortel <jortel@redhat.com> 
14  # 
15   
16  from gofer.decorators import * 
17  from gofer.agent.plugin import Plugin 
18  from gofer.rmi.async import WatchDog as Impl 
19  from gofer.rmi.async import Journal 
20  from logging import getLogger 
21   
22  log = getLogger(__name__) 
23  plugin = Plugin.find(__name__) 
24  cfg = plugin.cfg() 
25 26 27 -class WatchDog:
28
29 - def __init__(self):
30 jdir = cfg.journal.dir 31 self.__impl = Impl(journal=Journal(jdir))
32 33 @remote
34 - def track(self, sn, replyto, any, timeout):
35 return self.__impl.track(sn, replyto, any, timeout)
36 37 @remote
38 - def hack(self, sn):
39 return self.__impl.hack(sn)
40 41 @remote 42 @action(seconds=1)
43 - def process(self):
44 self.__impl.process()
45