Пример #1
0
 def getParentMgr(self):
     if not hasattr(self, '_parentMgr'):
         self._parentMgr = ParentMgr.ParentMgr()
         self._parentMgr.registerParent(OTPGlobals.SPHidden, hidden)
         self._parentMgr.registerParent(OTPGlobals.SPRender,
                                        self.getRender())
     return self._parentMgr
Пример #2
0
    def __init__(self, dcFileNames = None, dcSuffix = '',
                 connectMethod = None, threadedNet = None):
        if connectMethod is None:
            connectMethod = self.CM_HTTP
        ConnectionRepository.__init__(self, connectMethod, base.config, hasOwnerView = True, threadedNet = threadedNet, dcStream = dcStream)
        self.dcSuffix = dcSuffix
        if hasattr(self, 'setVerbose'):
            if self.config.GetBool('verbose-clientrepository'):
                self.setVerbose(1)

        self.context=100000
        self.setClientDatagram(1)

        self.deferredGenerates = []
        self.deferredDoIds = {}
        self.lastGenerate = 0
        self.setDeferInterval(base.config.GetDouble('deferred-generate-interval', 0.2))
        self.noDefer = False  # Set this True to temporarily disable deferring.

        self.recorder = base.recorder

        self.readDCFile(dcFileNames)
        self.cache=CRCache.CRCache()
        self.doDataCache = CRDataCache()
        self.cacheOwner=CRCache.CRCache()
        self.serverDelta = 0

        self.bootedIndex = None
        self.bootedText = None

        # create a parentMgr to handle distributed reparents
        # this used to be 'token2nodePath'
        self.parentMgr = ParentMgr.ParentMgr()

        # The RelatedObjectMgr helps distributed objects find each
        # other.
        self.relatedObjectMgr = RelatedObjectMgr.RelatedObjectMgr(self)

        # This will be filled in when a TimeManager is created.
        self.timeManager = None

        # Keep track of how recently we last sent a heartbeat message.
        # We want to keep these coming at heartbeatInterval seconds.
        self.heartbeatInterval = base.config.GetDouble('heartbeat-interval', 10)
        self.heartbeatStarted = 0
        self.lastHeartbeat = 0

        self._delayDeletedDOs = {}

        self.specialNameNumber = 0
Пример #3
0
 def __init__(self,
              dcFileNames=None,
              dcSuffix='',
              connectMethod=None,
              threadedNet=None):
     if connectMethod is None:
         connectMethod = self.CM_HTTP
     ConnectionRepository.__init__(self,
                                   connectMethod,
                                   base.config,
                                   hasOwnerView=True,
                                   threadedNet=threadedNet,
                                   dcStream=dcStream)
     self.dcSuffix = dcSuffix
     if hasattr(self, 'setVerbose'):
         if self.config.GetBool('verbose-clientrepository'):
             self.setVerbose(1)
     self.context = 100000
     self.setClientDatagram(1)
     self.deferredGenerates = []
     self.deferredDoIds = {}
     self.lastGenerate = 0
     self.setDeferInterval(
         base.config.GetDouble('deferred-generate-interval', 0.2))
     self.noDefer = False
     self.recorder = base.recorder
     self.readDCFile(dcFileNames)
     self.cache = CRCache.CRCache()
     self.doDataCache = CRDataCache()
     self.cacheOwner = CRCache.CRCache()
     self.serverDelta = 0
     self.bootedIndex = None
     self.bootedText = None
     self.parentMgr = ParentMgr.ParentMgr()
     self.relatedObjectMgr = RelatedObjectMgr.RelatedObjectMgr(self)
     self.timeManager = None
     self.heartbeatInterval = base.config.GetDouble('heartbeat-interval',
                                                    10)
     self.heartbeatStarted = 0
     self.lastHeartbeat = 0
     self._delayDeletedDOs = {}
     self.specialNameNumber = 0