Exemplo n.º 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)
Exemplo n.º 2
0
 def __init__(self, context, procId):
     threading.Thread.__init__(self)
     # Store context reference
     self.__context = context
     # Initialize executor status
     self.__procId = procId
     self.__execStatus = server.executor.status.UNINIT
     self.__execError = " "
     self.__execReason = " "
     self.__execKey = None
     self.__execPort = None
     self.__execAsRun = None
     self.__execPID = None
     self.__parentProc = None
     self.__execLog = None
     self.__controllingKey = NO_CLIENT
     self.__monitoringKeys = []
     self.__execLock = Queue.Queue(1)
     self.__closeLock = Queue.Queue(1)
     self.__contextLock = Queue.Queue(1)
     self.__csp = None
     self.__ready = False
     self.__arguments = {}
     self.__openMode = {}
     self.__condition = None
     # IPC interface for executors
     self.__execIFC = IPCinterfaceServer("EXM-EXC")
     # Obtain the executor start command
     execScript = Config.instance().getProperty(CONTEXT, "ExecutorScript")
     pythonBin = os.getenv("PYTHON", "python")
     arguments = "-c \"" + Config.instance().filename + "\" -n \"" +\
                 self.__context.ctxName + "\"" + " -p \"" + self.__procId + "\""
     self.__execScript = pythonBin + " \"" + execScript + "\" " + arguments
Exemplo n.º 3
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)