KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > mail > MailContextHttpSession


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.cocoon.mail;
17
18 import javax.servlet.http.HttpSessionBindingEvent JavaDoc;
19 import javax.servlet.http.HttpSessionBindingListener JavaDoc;
20 import org.apache.avalon.framework.context.Context;
21
22 /**
23  * An extension of MailContext.
24  * <p>
25  * It implments HttpSessionBindingListener for manging MailContext
26  * resources in case of valueUnbound - ie. session removal.
27  * </p>
28  *
29  * @author Bernhard Huber
30  * @since 02 January 2003
31  * @version CVS $Id: MailContextHttpSession.java 30932 2004-07-29 17:35:38Z vgritsenko $
32  */

33 public class MailContextHttpSession extends MailContext implements HttpSessionBindingListener JavaDoc {
34
35     /**
36      *Constructor for the MailContextHttpSession object
37      *
38      *@param parent Description of the Parameter
39      */

40     public MailContextHttpSession(Context parent) {
41         super(parent);
42     }
43
44
45     /**
46      * Notifies the object that it is being bound to a session and identifies the session.
47      *
48      *@param event Description of the Parameter
49      */

50     public void valueBound(HttpSessionBindingEvent JavaDoc event) {
51         getLogger().info("value bound " + String.valueOf(event));
52     }
53
54
55     /**
56      * Notifies the object that it is being unbound from a session and identifies the session.
57      *
58      *@param event Description of the Parameter
59      */

60     public void valueUnbound(HttpSessionBindingEvent JavaDoc event) {
61         getLogger().info("value unbound " + String.valueOf(event));
62         
63         // This should not happen, removeStore of this
64
this.removeStore();
65     }
66 }
67
68
Popular Tags