New test.
[mono.git] / mcs / class / System.Web / System.Web / ProcessInfo.cs
1 // \r
2 // System.Web.ProcessInfo\r
3 //\r
4 // Author:\r
5 //   Tim Coleman (tim@timcoleman.com)\r
6 //\r
7 // Copyright (C) Tim Coleman, 2002\r
8 // Copyright (C) 2005 Novell, Inc (http://www.novell.com)
9 //
10 // Permission is hereby granted, free of charge, to any person obtaining
11 // a copy of this software and associated documentation files (the
12 // "Software"), to deal in the Software without restriction, including
13 // without limitation the rights to use, copy, modify, merge, publish,
14 // distribute, sublicense, and/or sell copies of the Software, and to
15 // permit persons to whom the Software is furnished to do so, subject to
16 // the following conditions:
17 // 
18 // The above copyright notice and this permission notice shall be
19 // included in all copies or substantial portions of the Software.
20 // 
21 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
24 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
25 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
26 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
27 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 //
29
30 using System.Security.Permissions;
31 \r
32 namespace System.Web {\r
33
34         // CAS
35         [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
36         [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
37         public class ProcessInfo {\r
38 \r
39                 #region Fields\r
40 \r
41                 TimeSpan age;\r
42                 int peakMemoryUsed;\r
43                 int processID;\r
44                 int requestCount;\r
45                 ProcessShutdownReason shutdownReason;\r
46                 DateTime startTime;\r
47                 ProcessStatus status;\r
48 \r
49                 #endregion\r
50 \r
51                 #region Constructors\r
52 \r
53                 public ProcessInfo ()\r
54                 {\r
55                 }\r
56 \r
57                 public ProcessInfo (DateTime startTime, TimeSpan age, int processID, int requestCount, ProcessStatus status, ProcessShutdownReason shutdownReason, int peakMemoryUsed)\r
58                 {\r
59                         this.age = age;\r
60                         this.peakMemoryUsed = peakMemoryUsed;\r
61                         this.processID = processID;\r
62                         this.requestCount = requestCount;\r
63                         this.shutdownReason = shutdownReason;\r
64                         this.startTime = startTime;\r
65                         this.status = status;\r
66                 }\r
67 \r
68                 #endregion\r
69 \r
70                 #region Properties\r
71 \r
72                 public TimeSpan Age {\r
73                         get { return age; }\r
74                 }\r
75 \r
76                 public int PeakMemoryUsed {\r
77                         get { return peakMemoryUsed; }\r
78                 }\r
79 \r
80                 public int ProcessID {\r
81                         get { return processID; }\r
82                 }\r
83 \r
84                 public int RequestCount {\r
85                         get { return requestCount; }\r
86                 }\r
87 \r
88                 public ProcessShutdownReason ShutdownReason {\r
89                         get { return shutdownReason; }\r
90                 }\r
91 \r
92                 public DateTime StartTime {\r
93                         get { return startTime; }\r
94                 }\r
95 \r
96                 public ProcessStatus Status {\r
97                         get { return status; }\r
98                 }\r
99 \r
100                 #endregion // Properties\r
101 \r
102                 #region Methods\r
103 \r
104                 public void SetAll (DateTime startTime, TimeSpan age, int processID, int requestCount, ProcessStatus status, ProcessShutdownReason shutdownReason, int peakMemoryUsed)\r
105                 {\r
106                         this.age = age;\r
107                         this.peakMemoryUsed = peakMemoryUsed;\r
108                         this.processID = processID;\r
109                         this.requestCount = requestCount;\r
110                         this.shutdownReason = shutdownReason;\r
111                         this.startTime = startTime;\r
112                         this.status = status;\r
113                 }\r
114 \r
115                 #endregion // Methods\r
116         }\r
117 }\r