|
|||||||||||||||||||
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 java.util.Locale;
|
|
18 |
|
|
19 |
import org.apache.hivemind.ClassResolver;
|
|
20 |
import org.apache.hivemind.Resource;
|
|
21 |
import org.apache.tapestry.coerce.ValueConverter;
|
|
22 |
import org.apache.tapestry.describe.HTMLDescriber;
|
|
23 |
import org.apache.tapestry.engine.IPageSource;
|
|
24 |
import org.apache.tapestry.engine.IPropertySource;
|
|
25 |
import org.apache.tapestry.engine.IScriptSource;
|
|
26 |
import org.apache.tapestry.engine.ISpecificationSource;
|
|
27 |
import org.apache.tapestry.engine.state.ApplicationStateManager;
|
|
28 |
import org.apache.tapestry.error.ExceptionPresenter;
|
|
29 |
import org.apache.tapestry.error.RequestExceptionReporter;
|
|
30 |
import org.apache.tapestry.error.StaleLinkExceptionPresenter;
|
|
31 |
import org.apache.tapestry.error.StaleSessionExceptionPresenter;
|
|
32 |
import org.apache.tapestry.listener.ListenerInvoker;
|
|
33 |
import org.apache.tapestry.listener.ListenerMapSource;
|
|
34 |
import org.apache.tapestry.markup.MarkupWriterSource;
|
|
35 |
import org.apache.tapestry.spec.IApplicationSpecification;
|
|
36 |
import org.apache.tapestry.web.WebRequest;
|
|
37 |
import org.apache.tapestry.web.WebResponse;
|
|
38 |
|
|
39 |
/**
|
|
40 |
* Tapestry infrastructure ... key services required by the {@link org.apache.tapestry.IEngine}
|
|
41 |
* instance.
|
|
42 |
*
|
|
43 |
* @author Howard Lewis Ship
|
|
44 |
* @since 4.0
|
|
45 |
*/
|
|
46 |
public interface Infrastructure |
|
47 |
{ |
|
48 |
/**
|
|
49 |
* Initializes the Infrastructure for a particular mode.
|
|
50 |
*
|
|
51 |
* @throws IllegalStateException
|
|
52 |
* if the Infrastructure has already been initialized.
|
|
53 |
*/
|
|
54 |
|
|
55 |
public void initialize(String mode); |
|
56 |
|
|
57 |
/**
|
|
58 |
* Returns a named property.
|
|
59 |
*
|
|
60 |
* @throws IllegalStateException
|
|
61 |
* if the Infrastructure has not yet been initialized.
|
|
62 |
* @throws org.apache.hivemind.ApplicationRuntimeException
|
|
63 |
* if no value has been contributed for specified property name.
|
|
64 |
*/
|
|
65 |
|
|
66 |
public Object getProperty(String propertyName);
|
|
67 |
|
|
68 |
/**
|
|
69 |
* Returns the {@link org.apache.tapestry.spec.IApplicationSpecification} for the current
|
|
70 |
* application.
|
|
71 |
*/
|
|
72 |
|
|
73 |
public IApplicationSpecification getApplicationSpecification();
|
|
74 |
|
|
75 |
/**
|
|
76 |
* Returns an {@link IPropertySource} configured to search the application specification,
|
|
77 |
* etc. See <code>tapestry.ApplicationPropertySource</code>.
|
|
78 |
*/
|
|
79 |
public IPropertySource getApplicationPropertySource();
|
|
80 |
|
|
81 |
/**
|
|
82 |
* Returns an {@link IPropertySource} configured to search the servlet, servlet context,
|
|
83 |
* and factory defaults.
|
|
84 |
*/
|
|
85 |
|
|
86 |
public IPropertySource getGlobalPropertySource();
|
|
87 |
|
|
88 |
/**
|
|
89 |
* Returns the coordinator to be notified of reset events (which will, in turn, notify other
|
|
90 |
* services that they should discard cached data).
|
|
91 |
*/
|
|
92 |
|
|
93 |
public ResetEventCoordinator getResetEventCoordinator();
|
|
94 |
|
|
95 |
/**
|
|
96 |
* Returns the source of component message bundles.
|
|
97 |
*/
|
|
98 |
|
|
99 |
public ComponentMessagesSource getComponentMessagesSource();
|
|
100 |
|
|
101 |
/**
|
|
102 |
* Returns component or page template contents.
|
|
103 |
*/
|
|
104 |
|
|
105 |
public TemplateSource getTemplateSource();
|
|
106 |
|
|
107 |
/**
|
|
108 |
* Returns the source of all application, page, component and library specifications.
|
|
109 |
*/
|
|
110 |
|
|
111 |
public ISpecificationSource getSpecificationSource();
|
|
112 |
|
|
113 |
/**
|
|
114 |
* Returns a generic, shared ObjectPool instance.
|
|
115 |
*/
|
|
116 |
public ObjectPool getObjectPool();
|
|
117 |
|
|
118 |
/**
|
|
119 |
* Returns the source for pages. The source is a cache of pages, but also can create new
|
|
120 |
* instances when needed.
|
|
121 |
*/
|
|
122 |
|
|
123 |
public IPageSource getPageSource();
|
|
124 |
|
|
125 |
/**
|
|
126 |
* Returns the ClassResolver used by the Tapestry HiveMind module, which should be sufficient
|
|
127 |
* for use throughout the application.
|
|
128 |
*/
|
|
129 |
|
|
130 |
public ClassResolver getClassResolver();
|
|
131 |
|
|
132 |
/**
|
|
133 |
* The DataSqueezer, used when constructing and decoding values stored in URLs (as query
|
|
134 |
* parameters or hidden form fields).
|
|
135 |
*/
|
|
136 |
|
|
137 |
public DataSqueezer getDataSqueezer();
|
|
138 |
|
|
139 |
/**
|
|
140 |
* The source for ready-to-execute versions of Tapestry script templates.
|
|
141 |
*/
|
|
142 |
|
|
143 |
public IScriptSource getScriptSource();
|
|
144 |
|
|
145 |
/**
|
|
146 |
* The object from which engine services are obtained.
|
|
147 |
*/
|
|
148 |
|
|
149 |
public ServiceMap getServiceMap();
|
|
150 |
|
|
151 |
/**
|
|
152 |
* Service used to report exceptions to the console.
|
|
153 |
*/
|
|
154 |
|
|
155 |
public RequestExceptionReporter getRequestExceptionReporter();
|
|
156 |
|
|
157 |
/**
|
|
158 |
* Renders the active page as the response.
|
|
159 |
*/
|
|
160 |
|
|
161 |
public ResponseRenderer getResponseRenderer();
|
|
162 |
|
|
163 |
/**
|
|
164 |
* Constructs {@link org.apache.tapestry.engine.ILink} instances for
|
|
165 |
* {@link org.apache.tapestry.engine.IEngineService}s.
|
|
166 |
*/
|
|
167 |
|
|
168 |
public LinkFactory getLinkFactory();
|
|
169 |
|
|
170 |
/**
|
|
171 |
* Used by the {@link org.apache.tapestry.IEngine} to create instances of
|
|
172 |
* {@link org.apache.tapestry.IRequestCycle}.
|
|
173 |
*/
|
|
174 |
|
|
175 |
public RequestCycleFactory getRequestCycleFactory();
|
|
176 |
|
|
177 |
/**
|
|
178 |
* Accesses application state objects (Visit and Global from Tapestry 3.0, but now more can be
|
|
179 |
* created).
|
|
180 |
*/
|
|
181 |
|
|
182 |
public ApplicationStateManager getApplicationStateManager();
|
|
183 |
|
|
184 |
/**
|
|
185 |
* Returns the request for the current request cycle.
|
|
186 |
*/
|
|
187 |
|
|
188 |
public WebRequest getRequest();
|
|
189 |
|
|
190 |
/**
|
|
191 |
* Returns the response for the current request cycle.
|
|
192 |
*/
|
|
193 |
|
|
194 |
public WebResponse getResponse();
|
|
195 |
|
|
196 |
/**
|
|
197 |
* Returns the context path, which identifies the application within the application server.
|
|
198 |
* Context path should be used as a prefix for any URLs generated. The context path may be the
|
|
199 |
* empty string, and will not end in a slash (servlet paths should start with a slash).
|
|
200 |
*/
|
|
201 |
|
|
202 |
public String getContextPath();
|
|
203 |
|
|
204 |
/**
|
|
205 |
* Returns the application's id; a unique name that is incorporated into various session
|
|
206 |
* attribute keys and into certain paths when searching for resources. For a servlet-based
|
|
207 |
* Tapestry application, the id is the name of the servlet.
|
|
208 |
*/
|
|
209 |
|
|
210 |
public String getApplicationId();
|
|
211 |
|
|
212 |
/**
|
|
213 |
* Returns the root context resource, which is the starting point when looking for resources
|
|
214 |
* within the application.
|
|
215 |
*/
|
|
216 |
|
|
217 |
public Resource getContextRoot();
|
|
218 |
|
|
219 |
/**
|
|
220 |
* Returns an object used to access component meta-data properties.
|
|
221 |
*/
|
|
222 |
|
|
223 |
public ComponentPropertySource getComponentPropertySource();
|
|
224 |
|
|
225 |
/**
|
|
226 |
* Invoked when the locale for the current thread is changed.
|
|
227 |
*
|
|
228 |
* @see org.apache.tapestry.IEngine#setLocale(Locale)
|
|
229 |
*/
|
|
230 |
|
|
231 |
public void setLocale(Locale value); |
|
232 |
|
|
233 |
public String getOutputEncoding();
|
|
234 |
|
|
235 |
public MarkupWriterSource getMarkupWriterSource();
|
|
236 |
|
|
237 |
public HTMLDescriber getHTMLDescriber();
|
|
238 |
|
|
239 |
/**
|
|
240 |
* Responsible for presenting an exception error report to the user.
|
|
241 |
*/
|
|
242 |
|
|
243 |
public ExceptionPresenter getExceptionPresenter();
|
|
244 |
|
|
245 |
/**
|
|
246 |
* The source for {@link org.apache.tapestry.listener.ListenerMap}s, for components or other
|
|
247 |
* objects.
|
|
248 |
*/
|
|
249 |
|
|
250 |
public ListenerMapSource getListenerMapSource();
|
|
251 |
|
|
252 |
/**
|
|
253 |
* The service responsible for reporting {@link org.apache.tapestry.StaleSessionException}s.
|
|
254 |
*/
|
|
255 |
|
|
256 |
public StaleSessionExceptionPresenter getStaleSessionExceptionPresenter();
|
|
257 |
|
|
258 |
/**
|
|
259 |
* The service responsible for reporting {@link org.apache.tapestry.StaleLinkException}s.
|
|
260 |
*/
|
|
261 |
|
|
262 |
public StaleLinkExceptionPresenter getStaleLinkExceptionPresenter();
|
|
263 |
|
|
264 |
/**
|
|
265 |
* Service used to convert and coerce types.
|
|
266 |
*/
|
|
267 |
|
|
268 |
public ValueConverter getValueConverter();
|
|
269 |
|
|
270 |
/**
|
|
271 |
* Service (possibly a pipeline) that will invoke {@link org.apache.tapestry.IActionListener}
|
|
272 |
* objects.
|
|
273 |
*/
|
|
274 |
|
|
275 |
public ListenerInvoker getListenerInvoker();
|
|
276 |
} |
|