def initInThread(self): """ Load shared queries """ # Call superclass setup ThreadSlave.initInThread(self) # Load DB queries myThread = threading.currentThread() daofactory = DAOFactory(package = "WMComponent.WorkflowManager.Database" , \ logger = myThread.logger, \ dbinterface = myThread.dbi) self.addManagedWorkflow = daofactory(classname = "AddManagedWorkflow") self.markLocation = daofactory(classname = "MarkLocation") self.unmarkLocation = daofactory(classname = "UnmarkLocation") self.removeManagedWorkflow = daofactory(classname = "RemoveManagedWorkflow")
def initInThread(self): """ Called during thread initialization. Loads the backend for this instance. """ # make sure you instantiate the super class method. ThreadSlave.initInThread(self) # load queries for backend. myThread = threading.currentThread() factory = WMFactory("default", \ "TQComp.Database."+myThread.dialect) # make sure you do not overload attributes # defined in your parent class self.queries = factory.loadObject("Queries") logging.debug("ParentSlave initialized")
def initInThread(self): """ Load shared queries """ # Call parent initialisation ThreadSlave.initInThread(self) myThread = threading.currentThread() daofactory = DAOFactory(package = "WMComponent.FeederManager.Database" , \ logger = myThread.logger, \ dbinterface = myThread.dbi) # Load queries objects self.checkFeeder = daofactory(classname = "CheckFeeder") self.getFeederId = daofactory(classname = "GetFeederId") self.addFeeder = daofactory(classname = "AddFeeder") self.addFilesetToManage = daofactory(classname = "AddFilesetToManage") # Get feeder objects myThread.runningFeedersLock = self.runningFeedersLock myThread.runningFeeders = self.runningFeeders