예제 #1
0
 def start(self):
     alias = self.alias
     class_name = self.class_name
     lifetime = self.lifetime
     # Register with our parent the named object
     self.parent.register_deployed_object(alias, class_name, lifetime)
     ServiceNode.start(self)
예제 #2
0
 def __init__(self):
     self.ttl = 3600
     self._lock = Lock()
     self._sessions = None
     self._scheduled = None
     self.user_manager = None
     ServiceNode.__init__(self)
예제 #3
0
파일: _manager.py 프로젝트: mcruse/monotone
 def __init__(self):
     self.ttl = 3600
     self._lock = Lock()
     self._sessions = None
     self._scheduled = None
     self.user_manager = None
     ServiceNode.__init__(self)
예제 #4
0
 def __init__(self):
     ServiceNode.__init__(self)
     # Instantiate implicit children.
     from mpx.service.interactive import InteractiveService
     InteractiveService().configure({
         'name': 'Interactive Service',
         'parent': self,
         'debug': 0,
         'port': 9666,
         'interface': 'localhost'
     })
     from mpx.service.time import Time
     Time().configure({'name': 'time', 'parent': self})
     from mpx.service.session import SessionManager
     SessionManager().configure({'name': 'session_manager', 'parent': self})
     from mpx.service.user_manager import UserManager
     UserManager().configure({'name': 'User Manager', 'parent': self})
     from mpx.service.subscription_manager import SUBSCRIPTION_MANAGER
     SUBSCRIPTION_MANAGER.configure({
         'name': 'Subscription Manager',
         'parent': self
     })
     # Guarantee that /services/garbage_collector will exist, whether or not
     # there is an entry in the XML file.
     from mpx.service.garbage_collector import GARBAGE_COLLECTOR
     # @todo Make ReloadableSingleton!
     GARBAGE_COLLECTOR.configure({
         'name': 'garbage_collector',
         'parent': self
     })
예제 #5
0
파일: __init__.py 프로젝트: mcruse/monotone
 def start(self):
     alias = self.alias
     class_name = self.class_name
     lifetime = self.lifetime
     # Register with our parent the named object
     self.parent.register_deployed_object(alias, class_name, lifetime)
     ServiceNode.start(self)
예제 #6
0
파일: _manager.py 프로젝트: mcruse/monotone
 def stop(self):
     self._begin_critical_section()
     try:
         if self._scheduled:
             self._scheduled.cancel()
         self._scheduled = None
         self._sessions = None
     finally:
         self._end_critical_section()
     self.user_manager = None
     return ServiceNode.stop(self)
예제 #7
0
 def stop(self):
     self._begin_critical_section()
     try:
         if self._scheduled:
             self._scheduled.cancel()
         self._scheduled = None
         self._sessions = None
     finally:
         self._end_critical_section()
     self.user_manager = None
     return ServiceNode.stop(self)
예제 #8
0
 def start(self):
     self._begin_critical_section()
     try:
         if self._sessions is None:
             self._sessions = PersistentDictionary(self.name,
                                                   encode=Session.encode,
                                                   decode=Session.decode)
         if not self._scheduled:
             self._scheduled = scheduler.every(self.ttl, self.collect)
     finally:
         self._end_critical_section()
     self.user_manager = as_node("/services/User Manager")
     return ServiceNode.start(self)
예제 #9
0
파일: __init__.py 프로젝트: mcruse/monotone
 def __init__(self):
     ServiceNode.__init__(self)
     # Instantiate implicit children.
     from mpx.service.interactive import InteractiveService
     InteractiveService().configure({'name':'Interactive Service',
                                     'parent':self,'debug':0,
                                     'port':9666,'interface':'localhost'})
     from mpx.service.time import Time
     Time().configure({'name':'time','parent':self})
     from mpx.service.session import SessionManager
     SessionManager().configure({'name':'session_manager', 'parent':self})
     from mpx.service.user_manager import UserManager
     UserManager().configure({'name':'User Manager', 'parent':self})
     from mpx.service.subscription_manager import SUBSCRIPTION_MANAGER
     SUBSCRIPTION_MANAGER.configure({'name':'Subscription Manager',
                                     'parent':self})
     # Guarantee that /services/garbage_collector will exist, whether or not
     # there is an entry in the XML file.
     from mpx.service.garbage_collector import GARBAGE_COLLECTOR
     # @todo Make ReloadableSingleton!
     GARBAGE_COLLECTOR.configure({'name':'garbage_collector',
                                  'parent':self})
예제 #10
0
파일: _manager.py 프로젝트: mcruse/monotone
 def start(self):
     self._begin_critical_section()
     try:
         if self._sessions is None:
             self._sessions = PersistentDictionary(self.name, 
                                                   encode=Session.encode, 
                                                   decode=Session.decode)
         if not self._scheduled:
             self._scheduled = scheduler.every(self.ttl, self.collect)
     finally:
         self._end_critical_section()
     self.user_manager = as_node("/services/User Manager")
     return ServiceNode.start(self)
예제 #11
0
파일: __init__.py 프로젝트: mcruse/monotone
 def configure(self, config):
     set_attribute(self, 'alias', REQUIRED, config)
     set_attribute(self, 'class_name',REQUIRED, config)
     set_attribute(self, 'lifetime', 'Request',config)        
     ServiceNode.configure(self, config)
예제 #12
0
파일: _manager.py 프로젝트: mcruse/monotone
 def configuration(self):
     cd = ServiceNode.configuration(self)
     get_attribute(self, 'ttl', cd, str)
     return cd
예제 #13
0
파일: _manager.py 프로젝트: mcruse/monotone
 def configure(self, cd):
     ServiceNode.configure(self, cd)
     set_attribute(self, 'ttl', self.ttl, cd, float)
     self.enabled = 1
예제 #14
0
 def configure(self, cd):
     ServiceNode.configure(self, cd)
     set_attribute(self, 'ttl', self.ttl, cd, float)
     self.enabled = 1
예제 #15
0
 def configuration(self):
     cd = ServiceNode.configuration(self)
     get_attribute(self, 'ttl', cd, str)
     return cd
예제 #16
0
 def configuration(self):
     config = ServiceNode.configuration(self)
     get_attribute(self, 'alias', config)
     get_attribute(self, 'class_name', config)
     get_attribute(self, 'lifetime', config)
     return config
예제 #17
0
 def configure(self, config):
     if not getattr(self, 'parent', None):
         config.setdefault('parent', '/')
     self.setattr('secured', as_boolean(config.get('secured', True)))
     ServiceNode.configure(self, config)
예제 #18
0
파일: __init__.py 프로젝트: mcruse/monotone
 def configuration(self):
     config = ServiceNode.configuration(self)
     config['secured'] = self.secured
     return config
예제 #19
0
 def configure(self, config):
     set_attribute(self, 'alias', REQUIRED, config)
     set_attribute(self, 'class_name', REQUIRED, config)
     set_attribute(self, 'lifetime', 'Request', config)
     ServiceNode.configure(self, config)
예제 #20
0
 def configure(self, cd):
     ServiceNode.configure(self, cd)
     self.name = 'nodetree_as_dict'
     return
예제 #21
0
파일: __init__.py 프로젝트: mcruse/monotone
 def configuration(self):
     config = ServiceNode.configuration(self)        
     get_attribute(self, 'alias', config)
     get_attribute(self, 'class_name', config)
     get_attribute(self, 'lifetime', config)
     return config
예제 #22
0
파일: __init__.py 프로젝트: mcruse/monotone
 def children_names(self, **options):
     children = ServiceNode.children_names(self, **options)
     children.sort(service_sort)
     return children
예제 #23
0
 def configuration(self):
     config = ServiceNode.configuration(self)
     config['secured'] = self.secured
     return config
예제 #24
0
 def children_names(self, **options):
     children = ServiceNode.children_names(self, **options)
     children.sort(service_sort)
     return children
예제 #25
0
파일: __init__.py 프로젝트: mcruse/monotone
 def configure(self, config):
     if not getattr(self, 'parent', None):
         config.setdefault('parent', '/')
     self.setattr('secured', as_boolean(config.get('secured', True)))
     ServiceNode.configure(self, config)
예제 #26
0
 def configure(self, cd):
     ServiceNode.configure(self, cd)
     self.name = 'nodetree_as_dict'
     return