KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mortbay > j2ee > J2EEWebApplicationContext


1 // ========================================================================
2
// $Id: J2EEWebApplicationContext.java,v 1.6 2004/10/03 01:35:42 gregwilkins Exp $
3
// Copyright 2002-2004 Mort Bay Consulting Pty. Ltd.
4
// ------------------------------------------------------------------------
5
// Licensed under the Apache License, Version 2.0 (the "License");
6
// you may not use this file except in compliance with the License.
7
// You may obtain a copy of the License at
8
// http://www.apache.org/licenses/LICENSE-2.0
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14

15 /* JFox, the OpenSource J2EE Application Server
16  *
17  * Distributable under GNU LGPL license by gun.org
18  * more details please visit http://www.huihoo.org/jfox
19  */

20 package org.mortbay.j2ee;
21
22 import org.jfox.ioc.logger.Logger;
23 import org.mortbay.j2ee.session.Manager;
24 import org.mortbay.jetty.servlet.WebApplicationContext;
25
26 public class
27   J2EEWebApplicationContext
28   extends WebApplicationContext
29 {
30   protected static final Logger _log= Logger.getLogger(J2EEWebApplicationContext.class);
31
32   //----------------------------------------------------------------------------
33
// DistributedHttpSession support
34
//----------------------------------------------------------------------------
35
protected boolean _distributable=false;
36   protected Manager _distributableSessionManager;
37
38   public J2EEWebApplicationContext() {
39   }
40
41     //----------------------------------------------------------------------------
42
public J2EEWebApplicationContext(String JavaDoc warUrl) {
43       super(warUrl);
44     }
45
46   //----------------------------------------------------------------------------
47
public boolean getDistributable()
48     {
49       return _distributable;
50     }
51
52   //----------------------------------------------------------------------------
53
public void setDistributable(boolean distributable)
54     {
55       if (_log.isDebugEnabled()) _log.debug("setDistributable "+distributable);
56       _distributable=distributable;
57     }
58
59
60   //----------------------------------------------------------------------------
61
public void setDistributableSessionManager(Manager manager)
62     {
63       // _log.info("setDistributableSessionManager "+manager);
64
_distributableSessionManager=(Manager)manager;
65       _distributableSessionManager.setContext(this);
66     }
67
68   //----------------------------------------------------------------------------
69
public Manager getDistributableSessionManager()
70     {
71       return _distributableSessionManager;
72     }
73
74   //----------------------------------------------------------------------------
75
protected void doStart()
76     throws Exception JavaDoc
77   {
78       if (getStopGracefully() && !getStatsOn())
79     setStatsOn(true);
80
81       super.doStart();
82   }
83
84   //----------------------------------------------------------------------------
85
public void destroy()
86   {
87       super.destroy();
88       _distributableSessionManager=null;
89   }
90 }
91
Popular Tags