Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
ListenerMethodInvoker |
|
| 1.0;1 |
1 | // Copyright 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.listener; | |
16 | ||
17 | import org.apache.tapestry.IRequestCycle; | |
18 | ||
19 | /** | |
20 | * An object, used by a {@link org.apache.tapestry.listener.ListenerMap}, to | |
21 | * match requests (possibly with service parameters) to methods (possibly with | |
22 | * arguments). Given a request, a (possibly null or empty) array of service | |
23 | * parameters, and a target object (and its set of public void methods), the | |
24 | * mapping will search for the mostly likely mapping. In order: | |
25 | * <ul> | |
26 | * <li>public void method(params) (where the method takes the same number of | |
27 | * parameters as there are service parameters) | |
28 | * <li>public void method(IRequestCycle, params) | |
29 | * <li>public void method() | |
30 | * <li>public void method(IRequestCycle) | |
31 | * </ul> | |
32 | * | |
33 | * @author Howard M. Lewis Ship | |
34 | * @since 4.0 | |
35 | */ | |
36 | public interface ListenerMethodInvoker | |
37 | { | |
38 | ||
39 | /** | |
40 | * Called to invoke the bound listener method. | |
41 | * | |
42 | * @param target The object to call the listener method on. | |
43 | * @param cycle The associated request. | |
44 | */ | |
45 | void invokeListenerMethod(Object target, IRequestCycle cycle); | |
46 | ||
47 | /** | |
48 | * The actual method name that this listener represents. | |
49 | * | |
50 | * @return The method name this listener is bound to. | |
51 | */ | |
52 | String getMethodName(); | |
53 | } |