コード例 #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
ファイル: _manager.py プロジェクト: ed-aicradle/monotone
 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
ファイル: __init__.py プロジェクト: ed-aicradle/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
     })
コード例 #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
ファイル: _manager.py プロジェクト: ed-aicradle/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)
コード例 #8
0
ファイル: _manager.py プロジェクト: ed-aicradle/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)
コード例 #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
ファイル: _manager.py プロジェクト: ed-aicradle/monotone
 def configure(self, cd):
     ServiceNode.configure(self, cd)
     set_attribute(self, 'ttl', self.ttl, cd, float)
     self.enabled = 1
コード例 #15
0
ファイル: _manager.py プロジェクト: ed-aicradle/monotone
 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
ファイル: __init__.py プロジェクト: ed-aicradle/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)
コード例 #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
ファイル: __init__.py プロジェクト: ed-aicradle/monotone
 def configuration(self):
     config = ServiceNode.configuration(self)
     config['secured'] = self.secured
     return config
コード例 #24
0
ファイル: __init__.py プロジェクト: ed-aicradle/monotone
 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
ファイル: nodetree_svc.py プロジェクト: mcruse/monotone
 def configure(self, cd):
     ServiceNode.configure(self, cd)
     self.name = 'nodetree_as_dict'
     return