EOEvent
- Inherits from:
- NSObject
- Package:
- com.apple.yellow.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.
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. |
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
- Grouping and Aggregating Events
- aggregateEvents
- groupEvents
- signatureOfType
- Displaying event information
- displayComponentName
- Traversing the event hierarchy
- parentEvent
- subevents
- Logging events
- markAtomicWithInfo
- markEnd
- markStartWithInfo
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".
description
public static String
description
()
eventTypeDescriptions
public static NSDictionary
eventTypeDescriptions
()
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".
Instance Methods
comment
public String
comment
()
displayComponentName
public String
displayComponentName
()
duration
public int
duration
()
durationWithoutSubevents
public int
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)
equals
and toString
.setType
public void
setType
(String type)
signatureOfType
public Object
signatureOfType
(int tag)
See Also: aggregateEvents, groupEvents
startDate
public NSGregorianDate
startDate
()
subevents
public NSArray
subevents
()
title
public String
title
()
eventTypeDescriptions
dictionary
for the receiver's type, EOEvent's implementation returns the
name of the receiver's class.toString
public String
toString
()
type
public String
type
()