|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mtgi.analytics.BehaviorTrackingManagerImpl
@ManagedResource(objectName="com.mtgi:group=analytics,name=BehaviorTracking", description="Monitor and control user behavior tracking") public class BehaviorTrackingManagerImpl
Standard implementation of BehaviorTrackingManager
. BehaviorEvent
instances are asynchronously committed to a BehaviorEventPersister when they are
complete; user and session IDs for the events are provided by an implementation
of SessionContext
.
Event persistence occurs when flush()
is called (either via JMX control
or by the Quartz scheduler), or when the queue of uncommitted events exceeds
the configured threshold value. The flush threshold can be configured with
setFlushThreshold(int)
.
Nested Class Summary | |
---|---|
protected class |
BehaviorTrackingManagerImpl.FlushEvent
|
Constructor Summary | |
---|---|
BehaviorTrackingManagerImpl()
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
|
BehaviorEvent |
createEvent(String type,
String name)
Create a new event of the given type and name. |
int |
flush()
Flush any completed events to the event persister. |
String |
getApplication()
|
String |
getBeanName()
|
int |
getEventsPendingFlush()
|
org.springframework.core.task.TaskExecutor |
getExecutor()
|
BehaviorEventPersister |
getPersister()
|
SessionContext |
getSessionContext()
|
boolean |
isSuspended()
|
String |
resume()
|
void |
setApplication(String application)
Set the name of the application in which this manager operates, for logging purposes. |
void |
setBeanName(String name)
|
void |
setExecutor(org.springframework.core.task.TaskExecutor executor)
Provide a task executor on which persistence operations will be performed. |
void |
setFlushThreshold(int flushThreshold)
Specify the maximum number of completed events to queue in memory before forcing a flush to the persister. |
void |
setPersister(BehaviorEventPersister persister)
Provide a persister for saving finished events to the behavior tracking database. |
void |
setSessionContext(SessionContext sessionContext)
Set a session context for the application, used to determine the current user and session ID for a calling thread. |
void |
start(BehaviorEvent evt)
Set the given event as the currently executing event for this thread, and start measuring event time. |
void |
stop(BehaviorEvent evt)
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. |
String |
suspend()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BehaviorTrackingManagerImpl()
Method Detail |
---|
public void setBeanName(String name)
setBeanName
in interface org.springframework.beans.factory.BeanNameAware
public String getBeanName()
public BehaviorEvent createEvent(String type, String name)
BehaviorTrackingManager
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 BehaviorTrackingManager.start(BehaviorEvent)
is called, which
should be done after all event metadata has been gathered.
createEvent
in interface BehaviorTrackingManager
SessionContext
,
BehaviorTrackingManager.start(BehaviorEvent)
public void start(BehaviorEvent evt)
BehaviorTrackingManager
start
in interface BehaviorTrackingManager
public void stop(BehaviorEvent evt)
BehaviorTrackingManager
stop
in interface BehaviorTrackingManager
@ManagedAttribute(description="Returns true if event logging has been temporarily disabled with the suspend() operation.") public boolean isSuspended()
@ManagedOperation(description="Temporarily suspend logging of behavior events.") public String suspend()
@ManagedOperation(description="Resume logging of behavior events after a previous call to suspend().") public String resume()
@ManagedOperation(description="Immediately flush all completed events to the behavior tracking database. Returns the number of events written to the database (not counting the flush event that is also logged)") public int flush()
@ManagedAttribute(description="The application name for events published by this manager") public String getApplication()
@ManagedAttribute(description="The number of completed events not yet flushed") public int getEventsPendingFlush()
public void setApplication(String application)
BehaviorEvent.getApplication()
for all events created by this manager.
public void setSessionContext(SessionContext sessionContext)
public SessionContext getSessionContext()
public void setPersister(BehaviorEventPersister persister)
persister
- public BehaviorEventPersister getPersister()
public void setExecutor(org.springframework.core.task.TaskExecutor executor)
public org.springframework.core.task.TaskExecutor getExecutor()
public void setFlushThreshold(int flushThreshold)
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |