1 |
| |
2 |
| |
3 |
| |
4 |
| |
5 |
| |
6 |
| |
7 |
| |
8 |
| |
9 |
| |
10 |
| |
11 |
| |
12 |
| |
13 |
| |
14 |
| |
15 |
| package org.apache.tapestry.services.impl; |
16 |
| |
17 |
| import java.io.IOException; |
18 |
| import java.io.Serializable; |
19 |
| |
20 |
| import org.apache.hivemind.util.Defense; |
21 |
| import org.apache.tapestry.IRequestCycle; |
22 |
| import org.apache.tapestry.engine.IEngineService; |
23 |
| import org.apache.tapestry.engine.ILink; |
24 |
| |
25 |
| |
26 |
| |
27 |
| |
28 |
| |
29 |
| |
30 |
| |
31 |
| |
32 |
| |
33 |
| |
34 |
| public class EngineServiceInnerProxy implements IEngineService, Serializable |
35 |
| { |
36 |
| private static final long serialVersionUID = -8128030027597659447L; |
37 |
| |
38 |
| private final String _serviceName; |
39 |
| |
40 |
| private final EngineServiceOuterProxy _outerProxy; |
41 |
| |
42 |
| private final EngineServiceSource _source; |
43 |
| |
44 |
304
| public EngineServiceInnerProxy(String serviceName, EngineServiceOuterProxy outerProxy,
|
45 |
| EngineServiceSource source) |
46 |
| { |
47 |
304
| Defense.notNull(serviceName, "serviceName");
|
48 |
304
| Defense.notNull(outerProxy, "outerProxy");
|
49 |
304
| Defense.notNull(source, "source");
|
50 |
| |
51 |
304
| _serviceName = serviceName;
|
52 |
304
| _outerProxy = outerProxy;
|
53 |
304
| _source = source;
|
54 |
| } |
55 |
| |
56 |
2
| public String toString()
|
57 |
| { |
58 |
2
| return ImplMessages.engineServiceInnerProxyToString(_serviceName);
|
59 |
| } |
60 |
| |
61 |
244
| private IEngineService resolve()
|
62 |
| { |
63 |
244
| IEngineService service = _source.resolveEngineService(_serviceName);
|
64 |
| |
65 |
242
| _outerProxy.installDelegate(service);
|
66 |
| |
67 |
242
| return service;
|
68 |
| } |
69 |
| |
70 |
138
| public synchronized ILink getLink(boolean post, Object parameter)
|
71 |
| { |
72 |
138
| return resolve().getLink(post, parameter);
|
73 |
| } |
74 |
| |
75 |
106
| public synchronized void service(IRequestCycle cycle) throws IOException
|
76 |
| { |
77 |
106
| resolve().service(cycle);
|
78 |
| } |
79 |
| |
80 |
2
| public String getName()
|
81 |
| { |
82 |
2
| return _serviceName;
|
83 |
| } |
84 |
| |
85 |
| } |