com.mtgi.analytics
Interface BehaviorTrackingManager

All Known Implementing Classes:
BehaviorTrackingManagerImpl

public interface BehaviorTrackingManager

Top-level application interface for logging behavior tracking events to the BehaviorTracking database. Most applications should never have to call a method on this interface or BehaviorEvent directly. Rather, behavior tracking should be managed automatically as an Aspect or using a servlet filter. The lifecyle of a behavior tracking event has four steps:

  1. An event is created using createEvent(String, String)
  2. The event is populated with event metadata, like parameter values, using the BehaviorEvent API methods
  3. The event begins measuring execution time with a call to start(BehaviorEvent)
  4. The execution time measurement is stopped with a call to stop(BehaviorEvent), and the finished event is written to the behavior tracking database.
.

See Also:
SessionContext

Method Summary
 BehaviorEvent createEvent(String type, String name)
          Create a new event of the given type and name.
 void start(BehaviorEvent event)
          Set the given event as the currently executing event for this thread, and start measuring event time.
 void stop(BehaviorEvent event)
          Stop measuring execution time for the given event, and set the current event for this thread to be the parent of the given event, if any.
 

Method Detail

createEvent

BehaviorEvent createEvent(String type,
                          String name)
Create a new event of the given type and name. If another event is still pending on the current thread, the pending event will become the parent of the newly created event. The returned event will also reflect the user Id and session Id associated with the current thread, if any. The returned event does not become active until start(BehaviorEvent) is called, which should be done after all event metadata has been gathered.

See Also:
SessionContext, start(BehaviorEvent)

start

void start(BehaviorEvent event)
Set the given event as the currently executing event for this thread, and start measuring event time.

Throws:
IllegalStateException - if this event has already been started or stopped.

stop

void stop(BehaviorEvent event)
Stop measuring execution time for the given event, and set the current event for this thread to be the parent of the given event, if any. The event data will subsequently be logged to the behavior tracking database.

Throws:
IllegalStateException - if this event has not been started, has already been stopped, or is not the currently executing event on the calling thread.