ERXAdaptorChannelDelegate Class Reference

Collaboration diagram for ERXAdaptorChannelDelegate:

Collaboration graph
[legend]

List of all members.

Public Member Functions

void adaptorChannelDidEvaluateExpression (EOAdaptorChannel channel, EOSQLExpression expression)
void adaptorChannelDidFetchRow (EOAdaptorChannel eoadaptorchannel, NSMutableDictionary nsmutabledictionary)
boolean adaptorChannelShouldEvaluateExpression (EOAdaptorChannel channel, EOSQLExpression expression)
synchronized void dumpLastStatements ()
LinkedList< StringlastStatements ()

Static Public Member Functions

static void dataBaseChannelNeeded (NSNotification n)
static void setupDelegate ()

Private Member Functions

boolean collectLastStatements ()
int numberOfStatementsToCollect ()

Private Attributes

Boolean _collectLastStatements
long _lastMilliseconds
LinkedList _lastStatements
Integer _numberOfStatementsToCollect

Static Private Attributes

static Logger log = Logger.getLogger(ERXAdaptorChannelDelegate.class)


Detailed Description

Tracks and logs the SQL that gets sent to the database. If the milliseconds used exceeds the time specified in the system property er.extensions.ERXSQLExpressionTracker.trace.milliSeconds.[debug|info|warn|error], and the entity name matches the regular expression er.extensions.ERXSQLExpressionTracker.trace.entityMatchPattern then the SQL expression is logged together with the time used and the parameters.
NOTE: To get patched into EOF, this class registers itself for the EODatabaseContext.DatabaseChannelNeededNotification notification and creates a new channel. If you would like to handle creation of the channel yourself *and* you need the logging feature, you need to: otherwise you just need to set er.extensions.ERXAdaptorChannelDelegate.enabled=true

Author:
ak

Member Function Documentation

void adaptorChannelDidEvaluateExpression ( EOAdaptorChannel  channel,
EOSQLExpression  expression 
)

void adaptorChannelDidFetchRow ( EOAdaptorChannel  eoadaptorchannel,
NSMutableDictionary  nsmutabledictionary 
)

Implemented so the the thread checks if it should get interrupted.

Parameters:
eoadaptorchannel 
nsmutabledictionary 

boolean adaptorChannelShouldEvaluateExpression ( EOAdaptorChannel  channel,
EOSQLExpression  expression 
)

boolean collectLastStatements (  )  [private]

static void dataBaseChannelNeeded ( NSNotification  n  )  [static]

Answers to the EODataBaseChannelNeeded notification. Creates a new EODatabaseChannel and sets its adaptorChannel delegate to a new instance of ERXAdaptorChannelDelegate.

Parameters:
n 

synchronized void dumpLastStatements (  ) 

Dump the last collected statements to the log. Use the property er.extensions.ERXSQLExpressionTracker.collectLastStatements set to true to collect executed statements.

LinkedList<String> lastStatements (  ) 

Return the last collected SQL statements

Author:
cug - Jun 20, 2007
Returns:
The last collected SQL statements.

int numberOfStatementsToCollect (  )  [private]

static void setupDelegate (  )  [static]


Member Data Documentation

Boolean _collectLastStatements [private]

long _lastMilliseconds [private]

LinkedList _lastStatements [private]

Integer _numberOfStatementsToCollect [private]

Logger log = Logger.getLogger(ERXAdaptorChannelDelegate.class) [static, private]


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

Generated on Sat May 26 06:43:07 2012 for Project Wonder by  doxygen 1.5.8