# com.bea.p13n.tracking.listeners
BehaviorTrackingListener Class

public class BehaviorTrackingListener
extends `Object`
implements `EventListener`

EventListener to handle all behavior tracking events. Events are persisted to the database. This class should be added to the property eventService.listeners in order to enable behavior tracking.

Hierarchy
  `Object`
  `BehaviorTrackingListener`

All Implemented Interfaces
  `EventListener`

## Constructor Summary

BehaviorTrackingListener() Construct an instance of the listener and populate the eventTypes array with the event types that this listener will listen for.

## Method Summary

`public `String`[]` | `getTypes`() This method lets the EventListener advertise what types it is interested in.
`public void` | `handleEvent`(`Event` theEvent) Handle the event.

Methods from class `java.lang.`Object``
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods from interface `com.bea.p13n.events.`EventListener``
``getTypes`, `handleEvent``

## Constructor Detail

### BehaviorTrackingListener

    public BehaviorTrackingListener()

  Construct an instance of the listener and populate the eventTypes array with the event types that this listener will listen for.

## Method Detail

### getTypes() Method

    public String[] getTypes()

Description copied from `EventListener.getTypes()`
This method lets the EventListener advertise what types it is interested in. It is used by the EventHandler to dispatch only Events with a matching type to this EventListener. To listen on all events, implement this method to return a String[1] containing EventConstants.TYPE_ALL. Must not return null or return null in any element.

#### Returns

the event types that are specified (in application-config.xml) and are to be persisted to the database.

### handleEvent(Event) Method

    public void handleEvent(Event theEvent)

Handle the event. Ensure that it is an instanceof TrackingEvent and add it to a Buffer which will be swept to the database.

#### Parameters

theEvent
  subclass of TrackingEvent to be written to the database