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 |
| |
19 |
| import org.apache.hivemind.util.Defense; |
20 |
| import org.apache.tapestry.IRequestCycle; |
21 |
| import org.apache.tapestry.engine.IEngineService; |
22 |
| import org.apache.tapestry.engine.ILink; |
23 |
| |
24 |
| |
25 |
| |
26 |
| |
27 |
| |
28 |
| |
29 |
| |
30 |
| |
31 |
| |
32 |
| |
33 |
| public class EngineServiceInnerProxy implements IEngineService |
34 |
| { |
35 |
| private final String _serviceName; |
36 |
| |
37 |
| private final EngineServiceOuterProxy _outerProxy; |
38 |
| |
39 |
| private final EngineServiceSource _source; |
40 |
| |
41 |
151
| public EngineServiceInnerProxy(String serviceName, EngineServiceOuterProxy outerProxy,
|
42 |
| EngineServiceSource source) |
43 |
| { |
44 |
151
| Defense.notNull(serviceName, "serviceName");
|
45 |
151
| Defense.notNull(outerProxy, "outerProxy");
|
46 |
151
| Defense.notNull(source, "source");
|
47 |
| |
48 |
151
| _serviceName = serviceName;
|
49 |
151
| _outerProxy = outerProxy;
|
50 |
151
| _source = source;
|
51 |
| } |
52 |
| |
53 |
1
| public String toString()
|
54 |
| { |
55 |
1
| return ImplMessages.engineServiceInnerProxyToString(_serviceName);
|
56 |
| } |
57 |
| |
58 |
121
| private IEngineService resolve()
|
59 |
| { |
60 |
121
| IEngineService service = _source.resolveEngineService(_serviceName);
|
61 |
| |
62 |
120
| _outerProxy.installDelegate(service);
|
63 |
| |
64 |
120
| return service;
|
65 |
| } |
66 |
| |
67 |
68
| public synchronized ILink getLink(IRequestCycle cycle, boolean post, Object parameter)
|
68 |
| { |
69 |
68
| return resolve().getLink(cycle, false, parameter);
|
70 |
| } |
71 |
| |
72 |
53
| public synchronized void service(IRequestCycle cycle) throws IOException
|
73 |
| { |
74 |
53
| resolve().service(cycle);
|
75 |
| } |
76 |
| |
77 |
1
| public String getName()
|
78 |
| { |
79 |
1
| return _serviceName;
|
80 |
| } |
81 |
| |
82 |
| } |