// Path: 1-hi-utils/src/main/java/com/helpinput/core/LoggerBase.java
// public class LoggerBase {
// 	public static final Logger logger =LoggerFactory.getLogger(LoggerBase.class);
// }
// 
// Path: 2-hi-spring-dynamic/src/main/java/com/helpinput/holder/ContextHolder.java
// public class ContextHolder {
// 	public static SafeHolder<String> refreshers = new SafeHolder<>();
// 	
// 	public static SafeHolder<BeanRegistInterceptor> beanRegistIntercpterHolder = new SafeHolder<>();
// 	
// }
// 
// Path: 2-hi-spring-dynamic/src/main/java/com/helpinput/spring/registinerceptor/mvc/UrlInterceptorBeanRegistInterceptor.java
// public class UrlInterceptorBeanRegistInterceptor implements BeanRegistInterceptor {
// 	static Logger logger = LoggerBase.logger;
// 	
// 	@Override
// 	public BeanDefinition beforeRegist(Class<?> clz, String beanName, String scope, DefaultListableBeanFactory dlbf,
// 										BeanDefinitionBuilder builder) {
// 		if (getCondition(clz)) {
// 			String refDefname = beanName + "$$$$";
// 			
// 			RootBeanDefinition refDef = new RootBeanDefinition();
// 			refDef.setBeanClass(clz);
// 			refDef.setScope(scope);
// 			dlbf.registerBeanDefinition(refDefname, refDef);
// 			
// 			RootBeanDefinition mappedInterceptorDef = new RootBeanDefinition(MappedInterceptor.class);
// 			mappedInterceptorDef.setScope(scope);
// 			
// 			ManagedList<String> includePatterns = null;
// 			ManagedList<String> excludePatterns = null;
// 			Object interceptorBean;
// 			
// 			Mapping mapAnn = clz.getAnnotation(Mapping.class);
// 			if (mapAnn != null) {
// 				String[] includes = mapAnn.value();
// 				if (Utils.hasLength(includes)) {
// 					includePatterns = new ManagedList<>(includes.length);
// 					for (String s : includes) 
// 						includePatterns.add(s);
// 				}
// 			}
// 
// 			MappingExclude unMapAnn = clz.getAnnotation(MappingExclude.class);
// 			if (unMapAnn != null) {
// 				String[] excludes = unMapAnn.value();
// 				if (Utils.hasLength(excludes)) {
// 					excludePatterns = new ManagedList<>(excludes.length);
// 					for (String s : excludes) 
// 						excludePatterns.add(s);
// 				}
// 			}
// 			
// 			interceptorBean = new RuntimeBeanReference(refDefname);
// 			mappedInterceptorDef.getConstructorArgumentValues().addIndexedArgumentValue(0, includePatterns);
// 			mappedInterceptorDef.getConstructorArgumentValues().addIndexedArgumentValue(1, excludePatterns);
// 			mappedInterceptorDef.getConstructorArgumentValues().addIndexedArgumentValue(2, interceptorBean);
// 			return mappedInterceptorDef;
// 		}
// 		return null;
// 	}
// 	
// 	@Override
// 	public boolean afterRemove(Class<?> clz, String beanName, String scope, DefaultListableBeanFactory dlbf) {
// 		// TODO Auto-generated method stub
// 		return false;
// 	}
// 	
// 	@Override
// 	public boolean getCondition(Class<?> clz) {
// 		return HandlerInterceptor.class.isAssignableFrom(clz);
// 	}
// 	
// }


import com.helpinput.holder.ContextHolder;
import com.helpinput.spring.registinerceptor.mvc.UrlInterceptorBeanRegistInterceptor;
import org.slf4j.Logger;
import org.springframework.beans.BeanUtils;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextException;
import org.springframework.web.context.ConfigurableWebApplicationContext;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.servlet.DispatcherServlet;
import com.helpinput.core.LoggerBase;
/*
 * Copyright 2013-2015 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 *@Author: niaoge(Zhengsheng Xia)
 *@Email 78493244@qq.com
 *@Date: 2015-6-20
 */
package com.helpinput.spring.servlet.mvc;



@SuppressWarnings("serial")
public class EnhanceDispachServlet extends DispatcherServlet {
// Path: 1-hi-utils/src/main/java/com/helpinput/core/LoggerBase.java
// public class LoggerBase {
// 	public static final Logger logger =LoggerFactory.getLogger(LoggerBase.class);
// }
// 
// Path: 2-hi-spring-dynamic/src/main/java/com/helpinput/holder/ContextHolder.java
// public class ContextHolder {
// 	public static SafeHolder<String> refreshers = new SafeHolder<>();
// 	
// 	public static SafeHolder<BeanRegistInterceptor> beanRegistIntercpterHolder = new SafeHolder<>();
// 	
// }
// 
// Path: 2-hi-spring-dynamic/src/main/java/com/helpinput/spring/registinerceptor/mvc/UrlInterceptorBeanRegistInterceptor.java
// public class UrlInterceptorBeanRegistInterceptor implements BeanRegistInterceptor {
// 	static Logger logger = LoggerBase.logger;
// 	
// 	@Override
// 	public BeanDefinition beforeRegist(Class<?> clz, String beanName, String scope, DefaultListableBeanFactory dlbf,
// 										BeanDefinitionBuilder builder) {
// 		if (getCondition(clz)) {
// 			String refDefname = beanName + "$$$$";
// 			
// 			RootBeanDefinition refDef = new RootBeanDefinition();
// 			refDef.setBeanClass(clz);
// 			refDef.setScope(scope);
// 			dlbf.registerBeanDefinition(refDefname, refDef);
// 			
// 			RootBeanDefinition mappedInterceptorDef = new RootBeanDefinition(MappedInterceptor.class);
// 			mappedInterceptorDef.setScope(scope);
// 			
// 			ManagedList<String> includePatterns = null;
// 			ManagedList<String> excludePatterns = null;
// 			Object interceptorBean;
// 			
// 			Mapping mapAnn = clz.getAnnotation(Mapping.class);
// 			if (mapAnn != null) {
// 				String[] includes = mapAnn.value();
// 				if (Utils.hasLength(includes)) {
// 					includePatterns = new ManagedList<>(includes.length);
// 					for (String s : includes) 
// 						includePatterns.add(s);
// 				}
// 			}
// 
// 			MappingExclude unMapAnn = clz.getAnnotation(MappingExclude.class);
// 			if (unMapAnn != null) {
// 				String[] excludes = unMapAnn.value();
// 				if (Utils.hasLength(excludes)) {
// 					excludePatterns = new ManagedList<>(excludes.length);
// 					for (String s : excludes) 
// 						excludePatterns.add(s);
// 				}
// 			}
// 			
// 			interceptorBean = new RuntimeBeanReference(refDefname);
// 			mappedInterceptorDef.getConstructorArgumentValues().addIndexedArgumentValue(0, includePatterns);
// 			mappedInterceptorDef.getConstructorArgumentValues().addIndexedArgumentValue(1, excludePatterns);
// 			mappedInterceptorDef.getConstructorArgumentValues().addIndexedArgumentValue(2, interceptorBean);
// 			return mappedInterceptorDef;
// 		}
// 		return null;
// 	}
// 	
// 	@Override
// 	public boolean afterRemove(Class<?> clz, String beanName, String scope, DefaultListableBeanFactory dlbf) {
// 		// TODO Auto-generated method stub
// 		return false;
// 	}
// 	
// 	@Override
// 	public boolean getCondition(Class<?> clz) {
// 		return HandlerInterceptor.class.isAssignableFrom(clz);
// 	}
// 	
// }


// Path: 2-hi-spring-dynamic/src/main/java/com/helpinput/spring/servlet/mvc/EnhanceDispachServlet.java
import com.helpinput.holder.ContextHolder;
import com.helpinput.spring.registinerceptor.mvc.UrlInterceptorBeanRegistInterceptor;
import org.slf4j.Logger;
import org.springframework.beans.BeanUtils;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextException;
import org.springframework.web.context.ConfigurableWebApplicationContext;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.servlet.DispatcherServlet;
import com.helpinput.core.LoggerBase;

/*
 * Copyright 2013-2015 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 *@Author: niaoge(Zhengsheng Xia)
 *@Email 78493244@qq.com
 *@Date: 2015-6-20
 */
package com.helpinput.spring.servlet.mvc;



@SuppressWarnings("serial")
public class EnhanceDispachServlet extends DispatcherServlet {
	static Logger logger = LoggerBase.logger;