|
|||||||||||||||||||
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
Infrastructure.java | - | - | - | - |
|
1 |
// Copyright 2004, 2005 The Apache Software Foundation
|
|
2 |
//
|
|
3 |
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4 |
// you may not use this file except in compliance with the License.
|
|
5 |
// You may obtain a copy of the License at
|
|
6 |
//
|
|
7 |
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8 |
//
|
|
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 |
package org.apache.tapestry.services;
|
|
16 |
|
|
17 |
import javax.servlet.http.HttpServletRequest;
|
|
18 |
import javax.servlet.http.HttpServletResponse;
|
|
19 |
|
|
20 |
import org.apache.hivemind.ClassResolver;
|
|
21 |
import org.apache.hivemind.Resource;
|
|
22 |
import org.apache.tapestry.engine.IPageSource;
|
|
23 |
import org.apache.tapestry.engine.IPropertySource;
|
|
24 |
import org.apache.tapestry.engine.IScriptSource;
|
|
25 |
import org.apache.tapestry.engine.ISpecificationSource;
|
|
26 |
import org.apache.tapestry.engine.state.ApplicationStateManager;
|
|
27 |
import org.apache.tapestry.spec.IApplicationSpecification;
|
|
28 |
|
|
29 |
/**
|
|
30 |
* Tapestry infrastructure ... key services required by the {@link org.apache.tapestry.IEngine}
|
|
31 |
* instance.
|
|
32 |
*
|
|
33 |
* @author Howard Lewis Ship
|
|
34 |
* @since 3.1
|
|
35 |
*/
|
|
36 |
public interface Infrastructure |
|
37 |
{ |
|
38 |
/**
|
|
39 |
* Returns the {@link org.apache.tapestry.spec.IApplicationSpecification}for the current
|
|
40 |
* application.
|
|
41 |
*/
|
|
42 |
|
|
43 |
public IApplicationSpecification getApplicationSpecification();
|
|
44 |
|
|
45 |
/**
|
|
46 |
* Returns an {@link IPropertySource}configured to search the application specification, etc.
|
|
47 |
* See <code>tapestry.ApplicationPropertySource</code>.
|
|
48 |
*/
|
|
49 |
public IPropertySource getApplicationPropertySource();
|
|
50 |
|
|
51 |
/**
|
|
52 |
* Returns an {@link IPropertySource} configured to search
|
|
53 |
* the servlet, servlet context, and factory defaults.
|
|
54 |
*
|
|
55 |
*/
|
|
56 |
|
|
57 |
public IPropertySource getGlobalPropertySource();
|
|
58 |
|
|
59 |
/**
|
|
60 |
* Returns the coordinator to be notified of reset events (which will, in turn, notify other
|
|
61 |
* services).
|
|
62 |
*/
|
|
63 |
|
|
64 |
public ResetEventCoordinator getResetEventCoordinator();
|
|
65 |
|
|
66 |
/**
|
|
67 |
* Returns the source of component message bundles.
|
|
68 |
*/
|
|
69 |
|
|
70 |
public ComponentMessagesSource getComponentMessagesSource();
|
|
71 |
|
|
72 |
/**
|
|
73 |
* Returns component or page template contents.
|
|
74 |
*/
|
|
75 |
|
|
76 |
public TemplateSource getTemplateSource();
|
|
77 |
|
|
78 |
/**
|
|
79 |
* Returns the source of all application, page, component and library specifications.
|
|
80 |
*/
|
|
81 |
|
|
82 |
public ISpecificationSource getSpecificationSource();
|
|
83 |
|
|
84 |
/**
|
|
85 |
* Returns a generic, shared ObjectPool instance.
|
|
86 |
*/
|
|
87 |
public ObjectPool getObjectPool();
|
|
88 |
|
|
89 |
/**
|
|
90 |
* Returns the source for pages. The source is a cache of pages, but also can create new
|
|
91 |
* instances when needed.
|
|
92 |
*/
|
|
93 |
|
|
94 |
public IPageSource getPageSource();
|
|
95 |
|
|
96 |
/**
|
|
97 |
* Returns the ClassResolver used by the Tapestry HiveMind module, which should be sufficient
|
|
98 |
* for use throughout the application.
|
|
99 |
*/
|
|
100 |
|
|
101 |
public ClassResolver getClassResolver();
|
|
102 |
|
|
103 |
/**
|
|
104 |
* The DataSqueezer, used when constructing and decoding values stored in URLs (as query
|
|
105 |
* parameters or hidden form fields).
|
|
106 |
*/
|
|
107 |
|
|
108 |
public DataSqueezer getDataSqueezer();
|
|
109 |
|
|
110 |
/**
|
|
111 |
* The source for read-to-execute versions of Tapestry script templates.
|
|
112 |
*/
|
|
113 |
|
|
114 |
public IScriptSource getScriptSource();
|
|
115 |
|
|
116 |
/**
|
|
117 |
* The object from which engine services are obtained.
|
|
118 |
*/
|
|
119 |
|
|
120 |
public ServiceMap getServiceMap();
|
|
121 |
|
|
122 |
/**
|
|
123 |
* Service used to report exceptions to the console.
|
|
124 |
*/
|
|
125 |
|
|
126 |
public RequestExceptionReporter getRequestExceptionReporter();
|
|
127 |
|
|
128 |
/**
|
|
129 |
* Renders the active page as the response.
|
|
130 |
*/
|
|
131 |
|
|
132 |
public ResponseRenderer getResponseRenderer();
|
|
133 |
|
|
134 |
/**
|
|
135 |
* Constructs {@link org.apache.tapestry.engine.ILink}instances for
|
|
136 |
* {@link org.apache.tapestry.engine.IEngineService}s.
|
|
137 |
*/
|
|
138 |
|
|
139 |
public LinkFactory getLinkFactory();
|
|
140 |
|
|
141 |
/**
|
|
142 |
* Used by the {@link org.apache.tapestry.IEngine}to create instances of
|
|
143 |
* {@link org.apache.tapestry.IRequestCycle}.
|
|
144 |
*/
|
|
145 |
|
|
146 |
public RequestCycleFactory getRequestCycleFactory();
|
|
147 |
|
|
148 |
/**
|
|
149 |
* Accesses application state objects (Visit and Global from Tapestry 3.0, but now more can be
|
|
150 |
* created).
|
|
151 |
*/
|
|
152 |
|
|
153 |
public ApplicationStateManager getApplicationStateManager();
|
|
154 |
|
|
155 |
/**
|
|
156 |
* Returns the request for the current request.
|
|
157 |
*/
|
|
158 |
|
|
159 |
public HttpServletRequest getRequest();
|
|
160 |
|
|
161 |
/**
|
|
162 |
* Returns the response for the current request.
|
|
163 |
*/
|
|
164 |
|
|
165 |
public HttpServletResponse getResponse();
|
|
166 |
|
|
167 |
/**
|
|
168 |
* Returns the context path, which identifies the application within the application server.
|
|
169 |
* Context path should be used as a prefix for any URLs generated. The context path may be the
|
|
170 |
* empty string, and will not end in a slash (servlet paths should start with a slash).
|
|
171 |
*/
|
|
172 |
|
|
173 |
public String getContextPath();
|
|
174 |
|
|
175 |
/**
|
|
176 |
* Returns the application's id; a unique name that is incorporated into various session
|
|
177 |
* attribute keys and into certain paths when searching for resources. For a servlet-based
|
|
178 |
* Tapestry application, the id is the name of the servlet.
|
|
179 |
*/
|
|
180 |
|
|
181 |
public String getApplicationId();
|
|
182 |
|
|
183 |
/**
|
|
184 |
* Returns the root context resource, which is the starting point when looking for
|
|
185 |
* resources within the application.
|
|
186 |
*
|
|
187 |
*/
|
|
188 |
|
|
189 |
public Resource getContextRoot();
|
|
190 |
|
|
191 |
/**
|
|
192 |
* Returns an object used to access component meta-data properties.
|
|
193 |
*
|
|
194 |
*/
|
|
195 |
|
|
196 |
public ComponentPropertySource getComponentPropertySource();
|
|
197 |
} |
|