View Javadoc

1   //
2   //  ========================================================================
3   //  Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
4   //  ------------------------------------------------------------------------
5   //  All rights reserved. This program and the accompanying materials
6   //  are made available under the terms of the Eclipse Public License v1.0
7   //  and Apache License v2.0 which accompanies this distribution.
8   //
9   //      The Eclipse Public License is available at
10  //      http://www.eclipse.org/legal/epl-v10.html
11  //
12  //      The Apache License v2.0 is available at
13  //      http://www.opensource.org/licenses/apache2.0.php
14  //
15  //  You may elect to redistribute this code under either of these licenses.
16  //  ========================================================================
17  //
18  
19  package com.acme;
20  import javax.annotation.Resource;
21  import javax.servlet.ServletContextAttributeEvent;
22  import javax.servlet.ServletContextAttributeListener;
23  import javax.servlet.ServletContextEvent;
24  import javax.servlet.ServletContextListener;
25  import javax.servlet.ServletRequestAttributeEvent;
26  import javax.servlet.ServletRequestAttributeListener;
27  import javax.servlet.ServletRequestEvent;
28  import javax.servlet.ServletRequestListener;
29  import javax.servlet.annotation.WebListener;
30  import javax.servlet.http.HttpSessionActivationListener;
31  import javax.servlet.http.HttpSessionAttributeListener;
32  import javax.servlet.http.HttpSessionBindingEvent;
33  import javax.servlet.http.HttpSessionEvent;
34  import javax.servlet.http.HttpSessionListener;
35  
36  
37  @Foo(1)
38  @WebListener
39  public class TestListener implements HttpSessionListener,  HttpSessionAttributeListener, HttpSessionActivationListener, ServletContextListener, ServletContextAttributeListener, ServletRequestListener, ServletRequestAttributeListener
40  {
41  
42      @Resource(mappedName="maxAmount")
43      private Double maxAmount;
44  
45      public void attributeAdded(HttpSessionBindingEvent se)
46      {
47          // System.err.println("attributedAdded "+se);
48      }
49  
50      public void attributeRemoved(HttpSessionBindingEvent se)
51      {
52          // System.err.println("attributeRemoved "+se);
53      }
54  
55      public void attributeReplaced(HttpSessionBindingEvent se)
56      {
57          // System.err.println("attributeReplaced "+se);
58      }
59  
60      public void sessionWillPassivate(HttpSessionEvent se)
61      {
62          // System.err.println("sessionWillPassivate "+se);
63      }
64  
65      public void sessionDidActivate(HttpSessionEvent se)
66      {
67          // System.err.println("sessionDidActivate "+se);
68      }
69  
70      public void contextInitialized(ServletContextEvent sce)
71      {
72          //System.err.println("contextInitialized, maxAmount injected as "+maxAmount);
73      }
74  
75      public void contextDestroyed(ServletContextEvent sce)
76      {
77          // System.err.println("contextDestroyed "+sce);
78      }
79  
80      public void attributeAdded(ServletContextAttributeEvent scab)
81      {
82          // System.err.println("attributeAdded "+scab);
83      }
84  
85      public void attributeRemoved(ServletContextAttributeEvent scab)
86      {
87          // System.err.println("attributeRemoved "+scab);
88      }
89  
90      public void attributeReplaced(ServletContextAttributeEvent scab)
91      {
92          // System.err.println("attributeReplaced "+scab);
93      }
94  
95      public void requestDestroyed(ServletRequestEvent sre)
96      {
97          // System.err.println("requestDestroyed "+sre);
98      }
99  
100     public void requestInitialized(ServletRequestEvent sre)
101     {
102         // System.err.println("requestInitialized "+sre);
103     }
104 
105     public void attributeAdded(ServletRequestAttributeEvent srae)
106     {
107         // System.err.println("attributeAdded "+srae);
108     }
109 
110     public void attributeRemoved(ServletRequestAttributeEvent srae)
111     {
112         // System.err.println("attributeRemoved "+srae);
113     }
114 
115     public void attributeReplaced(ServletRequestAttributeEvent srae)
116     {
117         // System.err.println("attributeReplaced "+srae);
118     }
119 
120     public void sessionCreated(HttpSessionEvent se)
121     {
122         // System.err.println("sessionCreated "+se);
123     }
124 
125     public void sessionDestroyed(HttpSessionEvent se)
126     {
127         // System.err.println("sessionDestroyed "+se);
128     }
129 
130     public void requestCompleted(ServletRequestEvent rre)
131     {
132         // TODO Auto-generated method stub
133         
134     }
135 
136     public void requestResumed(ServletRequestEvent rre)
137     {
138         // TODO Auto-generated method stub
139         
140     }
141 
142     public void requestSuspended(ServletRequestEvent rre)
143     {
144         // TODO Auto-generated method stub
145         
146     }
147 
148 }