Definition at line 45 of file DCD.py.
◆ __init__()
def dc.DCD.DCD.__init__ |
( |
|
self | ) |
|
Definition at line 60 of file DCD.py.
62 foundation.CementApp.__init__(self)
64 self.threadObjs =
None def __init__(self)
constructor
◆ close()
def dc.DCD.DCD.close |
( |
|
self, |
|
|
|
code = None |
|
) |
| |
Definition at line 204 of file DCD.py.
204 def close(self, code=None):
205 if self.logger
is not None:
206 self.logger.debug(LOG_MSG_CLOSE_APP)
208 foundation.CementApp.close(self)
◆ createThreadObj()
def dc.DCD.DCD.createThreadObj |
( |
|
self, |
|
|
|
app_name |
|
) |
| |
Definition at line 119 of file DCD.py.
119 def createThreadObj(self, app_name):
122 app = (app_name, eval(app_name)(self.config, ConnectionBuilderLight()))
123 app[1].setName(app[0])
124 self.logger.debug(
"%s has been created!", app_name)
125 time.sleep(self.CREATE_APP_DELAY)
127 self.logger.
error(
"Exception has been thrown during %s creation!", app_name)
◆ joinThreadObj()
def dc.DCD.DCD.joinThreadObj |
( |
|
self, |
|
|
|
app |
|
) |
| |
Definition at line 137 of file DCD.py.
137 def joinThreadObj(self, app):
140 self.logger.debug(
"%s waiting for stopping!", app[0])
141 time.sleep(self.JOIN_APP_DELAY)
143 self.logger.
error(
"Exception has been thrown during %s joining!", app[0])
◆ loadConfig()
def dc.DCD.DCD.loadConfig |
( |
|
self | ) |
|
Definition at line 164 of file DCD.py.
166 self.config = ConfigParser.ConfigParser()
167 self.config.optionxform = str
168 if self.pargs.config:
169 self.config.read(self.pargs.config)
171 raise Exception(
"Error load config")
173 except Exception
as err:
174 print ERROR_LOAD_CONFIG + err.message
◆ loadLogConfigFile()
def dc.DCD.DCD.loadLogConfigFile |
( |
|
self | ) |
|
Definition at line 189 of file DCD.py.
191 log_conf_file = self.config.get(
"Application",
"log")
192 logging.config.fileConfig(log_conf_file)
195 self.logger = logging.getLogger(APP_CONSTS.LOGGER_NAME)
197 except Exception
as err:
198 print ERROR_LOAD_LOG_CONFIG_FILE + err.message
def loadLogConfigFile(self)
◆ loadStartAppsSequence()
def dc.DCD.DCD.loadStartAppsSequence |
( |
|
self | ) |
|
Definition at line 181 of file DCD.py.
181 def loadStartAppsSequence(self):
182 self.logger.debug(
"Load application's start sequence.")
183 self.threadObjs = self.config.get(
"Application",
"instantiateSequence").split(
",")
◆ run()
def dc.DCD.DCD.run |
( |
|
self | ) |
|
Definition at line 76 of file DCD.py.
78 foundation.CementApp.run(self)
84 self.loadLogConfigFile()
87 self.loadStartAppsSequence()
92 self.threadObjs = [self.createThreadObj(threadObj)
for threadObj
in self.threadObjs]
94 self.logger.
error(
"Exception during creation thread-based class!\n" + Utils.getTracebackInfo())
100 [self.startThreadObj(threadObj)
for threadObj
in self.threadObjs]
102 self.logger.
error(
"Exception during run thread-based class!\n" + Utils.getTracebackInfo())
108 [self.joinThreadObj(threadObj)
for threadObj
in self.threadObjs]
110 self.logger.
error(
"Exception during stop thread-based class!\n" + Utils.getTracebackInfo())
◆ setup()
def dc.DCD.DCD.setup |
( |
|
self | ) |
|
Definition at line 69 of file DCD.py.
71 foundation.CementApp.setup(self)
◆ startThreadObj()
def dc.DCD.DCD.startThreadObj |
( |
|
self, |
|
|
|
app |
|
) |
| |
Definition at line 151 of file DCD.py.
151 def startThreadObj(self, app):
153 app[1].setName(app[0])
155 self.logger.debug(
"%s has been started!", app[0])
156 time.sleep(self.START_APP_DELAY)
158 self.logger.
error(
"Exception has been thrown during %s start!", app[0])
◆ config
◆ CREATE_APP_DELAY
int dc.DCD.DCD.CREATE_APP_DELAY = 0 |
|
static |
◆ JOIN_APP_DELAY
int dc.DCD.DCD.JOIN_APP_DELAY = 0 |
|
static |
◆ logger
◆ START_APP_DELAY
int dc.DCD.DCD.START_APP_DELAY = 0 |
|
static |
◆ threadObjs
The documentation for this class was generated from the following file: