%line | %branch | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
net.sf.infrared.aspects.servlet.ServletContext |
|
|
1 | /* |
|
2 | * Copyright 2005 Tavant Technologies and Contributors |
|
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 | * |
|
17 | * |
|
18 | * Original Author: binil.thomas (Tavant Technologies) |
|
19 | * Contributor(s): -; |
|
20 | * |
|
21 | */ |
|
22 | package net.sf.infrared.aspects.servlet; |
|
23 | ||
24 | import net.sf.infrared.aspects.AbstractExecutionContext; |
|
25 | ||
26 | public class ServletContext extends AbstractExecutionContext { |
|
27 | ||
28 | private String uri; |
|
29 | ||
30 | public ServletContext(String uri) { |
|
31 | 0 | super("HTTP"); |
32 | 0 | this.uri = uri; |
33 | 0 | } |
34 | ||
35 | public ServletContext(String name, String layer) { |
|
36 | 0 | super(layer); |
37 | 0 | this.uri = name; |
38 | 0 | } |
39 | ||
40 | public String getName() { |
|
41 | 0 | return uri; |
42 | } |
|
43 | ||
44 | public String toString() { |
|
45 | 0 | return "Servlet " + getName(); |
46 | } |
|
47 | ||
48 | public boolean equals(Object o) { |
|
49 | 0 | if (o == null) { |
50 | 0 | return false; |
51 | } |
|
52 | ||
53 | 0 | if (o == this) { |
54 | 0 | return true; |
55 | } |
|
56 | ||
57 | 0 | if (! (o instanceof ServletContext) ) { |
58 | 0 | return false; |
59 | } |
|
60 | ||
61 | 0 | ServletContext other = (ServletContext) o; |
62 | ||
63 | 0 | return other.getName().equals( this.getName() ); |
64 | } |
|
65 | ||
66 | public int hashCode() { |
|
67 | 0 | return 7 * getName().hashCode(); |
68 | } |
|
69 | } |
This report is generated by jcoverage, Maven and Maven JCoverage Plugin. |