com.mtgi.analytics.aop.config.v11
Class BtManagerBeanDefinitionParser

java.lang.Object
  extended by org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
      extended by org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
          extended by com.mtgi.analytics.aop.config.TemplateBeanDefinitionParser
              extended by com.mtgi.analytics.aop.config.v11.BtManagerBeanDefinitionParser
All Implemented Interfaces:
org.springframework.beans.factory.xml.BeanDefinitionParser

public class BtManagerBeanDefinitionParser
extends TemplateBeanDefinitionParser

Parser for <bt:manager> configuration tags, the most significant tag in behavior tracking configuration. Each such tag will configure an instance of BehaviorTrackingManagerImpl and bind it into the Spring application context. This includes configuring an implementation of BehaviorEventPersister, SessionContext, registering AOP advice for tracking method calls, and automatically scheduling event flushes and log rotation according to sensible default values.


Nested Class Summary
static class BtManagerBeanDefinitionParser.ManagerComponentDefinition
          Specialized TemplateComponentDefinition for the bt:manager config tag.
 
Nested classes/interfaces inherited from class com.mtgi.analytics.aop.config.TemplateBeanDefinitionParser
TemplateBeanDefinitionParser.TemplateComponentDefinition
 
Field Summary
static String ATT_APPLICATION
          The name of the application, required to be specified at runtime.
static String ATT_FLUSH_SCHEDULE
          Quartz Cron Expression identifying how often behavior events are flushed to the persister.
static String ATT_FLUSH_THRESHOLD
           
static String ATT_ID
          The bean name of the bt manager instance, defaults to defaultTrackingManager.
static String ATT_METHOD_EXPRESSION
          AOP method pattern identifying which methods should be logged as behavior tracking events.
static String ATT_PERSISTER
          Bean name reference to an implementation of BehaviorEventPersister defined in the application context.
static String ATT_SCHEDULER
          Bean name reference to a Quartz Scheduler used for scheduled operations like event flush and log rotation.
static String ATT_SESSION_CONTEXT
          Bean name reference to an implementation of SessionContext defined in the application context.
static String ATT_TASK_EXECUTOR
          Bean name reference to a TaskExecutor for executing event flushes and other scheduled operations.
 
Fields inherited from class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
ID_ATTRIBUTE
 
Constructor Summary
BtManagerBeanDefinitionParser()
           
 
Method Summary
protected  TemplateBeanDefinitionParser.TemplateComponentDefinition newComponentDefinition(String name, Object source, org.springframework.beans.factory.support.DefaultListableBeanFactory factory)
          overridden to return an instance of BtManagerBeanDefinitionParser.ManagerComponentDefinition
protected static boolean registerNestedBean(org.springframework.beans.factory.config.BeanDefinitionHolder nested, String parentProperty, org.springframework.beans.factory.xml.ParserContext parserContext)
          called by nested tags to push inner beans into the enclosing BehaviorTrackingManagerImpl.
protected  void transform(org.springframework.beans.factory.config.ConfigurableListableBeanFactory factory, org.springframework.beans.factory.config.BeanDefinition template, Element element, org.springframework.beans.factory.xml.ParserContext parserContext)
          Hook by which subclasses can modify template configuration values.
 
Methods inherited from class com.mtgi.analytics.aop.config.TemplateBeanDefinitionParser
doParse, getBeanClass, overrideAttribute, overrideProperty, resolveId, shouldGenerateIdAsFallback
 
Methods inherited from class org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
doParse, getBeanClassName, parseInternal
 
Methods inherited from class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
parse, postProcessComponentDefinition, registerBeanDefinition, shouldFireEvents, shouldGenerateId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATT_ID

public static final String ATT_ID
The bean name of the bt manager instance, defaults to defaultTrackingManager.

See Also:
Constant Field Values

ATT_APPLICATION

public static final String ATT_APPLICATION
The name of the application, required to be specified at runtime.

See Also:
BehaviorTrackingManagerImpl.setApplication(String), Constant Field Values

ATT_TASK_EXECUTOR

public static final String ATT_TASK_EXECUTOR
Bean name reference to a TaskExecutor for executing event flushes and other scheduled operations. A private instance is created if one is not specified.

See Also:
BehaviorTrackingManagerImpl.setExecutor(org.springframework.core.task.TaskExecutor), Constant Field Values

ATT_FLUSH_THRESHOLD

public static final String ATT_FLUSH_THRESHOLD
See Also:
BehaviorTrackingManagerImpl.setFlushThreshold(int), Constant Field Values

ATT_SCHEDULER

public static final String ATT_SCHEDULER
Bean name reference to a Quartz Scheduler used for scheduled operations like event flush and log rotation. A private instance is created if one is not specified.

See Also:
Constant Field Values

ATT_FLUSH_SCHEDULE

public static final String ATT_FLUSH_SCHEDULE
Quartz Cron Expression identifying how often behavior events are flushed to the persister. Defaults to once every 5 minutes if unspecified.

See Also:
Constant Field Values

ATT_METHOD_EXPRESSION

public static final String ATT_METHOD_EXPRESSION
AOP method pattern identifying which methods should be logged as behavior tracking events. Defaults to null if unspecified.

See Also:
Constant Field Values

ATT_PERSISTER

public static final String ATT_PERSISTER
Bean name reference to an implementation of BehaviorEventPersister defined in the application context. A private instance of XmlBehaviorEventPersisterImpl is created if none is specified. This attribute cannot be used in combination with a nested persister tag (xml-persister, jdbc-persister, custom-persister).

See Also:
BehaviorTrackingManagerImpl.setPersister(BehaviorEventPersister), Constant Field Values

ATT_SESSION_CONTEXT

public static final String ATT_SESSION_CONTEXT
Bean name reference to an implementation of SessionContext defined in the application context. A private instance is created if none is specified. This attribute cannot be used in combination with a nested bt:session-context tag.

See Also:
BehaviorTrackingManagerImpl.setSessionContext(SessionContext), Constant Field Values
Constructor Detail

BtManagerBeanDefinitionParser

public BtManagerBeanDefinitionParser()
Method Detail

transform

protected void transform(org.springframework.beans.factory.config.ConfigurableListableBeanFactory factory,
                         org.springframework.beans.factory.config.BeanDefinition template,
                         Element element,
                         org.springframework.beans.factory.xml.ParserContext parserContext)
Description copied from class: TemplateBeanDefinitionParser
Hook by which subclasses can modify template configuration values. Default behavior does nothing to the template.

Overrides:
transform in class TemplateBeanDefinitionParser
Parameters:
factory - the bean factory from which template was loaded
template - the template bean definition
element - XML configuration fragment containing overrides that should be applied to the template
parserContext - XML parse context supplying the configuration values

newComponentDefinition

protected TemplateBeanDefinitionParser.TemplateComponentDefinition newComponentDefinition(String name,
                                                                                          Object source,
                                                                                          org.springframework.beans.factory.support.DefaultListableBeanFactory factory)
overridden to return an instance of BtManagerBeanDefinitionParser.ManagerComponentDefinition

Overrides:
newComponentDefinition in class TemplateBeanDefinitionParser

registerNestedBean

protected static boolean registerNestedBean(org.springframework.beans.factory.config.BeanDefinitionHolder nested,
                                            String parentProperty,
                                            org.springframework.beans.factory.xml.ParserContext parserContext)
called by nested tags to push inner beans into the enclosing BehaviorTrackingManagerImpl.

Returns:
true if the inner bean was added to an enclosing BehaviorTrackingManagerImpl. Otherwise, the bean definition is not nested inside a <bt:manager> tag and therefore will have to be registered as a global bean in the application context.