|
|||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
IEngineService.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.engine; | |
16 | ||
17 | import java.io.IOException; | |
18 | ||
19 | import org.apache.tapestry.IRequestCycle; | |
20 | ||
21 | /** | |
22 | * A service, provided by the {@link org.apache.tapestry.IEngine}, for its pages and/or components. | |
23 | * Services are responsible for constructing {@link EngineServiceLink}s (an encoding of URLs) to | |
24 | * represent dynamic application behavior, and for parsing those URLs when a subsequent request | |
25 | * involves them. | |
26 | * | |
27 | * @see org.apache.tapestry.IEngine#getService(String) | |
28 | * @author Howard Lewis Ship | |
29 | */ | |
30 | ||
31 | public interface IEngineService | |
32 | { | |
33 | /** | |
34 | * Builds a URL for a service. This is performed during the rendering phase of one request cycle | |
35 | * and bulds URLs that will invoke activity in a subsequent request cycle. | |
36 | * <p> | |
37 | * <b>This method changed incompatibly between release 3.0 and release 4.0. </b> | |
38 | * </p> | |
39 | * | |
40 | * @param cycle | |
41 | * Defines the request cycle being processed. | |
42 | * @param post | |
43 | * if true, then the link will be used for a post (not a get, i.e., for a HTML form); | |
44 | * this may affect what information is encoded into the link | |
45 | * @param parameter | |
46 | * An object that provide any additional information needed by the service. Each | |
47 | * service implementation will expect that an object of the proper type be passed in. | |
48 | * In some cases, a simple String will do; in others, a specific object (possibly | |
49 | * implementing an interface) will be required. | |
50 | * @return The URL for the service. The URL will have to be encoded via | |
51 | * {@link javax.servlet.http.HttpServletResponse#encodeURL(java.lang.String)}. | |
52 | */ | |
53 | ||
54 | public ILink getLink(IRequestCycle cycle, boolean post, Object parameter); | |
55 | ||
56 | /** | |
57 | * Perform the service, interpreting the URL (from the | |
58 | * {@link javax.servlet.http.HttpServletRequest}) responding appropriately, and rendering a | |
59 | * result page. | |
60 | * | |
61 | * @param cycle | |
62 | * the incoming request | |
63 | * @see org.apache.tapestry.IEngine#service(org.apache.tapestry.request.RequestContext) | |
64 | */ | |
65 | ||
66 | public void service(IRequestCycle cycle) throws IOException; | |
67 | ||
68 | /** | |
69 | * Returns the name of the service. | |
70 | * | |
71 | * @since 1.0.1 | |
72 | */ | |
73 | ||
74 | public String getName(); | |
75 | } |
|