Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
Mechanism |
|
| 1.0;1 |
1 | /* | |
2 | * Licensed to the Apache Software Foundation (ASF) under one or more | |
3 | * contributor license agreements. See the NOTICE file distributed with | |
4 | * this work for additional information regarding copyright ownership. | |
5 | * The ASF licenses this file to you under the Apache License, Version 2.0 | |
6 | * (the "License"); you may not use this file except in compliance with | |
7 | * the License. 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, either express or implied. | |
14 | * See the License for the specific language governing permissions and | |
15 | * limitations under the License. | |
16 | */ | |
17 | ||
18 | package org.apache.shale.remoting; | |
19 | ||
20 | /** | |
21 | * <p>Typesafe enumeration of the legal values that may be specified for the | |
22 | * <code>mechanism</code> property of a {@link Mapping}. Note that these values | |
23 | * are advisory only -- the framework has no concept of what technique is | |
24 | * actually employed to translate the incomfing view identifier into content | |
25 | * to be supplied as a response.</p> | |
26 | */ | |
27 | public final class Mechanism { | |
28 | ||
29 | ||
30 | // ------------------------------------------------------------ Constructors | |
31 | ||
32 | ||
33 | /** | |
34 | * <p>Private constructor to disable creation of new instances.</p> | |
35 | * | |
36 | * @param description Description of this mechanism | |
37 | */ | |
38 | 4 | private Mechanism(String description) { |
39 | ||
40 | 4 | this.description = description; |
41 | ||
42 | 4 | } |
43 | ||
44 | ||
45 | // ------------------------------------------------------ Instance Variables | |
46 | ||
47 | ||
48 | /** | |
49 | * <p>The description of this mechanism.</p> | |
50 | */ | |
51 | 4 | private String description = null; |
52 | ||
53 | ||
54 | // ---------------------------------------------------------- Public Methods | |
55 | ||
56 | ||
57 | /** | |
58 | * <p>Return a string representation of this mechansim.</p> | |
59 | */ | |
60 | public String toString() { | |
61 | ||
62 | return this.description; | |
63 | ||
64 | } | |
65 | ||
66 | ||
67 | ||
68 | ||
69 | // -------------------------------------------------------- Create Instances | |
70 | ||
71 | ||
72 | /** | |
73 | * <p>{@link Mechanism} indicating that the processor should serve a static | |
74 | * resource from the classpath of this web application.</p> | |
75 | */ | |
76 | 1 | public static final Mechanism CLASS_RESOURCE = new Mechanism("CLASS_RESOURCE"); |
77 | ||
78 | ||
79 | /** | |
80 | * <p>{@link Mechanism} indicating that the processor should serve a static | |
81 | * resource from the web application archive of this web application.</p> | |
82 | */ | |
83 | 1 | public static final Mechanism WEBAPP_RESOURCE = new Mechanism("WEBAPP_RESOURCE"); |
84 | ||
85 | ||
86 | /** | |
87 | * <p>{@link Mechanism} indicating that the processor should dynamically | |
88 | * calculate the content type, and contents, of the response to be | |
89 | * created.</p> | |
90 | */ | |
91 | 1 | public static final Mechanism DYNAMIC_RESOURCE = new Mechanism("DYNAMIC_RESOURCE"); |
92 | ||
93 | ||
94 | /** | |
95 | * <p>{@link Mechanism} indicating that an unspecified mechanism will be | |
96 | * used to provide the content for the response.</p> | |
97 | */ | |
98 | 1 | public static final Mechanism OTHER_RESOURCE = new Mechanism("OTHER_RESOURCE"); |
99 | ||
100 | ||
101 | } |