Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||||
ResponseContributor |
|
| 1.0;1 |
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 | package org.apache.tapestry.services; |
|
15 | ||
16 | import java.io.IOException; |
|
17 | ||
18 | import org.apache.tapestry.IRequestCycle; |
|
19 | ||
20 | ||
21 | /** |
|
22 | * Determines if the particular incoming ajax request is handled by this |
|
23 | * contributor/library response type. If it is will also provide an instance |
|
24 | * of the appropriate ResponseBuilder. |
|
25 | * |
|
26 | * @author jkuhnert |
|
27 | */ |
|
28 | public interface ResponseContributor { |
|
29 | ||
30 | /** |
|
31 | * Determines if the incoming ajax request is capable of being |
|
32 | * handled by the {@link ResponseBuilder} this contributor |
|
33 | * manages. |
|
34 | * |
|
35 | * @param cycle |
|
36 | * Main request cycle for this request. |
|
37 | * @return True if can handle request, false otherwise. |
|
38 | */ |
|
39 | boolean handlesResponse(IRequestCycle cycle); |
|
40 | ||
41 | /** |
|
42 | * Creates the appropriate {@link ResponseBuilder} instance to handle the |
|
43 | * incoming ajax request. |
|
44 | * |
|
45 | * @param cycle |
|
46 | * The incoming request cycle for this request. |
|
47 | * |
|
48 | * @return A newly created response builder. |
|
49 | */ |
|
50 | ResponseBuilder createBuilder(IRequestCycle cycle) |
|
51 | throws IOException; |
|
52 | } |