Definition at line 49 of file DTMD.py.
◆ __init__()
def dtm.DTMD.DTMD.__init__ |
( |
|
self | ) |
|
Definition at line 64 of file DTMD.py.
66 foundation.CementApp.__init__(self)
68 self.threadObjs =
None def __init__(self)
constructor
◆ close()
def dtm.DTMD.DTMD.close |
( |
|
self | ) |
|
Definition at line 206 of file DTMD.py.
207 if self.logger
is not None:
208 self.logger.debug(
"dtm daemon is closed")
210 foundation.CementApp.close(self)
◆ createThreadObj()
def dtm.DTMD.DTMD.createThreadObj |
( |
|
self, |
|
|
|
app_name |
|
) |
| |
Definition at line 120 of file DTMD.py.
120 def createThreadObj(self, app_name):
123 app = (app_name, eval(app_name)(self.config, ConnectionBuilderLight()))
124 app[1].setName(app[0])
125 self.logger.debug(
"%s has been created!" % app_name)
126 time.sleep(self.CREATE_APP_DELAY)
127 except Exception
as err:
128 ExceptionLog.handler(self.logger, err,
"Exception has been thrown during %s creation. %s" % (app_name, err.message), \
◆ joinThreadObj()
def dtm.DTMD.DTMD.joinThreadObj |
( |
|
self, |
|
|
|
app |
|
) |
| |
Definition at line 139 of file DTMD.py.
139 def joinThreadObj(self, app):
142 self.logger.debug(
"%s waiting for stopping!" % app[0])
143 time.sleep(self.JOIN_APP_DELAY)
144 except Exception
as err:
145 ExceptionLog.handler(self.logger, err,
"Exception has been thrown during %s joining. %s" % (app[0], err.message), \
◆ loadConfig()
def dtm.DTMD.DTMD.loadConfig |
( |
|
self | ) |
|
Definition at line 168 of file DTMD.py.
170 self.config = ConfigParser.ConfigParser()
171 self.config.optionxform = str
172 if self.pargs.config:
173 self.config.read(self.pargs.config)
176 self.config.read(APP_CONFIG_FILE)
179 print ERROR_LOAD_CONFIG
◆ loadLogConfigFile()
def dtm.DTMD.DTMD.loadLogConfigFile |
( |
|
self | ) |
|
Definition at line 194 of file DTMD.py.
196 log_conf_file = self.config.get(
"Application",
"log")
197 logging.config.fileConfig(log_conf_file)
198 self.logger = logging.getLogger(DTM_CONSTS.LOGGER_NAME)
200 print ERROR_LOAD_LOG_CONFIG_FILE
def loadLogConfigFile(self)
◆ loadStartAppsSequence()
def dtm.DTMD.DTMD.loadStartAppsSequence |
( |
|
self | ) |
|
Definition at line 186 of file DTMD.py.
186 def loadStartAppsSequence(self):
187 self.logger.debug(
"Load application's start sequence.")
188 self.threadObjs = self.config.get(
"Application",
"instantiateSequence").split(
",")
◆ run()
def dtm.DTMD.DTMD.run |
( |
|
self | ) |
|
Definition at line 80 of file DTMD.py.
82 foundation.CementApp.run(self)
88 self.loadLogConfigFile()
91 self.loadStartAppsSequence()
96 self.threadObjs = [self.createThreadObj(app_name)
for app_name
in self.threadObjs]
103 [self.startThreadObj(app)
for app
in self.threadObjs]
◆ setup()
def dtm.DTMD.DTMD.setup |
( |
|
self | ) |
|
Definition at line 73 of file DTMD.py.
75 foundation.CementApp.setup(self)
◆ startThreadObj()
def dtm.DTMD.DTMD.startThreadObj |
( |
|
self, |
|
|
|
app |
|
) |
| |
Definition at line 154 of file DTMD.py.
154 def startThreadObj(self, app):
156 app[1].setName(app[0])
158 self.logger.debug(
"%s has been started!" % app[0])
159 time.sleep(self.START_APP_DELAY)
160 except Exception
as err:
161 ExceptionLog.handler(self.logger, err,
"Exception has been thrown during %s start. %s" % (app[0], err.message), \
◆ config
◆ CREATE_APP_DELAY
int dtm.DTMD.DTMD.CREATE_APP_DELAY = 0 |
|
static |
◆ JOIN_APP_DELAY
int dtm.DTMD.DTMD.JOIN_APP_DELAY = 0 |
|
static |
◆ logger
◆ START_APP_DELAY
int dtm.DTMD.DTMD.START_APP_DELAY = 0 |
|
static |
◆ threadObjs
The documentation for this class was generated from the following file: