EOEventCenter
- Inherits from:
- NSObject
- Package:
- com.apple.yellow.eocontrol
Class Description
EOEventCenter collects and manages EOEvents to allow you to measure the duration of operations in your applications. Measurements allow you to profile an application and optimize its execution time. For this, Enterprise Objects Framework and WebObjects instrument key portions of their code to measure the elapsed time of functions and methods.
Note: This class doesn't exist in the com.apple.client.eocontrol package. The event logging system is not available for Java Client. In a Java Client application, you can view event logging information for the server side of the application, but not on the client side. |
For more information on the event logging feature and on instrumenting your own code for event logging, see the following sections:
Method Types
- Registering event classes for logging
- registerEventClass
- registeredEventClasses
- setRecordsEvents
- recordsEventsForClass
- Logging events
- newEventOfClass
- markAtomicEvent
- markStartOfEvent
- markEndOfEvent
- cancelEvent
- Accessing event centers
- currentCenter
- allCenters
- Accessing events
- globalAllEvents
- allEvents
- globalEventsOfClass
- eventsOfClass
- globalRootEvents
- rootEvents
- rootEventsByDuration
- Resetting and suspending event logging
- globalResetLogging
- resetLogging
- suspendLogging
- resumeLogging
Static Methods
allCenters
public static NSArray
allCenters
()
cancelEvent
public static void
cancelEvent
(EOEvent event)
Generally
you cancel an event when the operation being logged is aborted.
For example, the ODBCAdaptorChannel cancels an "Open Channel"
event if the openChannel
method doesn't successfully
open a connection to the database.
currentCenter
public static EOEventCenter
currentCenter
()
globalAllEvents
public static NSArray
globalAllEvents
()
See Also: allEvents
globalEventsOfClass
public static NSArray
globalEventsOfClass
(
Class aClass,
String type)
null
for
the class returns events of any class. Similarly, specifying null for
the type returns events of any type.See Also: eventsOfClass
globalResetLogging
public static void
globalResetLogging
()
See Also: resetLogging
globalRootEvents
public static NSArray
globalRootEvents
()
See Also: rootEvents
markAtomicEvent
public static void
markAtomicEvent
(
EOEvent event,
Object info)
markEndOfEvent
public static void
markEndOfEvent
(EOEvent event)
markStartOfEvent
public static void
markStartOfEvent
(
EOEvent event,
Object info)
There is a limit on the number of events the event logging system logs-200,000 by default. You can change the limit using the user default EOEventLoggingLimit. When the logging limit is reached, the logging system attempts to purge old events before logging new ones. If the system is unable to purge old events, event logging is aborted.
The system's attempt to purge events can fail if the event logging limit is too small. This happens because the event system can't purge the first event logged, and it can't purge unclosed branch events.
newEventOfClass
public static Object
newEventOfClass
(
Class aClass,
String aType)
recordsEventsForClass
public static boolean
recordsEventsForClass
(Class eventClass)
registerEventClass
public static void
registerEventClass
(
Class aClass,
EOEventCenter.EventRecordingHandler handler)
If
the EOEventLoggingEnabled
user
default is set to true, this method enables logging for aClass. Programmatically,
you can selectively enable or disable logging for a specific class
with setRecordsEvents.
It is more common, however, for users to enable and disable logging
of a particular class through the WOEventSetup page-for more information,
see "WOEventSetup page".
When the event logging system enables logging for the ODBCAdaptorEvent class, it sends handler a setLoggingEnabled message with true as the flag and ODBCAdaptorEvent as the event class. handler is responsible for enabling logging in the instrumented code.
registeredEventClasses
public static NSArray
registeredEventClasses
()
resumeLogging
public static void
resumeLogging
()
resumeLogging
.
Invoking resumeLogging
without a corresponding suspendLogging
isn't
harmful.rootEventsByDuration
public static NSArray
rootEventsByDuration
()
See Also: globalRootEvents, rootEvents
setRecordsEvents
public static void
setRecordsEvents
(
boolean flag,
Class eventClass)
suspendLogging
public static void
suspendLogging
()
suspendLogging
must
be paired with an invocation of resumeLogging to resume event logging.Instance Methods
allEvents
public NSArray
allEvents
()
eventsOfClass
public NSArray
eventsOfClass
(
Class aClass,
String type)
null
for
the class returns events of any class. Similarly, specifying null for
the type returns events of any type.resetLogging
public void
resetLogging
()
See Also: globalResetLogging
rootEvents
public NSArray
rootEvents
()
See Also: globalRootEvents, rootEventsByDuration