objects.storage.storageManager.storageWriterThread Class Reference

The storageWriterThread class is a long lived worked thread used by the storageManager class, whose job is to write a copy of all captured data to the SQLite database. More...

Inherits objects::logic::common::threads::appThreadBase::appThreadBase.

List of all members.

Public Member Functions

def run

Public Attributes

 anythingElseProcessed
 killSwitch


Detailed Description

The storageWriterThread class is a long lived worked thread used by the storageManager class, whose job is to write a copy of all captured data to the SQLite database.

Definition at line 32 of file storageManager.py.


Member Function Documentation

def objects.storage.storageManager.storageWriterThread.run (   self  ) 

Definition at line 34 of file storageManager.py.

00034                     :
00035         try:
00036             self.parent.storageImpl.open()
00037             self.anythingElseProcessed = False
00038             logger.log(__name__ + ": Starting Storage Write Thread")
00039             while(self.killSwitch == False):
00040                 self.threadEvent.clear()
00041                                 
00042                 try:
00043                     
00044                     try:
00045                         (header, data) = self.parent.packetList.pop(0)
00046                     except Exception:
00047                         time.sleep(1)
00048                         
00049                     else:
00050                         decodedPacketDict = self.parent.decoder.decodePacket(header, data)
00051                         self.parent.storageImpl.store(decodedPacketDict)
00052                         
00053                         self.anythingElseProcessed = True
00054                             
00055                         
00056                     if self.parent.timeToCommit == True and self.anythingElseProcessed == True:
00057                         self.parent.timeToCommit = False
00058                         self.parent.anythingElseProcessed = False
00059                          
00060                         self.parent.storageImpl.commit()
00061                         
00062                 except Exception, ex:
00063                     logger.log(__name__ + ": There was an unknown error writing packet to database")
00064                     logger.log(ex)            
00065                 finally:
00066                     pass            
00067  
00068                                         
00069         finally:
00070             self.parent.storageImpl.commit()
00071             self.parent.storageImpl.close()
00072             self.threadEvent.set()
00073             self.threadEvent.clear()
00074             logger.log(__name__ + ": Storage Write Thread is Done")
00075   
00076 
00077 
00078 
## The storageWriterThread class is a long lived worked thread used by the storageManager class, whose job is


Member Data Documentation

Definition at line 37 of file storageManager.py.

Reimplemented from objects.logic.common.threads.appThreadBase.appThreadBase.

Definition at line 39 of file storageManager.py.


The documentation for this class was generated from the following file:

Generated on Mon Mar 30 00:26:48 2009 for EyeSpy by  doxygen 1.5.8