01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.cocoon.mail;
18:
19: import javax.servlet.http.HttpSessionBindingEvent;
20: import javax.servlet.http.HttpSessionBindingListener;
21: import org.apache.avalon.framework.context.Context;
22:
23: /**
24: * An extension of MailContext.
25: * <p>
26: * It implments HttpSessionBindingListener for manging MailContext
27: * resources in case of valueUnbound - ie. session removal.
28: * </p>
29: *
30: * @author Bernhard Huber
31: * @since 02 January 2003
32: * @version $Id: MailContextHttpSession.java 468095 2006-10-26 18:50:50Z vgritsenko $
33: */
34: public class MailContextHttpSession extends MailContext implements
35: HttpSessionBindingListener {
36:
37: /**
38: *Constructor for the MailContextHttpSession object
39: *
40: *@param parent Description of the Parameter
41: */
42: public MailContextHttpSession(Context parent) {
43: super (parent);
44: }
45:
46: /**
47: * Notifies the object that it is being bound to a session and identifies the session.
48: *
49: *@param event Description of the Parameter
50: */
51: public void valueBound(HttpSessionBindingEvent event) {
52: getLogger().info("value bound " + String.valueOf(event));
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 event) {
61: getLogger().info("value unbound " + String.valueOf(event));
62:
63: // This should not happen, removeStore of this
64: this.removeStore();
65: }
66: }
|