// Path: src/main/java/com/openthinks/easyweb/EasyWebFilter.java
// public class EasyWebFilter implements Filter {
// 
// 	@Override
// 	public void init(FilterConfig filterConfig) throws ServletException {
// 		EasyWebFilterContext webFilterCtx = EasyWebFilterContexts.get(this.getClass());
// 		webFilterCtx.fireInit(filterConfig);
// 	}
// 
// 	@Override
// 	public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
// 			throws IOException, ServletException {
// 		FilterHandler handler = Handlers.getFilterHandler(request, request.getServletContext());
// 		handler.handle(request, response, chain);
// 	}
// 
// 	@Override
// 	public void destroy() {
// 		EasyWebFilterContext webFilterCtx = EasyWebFilterContexts.get(this.getClass());
// 		webFilterCtx.fireDestroy();
// 	}
// 
// }
// 
// Path: src/main/java/com/openthinks/easyweb/EasyWebFilterListener.java
// public interface EasyWebFilterListener {
// 	/**
// 	 * 
// 	 * @param filterContext EasyWebFilterContext
// 	 */
// 	public void on(final EasyWebFilterContext filterContext);
// }


import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import javax.servlet.FilterConfig;
import com.openthinks.easyweb.EasyWebFilter;
import com.openthinks.easyweb.EasyWebFilterListener;
import com.openthinks.libs.utilities.Checker;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**   
 *  Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you 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.
 *
* @Title: EasyWebFilterContexts.java 
* @Package com.openthinks.easyweb.context 
* @Description: TODO
* @author dailey.yet@outlook.com  
* @date Aug 26, 2016
* @version V1.0   
*/
package com.openthinks.easyweb.context;




/**
 * Container for {@link EasyWebFilterContext}
 * date:	2016/8/26
 * 
 * @author dailey.yet@outlook.com
 */
public final class EasyWebFilterContexts {
	private static final Map<Class<? extends EasyWebFilter>, EasyWebFilterContext> ctxBook = new ConcurrentHashMap<>();
	private static final Lock lock = new ReentrantLock();

	/**
	 * find {@link EasyWebFilterContext} instance by reference Class {@link EasyWebFilter}
	 * @param webFilterClazz web filter class
	 * @return EasyWebFilterContext
	 */

// Path: src/main/java/com/openthinks/easyweb/EasyWebFilter.java
// public class EasyWebFilter implements Filter {
// 
// 	@Override
// 	public void init(FilterConfig filterConfig) throws ServletException {
// 		EasyWebFilterContext webFilterCtx = EasyWebFilterContexts.get(this.getClass());
// 		webFilterCtx.fireInit(filterConfig);
// 	}
// 
// 	@Override
// 	public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
// 			throws IOException, ServletException {
// 		FilterHandler handler = Handlers.getFilterHandler(request, request.getServletContext());
// 		handler.handle(request, response, chain);
// 	}
// 
// 	@Override
// 	public void destroy() {
// 		EasyWebFilterContext webFilterCtx = EasyWebFilterContexts.get(this.getClass());
// 		webFilterCtx.fireDestroy();
// 	}
// 
// }
// 
// Path: src/main/java/com/openthinks/easyweb/EasyWebFilterListener.java
// public interface EasyWebFilterListener {
// 	/**
// 	 * 
// 	 * @param filterContext EasyWebFilterContext
// 	 */
// 	public void on(final EasyWebFilterContext filterContext);
// }


// Path: src/main/java/com/openthinks/easyweb/context/EasyWebFilterContexts.java
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import javax.servlet.FilterConfig;
import com.openthinks.easyweb.EasyWebFilter;
import com.openthinks.easyweb.EasyWebFilterListener;
import com.openthinks.libs.utilities.Checker;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**   
 *  Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you 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.
 *
* @Title: EasyWebFilterContexts.java 
* @Package com.openthinks.easyweb.context 
* @Description: TODO
* @author dailey.yet@outlook.com  
* @date Aug 26, 2016
* @version V1.0   
*/
package com.openthinks.easyweb.context;




/**
 * Container for {@link EasyWebFilterContext}
 * date:	2016/8/26
 * 
 * @author dailey.yet@outlook.com
 */
public final class EasyWebFilterContexts {
	private static final Map<Class<? extends EasyWebFilter>, EasyWebFilterContext> ctxBook = new ConcurrentHashMap<>();
	private static final Lock lock = new ReentrantLock();

	/**
	 * find {@link EasyWebFilterContext} instance by reference Class {@link EasyWebFilter}
	 * @param webFilterClazz web filter class
	 * @return EasyWebFilterContext
	 */

	public static EasyWebFilterContext get(Class<? extends EasyWebFilter> webFilterClazz) {
