View Javadoc

1   
2   /*
3    * Copyright (C) 2005 by Arno Schumacher
4    *
5    * This file is part of net.sourceforge.servletspy
6    *
7    * net.sourceforge.servletspy is free software; you can redistribute
8    * it and/or modify it under the terms of the GNU General Public 
9    * License as published by the Free Software Foundation; either 
10   * version 2, or (at your option) any later version.
11   *
12   * net.sourceforge.servletspy is distributed in the hope that it will
13   * be useful, but WITHOUT ANY WARRANTY; without even the implied 
14   * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
15   * See the GNU General Public License for more details.
16   *
17   * You should have received a copy of the GNU General Public License
18   * along with this program; if not, write to the Free Software
19   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA 
20   */
21  
22  package net.sourceforge.servletspy.handler.std;
23  
24  import net.sourceforge.servletspy.IContext;
25  import net.sourceforge.servletspy.IContextHandler;
26  import net.sourceforge.servletspy.config.Param;
27  
28  /***
29   * @author arno schumacher
30   */
31  public final class NullHandler implements IContextHandler {
32      /* (non-Javadoc)
33       * @see net.sourceforge.servletspy.ILifecycle#init(net.sourceforge.servletspy.config.Param[])
34       */
35      public void init(final Param[] params) {
36      }
37  
38      /* (non-Javadoc)
39       * @see net.sourceforge.servletspy.ILifecycle#destroy()
40       */
41      public void destroy() {
42      }
43  
44      /* (non-Javadoc)
45       * @see net.sourceforge.servletspy.IContextHandler#handle(net.sourceforge.servletspy.IContext)
46       */
47      public void handle(final IContext context) throws Exception {
48          if (context.getSubject() == null) {
49              context.setValue("<null>");
50          } else {
51              context.proceed();
52          }
53      }
54  }