Clover.NET coverage report - Coverage for s2container.net

Coverage timestamp: 2006年5月30日 11:21:29

File Stats: LOC: 70   Methods: 5
NCLOC: 41 Classes: 1
 
Source File Conditionals Statements Methods TOTAL
Seasar.Framework.Container\Web\S2HttpModule.cs 0.0% 0.0% 0.0% 0.0%
coverage
1   #region Copyright
2   /*
3   * Copyright 2005 the Seasar Foundation and the Others.
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   *
9   * 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,
14   * either express or implied. See the License for the specific language
15   * governing permissions and limitations under the License.
16   */
17   #endregion
18  
19   using System;
20   using System.Web;
21   using Seasar.Framework.Container.Factory;
22  
23   namespace Seasar.Framework.Container.Web
24   {
25   /// <summary>
26   /// S2HttpModule の概要の説明です。
27   /// </summary>
28   public class S2HttpModule : IHttpModule
29   {
30  
31 0 public S2HttpModule()
32   {
33   }
34  
35   #region IHttpModule メンバ
36  
37 0 public void Init(HttpApplication context)
38   {
39   context.AcquireRequestState += new EventHandler(context_AcquireRequestState);
40   context.ReleaseRequestState += new EventHandler(context_ReleaseRequestState);
41   }
42  
43 0 public void Dispose()
44   {
45   }
46  
47   #endregion
48  
49 0 private void context_AcquireRequestState(object sender, EventArgs e)
50   {
51   HttpApplication ha = (HttpApplication) sender;
52   IHttpHandler handler = ha.Context.Handler;
53  
54   IS2Container container = SingletonS2ContainerFactory.Container;
55   container.HttpContext = HttpContext.Current;
56   string componentName = ha.Request.Path;
57   if(container.HasComponentDef(componentName))
58   {
59   container.InjectDependency(handler, componentName);
60   }
61   }
62  
63 0 private void context_ReleaseRequestState(object sender, EventArgs e)
64   {
65   IS2Container container = SingletonS2ContainerFactory.Container;
66   container.HttpContext = null;
67   }
68   }
69   }
70