Project Wonder 5.0

er.extensions.eof
Class ERXAdaptorChannelDelegate

java.lang.Object
  extended by er.extensions.eof.ERXAdaptorChannelDelegate

public class ERXAdaptorChannelDelegate
extends java.lang.Object

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

Constructor Summary
ERXAdaptorChannelDelegate()
           
 
Method Summary
 void adaptorChannelDidEvaluateExpression(com.webobjects.eoaccess.EOAdaptorChannel channel, com.webobjects.eoaccess.EOSQLExpression expression)
           
 void adaptorChannelDidFetchRow(com.webobjects.eoaccess.EOAdaptorChannel eoadaptorchannel, com.webobjects.foundation.NSMutableDictionary nsmutabledictionary)
          Implemented so the the thread checks if it should get interrupted.
 boolean adaptorChannelShouldEvaluateExpression(com.webobjects.eoaccess.EOAdaptorChannel channel, com.webobjects.eoaccess.EOSQLExpression expression)
           
static void dataBaseChannelNeeded(com.webobjects.foundation.NSNotification n)
          Answers to the EODataBaseChannelNeeded notification.
 void dumpLastStatements()
          Dump the last collected statements to the log.
 java.util.LinkedList<java.lang.String> lastStatements()
          Return the last collected SQL statements
static void setupDelegate()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ERXAdaptorChannelDelegate

public ERXAdaptorChannelDelegate()
Method Detail

setupDelegate

public static void setupDelegate()

adaptorChannelDidFetchRow

public void adaptorChannelDidFetchRow(com.webobjects.eoaccess.EOAdaptorChannel eoadaptorchannel,
                                      com.webobjects.foundation.NSMutableDictionary nsmutabledictionary)
Implemented so the the thread checks if it should get interrupted.

Parameters:
eoadaptorchannel -
nsmutabledictionary -

adaptorChannelDidEvaluateExpression

public void adaptorChannelDidEvaluateExpression(com.webobjects.eoaccess.EOAdaptorChannel channel,
                                                com.webobjects.eoaccess.EOSQLExpression expression)

adaptorChannelShouldEvaluateExpression

public boolean adaptorChannelShouldEvaluateExpression(com.webobjects.eoaccess.EOAdaptorChannel channel,
                                                      com.webobjects.eoaccess.EOSQLExpression expression)

dataBaseChannelNeeded

public static void dataBaseChannelNeeded(com.webobjects.foundation.NSNotification n)
Answers to the EODataBaseChannelNeeded notification. Creates a new EODatabaseChannel and sets its adaptorChannel delegate to a new instance of ERXAdaptorChannelDelegate.

Parameters:
n -

dumpLastStatements

public void dumpLastStatements()
Dump the last collected statements to the log. Use the property er.extensions.ERXSQLExpressionTracker.collectLastStatements set to true to collect executed statements.


lastStatements

public java.util.LinkedList<java.lang.String> lastStatements()
Return the last collected SQL statements

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

Last updated: Tue, Feb 21, 2017 • 05:45 PM CET

Copyright © 2002 – 2007 Project Wonder.