Exemple #1
0
 def __init__(self, warmStart=False):
     self.openContexts = {}
     self.buffer = Queue(1)
     self.GUI_Operations = GUIOperations(self)
     # Obtain the list of available contexts from cfg file
     self.contexts = Config.instance().getAvailableContexts()
     # Update the context status map (all available)
     for ctx in self.contexts:
         self.contextPorts[ctx] = 0
         self.contextStatus[ctx] = LstMessages.DATA_CTX_AVAILABLE
     self.__ctxIFC = IPCinterfaceServer("LST-CTX")
     self.__guiIFC = IPCinterfaceServer("LST-GUI")
     self.__clientLock = thread.allocate_lock()
     self.__ctxLock = thread.allocate_lock()
     self.__contextRegistry = ProcessRegistry("LST", warmStart)
Exemple #2
0
 def __init__(self, ctxName, listenerPort, warmStart=False):
     LOG("Created context", level=LOG_INIT)
     self.ctxName = ctxName
     self.port = None
     self.__executorInstanceNumbers = {}
     self.__executorManagers = {}
     self.__clientInfo = {}
     self.GUI_Operations = GUIOperations(self)
     self.LST_Operations = LSTOperations(self)
     self.EXC_Operations = EXCOperations(self)
     self.__guiIFC = IPCinterfaceServer("CTX-GUI")
     self.__lstIFC = IPCinterfaceClient("CTX-LST")
     self.listenerPort = listenerPort
     self.__clientLock = thread.allocate_lock()
     self.__execLock = thread.allocate_lock()
     self.__closeLock = Queue.Queue(1)
     self.__executorsRegistry = ProcessRegistry("CTX_" + ctxName, warmStart)
Exemple #3
0
 def killContext(self, contextName):
     contextKey = self.contextKeys[contextName]
     LOG("Killing context '" + contextName + "':" + repr(contextKey),
         level=LOG_PROC)
     self.__ctxIFC.disconnect(contextKey, eoc=False)
     ProcessManager.instance().killProcess(contextName)
     LOG("Context killed", level=LOG_PROC)
     self.contextStatus[contextName] = LstMessages.DATA_CTX_AVAILABLE
     self.clearContext(contextName)
     # Now kill all associated executors
     try:
         registry = ProcessRegistry("CTX_" + contextName, True)
         executors = registry.getProcesses()
         for ex in executors:
             LOG("Killing child executor " + str(ex))
             ProcessManager.instance().killPID(ex.getPID())
             registry.removeProcess(ex.getName())
     except BaseException, ex:
         LOG(
             "Unable to kill associated executors in context " +
             contextName + ": " + str(ex), LOG_ERROR)