001    /* 
002     * Copyright 2008-2009 the original author or authors.
003     * The contents of this file are subject to the Mozilla Public License
004     * Version 1.1 (the "License"); you may not use this file except in
005     * compliance with the License. You may obtain a copy of the License at
006     * http://www.mozilla.org/MPL/
007     *
008     * Software distributed under the License is distributed on an "AS IS"
009     * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
010     * License for the specific language governing rights and limitations
011     * under the License.
012     */
013     
014    package com.mtgi.analytics.aop.config.v11;
015    
016    import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
017    
018    import com.mtgi.analytics.aop.config.v10.BtAdviceBeanDefinitionParser;
019    
020    /**
021     * <code>NamespaceHandler</code> allowing for the configuration of
022     * declarative behavior tracking management using XML.
023     */
024    public class BtNamespaceHandler extends NamespaceHandlerSupport {
025    
026            public void init() {
027                    registerBeanDefinitionParser("config", new BtConfigBeanDefinitionParser());
028                    registerBeanDefinitionParser("manager", new BtManagerBeanDefinitionParser());
029                    registerBeanDefinitionParser("xml-persister", new BtXmlPersisterBeanDefinitionParser());
030                    registerBeanDefinitionParser("session-context", new BtInnerBeanDefinitionParser("sessionContext"));
031                    registerBeanDefinitionParser("jdbc-persister", new BtJdbcPersisterBeanDefinitionParser());
032                    registerBeanDefinitionParser("custom-persister", new BtInnerBeanDefinitionParser("persister"));
033                    registerBeanDefinitionParser("http-requests", new BtHttpRequestsBeanDefinitionParser());
034    
035                    //register tracking-manager attribute for decorating standard bean definitions
036                    registerBeanDefinitionDecoratorForAttribute("tracking-manager", new BtDataSourceBeanDefinitionDecorator());
037                    
038                    //stand-alone advice element, which is unchanged from 1.0 config semantics
039                    registerBeanDefinitionParser("advice", new BtAdviceBeanDefinitionParser());
040            }
041    
042    }