The most important aspect of data collection is its use of arbitrary JavaBeans as data points. Your components do not have to subclass LogEvent (or anything else) to use data collection. You can even use data collection without writing any Java.

Oracle ATG Web Commerce includes the source code for a class named atg.service.datacollection.DataSource, located at <ATG10dir>/DAS/src/Java/atg/service/datacollection/DataSource.java. This class serves as a sample design pattern you can use when creating components that serve as sources of data for the data collection system.

There are three ways you can make a component be a data source:

To be a source of data items, a class needs to implement the Java event design pattern for event sources. All data collection listeners implement the atg.service.datacollection.DataListener interface. So to create a source of data events, implement the following two methods in your data source component:

public void addDataListener(DataListener listener);
public void removeDataListener(DataListener listener);

Then to send a data item to your listeners, call the method:

sendDataItem(Object dataItem)

This method sends the data item as a data collection event to each data listener in your list. The data listeners can then examine and extract information from the data item’s properties. This is based on the Java event model, so there is no interface that you need to implement.