2 * Copyright (C) 2015 Roland Haeder
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 package org.mxchange.jcoreee.filter.servlet;
19 import java.text.MessageFormat;
20 import javax.servlet.Filter;
21 import javax.servlet.FilterConfig;
22 import javax.servlet.ServletException;
23 import org.mxchange.jcoree.BaseEeSystem;
26 * A general servlet filter class. If you need to override init() or
27 * destroy() please always call the super method first and handle over all
30 * @author Roland Haeder
32 public abstract class BaseServletFilter extends BaseEeSystem implements Filter {
34 * Configuration instance
36 private FilterConfig config;
39 * Destroys this filter
42 public void destroy () {
43 // Unset config instance
48 * Initializes this filter
50 * @param filterConfig Filter configuration
51 * @throws ServletException
54 public void init (final FilterConfig filterConfig) throws ServletException {
56 this.getLogger().logTrace(MessageFormat.format("filterConfig={0} - CALLED!", filterConfig)); //NOI18N
58 // Set config instance
59 this.setConfig(filterConfig);
62 this.getLogger().logTrace("EXIT!"); //NOI18N
66 * Configuration instance
69 protected FilterConfig getConfig () {
74 * Configuration instance
75 * @param config the config to set
77 private void setConfig (final FilterConfig config) {