PATH |
EOEvent
Inherits from: Object
Package: com.webobjects.eocontrol
Class Description
EOEvent is an abstract class that provides concrete subclasses with a structure for storing information (such as duration) about a logged event.
Subclasses of EOEvent don't need to override any inherited methods or implement any methods at all. You can customize the behavior if you want, but the EOEvent implementations are sufficient for most cases. Generally, to create a subclass of EOEvent, you merely declare it and create a description file that defines the events your subclass logs. The class itself usually declares no instance variables and implements no methods. The abstract implementation gets all the information it needs from the description file. For more information on the description file, see the eventTypeDescriptions method description.
Most of the work involved in logging custom events is instrumenting your code. For more information on that and on the event logging system itself, see the EOEventCenter class specification.
Constants
EOAttribute defines the following int
constant as a possible signature type for use with the methods signatureOfType, aggregateEvents, and groupEvents.
Additionally, EOEvent defines the following String constant to be used as a key into the dictionary returned by eventTypeDescriptions. The EOEventGroupName
entry provides the description of the family of events represented by the event class.
Method Types
Defining an event type eventTypeDescriptions description Accessing information about the event toString title startDate duration durationWithoutSubevents setType type setInfo info comment classDescription Grouping and Aggregating Events aggregateEvents groupEvents signatureOfType Displaying event information displayComponentName Traversing the event hierarchy parentEvent subevents Logging events markAtomicWithInfo markEnd markStartWithInfo
Constructors
EOEvent
public EOEvent()
Static Methods
aggregateEvents
public static NSArray aggregateEvents( NSArray events, int tag)
This method is for use by the WOEventDisplay page. For more information, see "WOEventDisplay page" (page 90).
classDescription
public static String classDescription(Class aClass)
eventTypeDescriptions
public static NSDictionary eventTypeDescriptions(Class aClass)
EOEvent's implementation reads the event types and their descriptions from a file. To define the types your event class represents, create a description file for your event and add it to your project's Resources folder. An event's description file defines the event categories and subcategories used in the WOEventDisplay page. The file's contents is a dictionary in plist format.
For example, consider the ODBCAdaptorEvent that logs events for the ODBC adaptor. ODBCAdaptorEvent is a subclass of EOEvent. It uses EOEvent's implementation of eventTypeDescriptions. The name of its description file is ODBCAdaptorEvent.description, and it looks like this:
{ EOEventGroupName = "ODBC Adaptor Event"; connect = "Connect"; openChannel = "Open Channel"; evaluateExpression = "Evaluate Expression"; fetchRow = "Fetch Row"; commitTransaction = "Commit Transaction"; }
Using the EOEvent implementation, the EOEventGroupName entry is mandatory; it describes the family of events logged by the event class. Any other keys are defined by the event class itself. In the ODBCAdaptorEvent class, the other keys (connect
, openChannel
, and so on) are the types of the events ODBCAdaptorEvent logs.
If the file doesn't exist or if there's an error reading the file, EOEvent creates a dictionary with a single entry; the entry's key is EOEventGroupName
and the value is the name of the event class (such as ODBCAdaptorEvent).
groupEvents
public static NSArray groupEvents( NSArray events, int tag)
This method is for use by the WOEventDisplay page. For more information, see "WOEventDisplay page" (page 90).
Instance Methods
comment
public String comment()
description
public String description()
displayComponentName
public String displayComponentName()
duration
public long duration()
durationWithoutSubevents
public long durationWithoutSubevents()
info
public Object info()
markAtomicWithInfo
public void markAtomicWithInfo(Object info)
Note: Don't invoke this method directly. Use the corresponding method defined in EOEventCenter instead. |
markEnd
public void markEnd()
Note: Don't invoke this method directly. Use the corresponding method defined in EOEventCenter instead. |
markStartWithInfo
public void markStartWithInfo(Object info)
Note: Don't invoke this method directly. Use the corresponding method defined in EOEventCenter instead. |
parentEvent
public EOEvent parentEvent()
setInfo
public void setInfo(Object info)
setType
public void setType(String type)
signatureOfType
public String signatureOfType(int tag)
See Also: aggregateEvents, groupEvents
startDate
public NSTimestamp startDate()
subevents
public NSArray subevents()
title
public String title()
toString
public String toString()
type
public String type()
© 2001 Apple Computer, Inc. (Last Published April 19, 2001)