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 |
|
public EngineServiceInnerProxy(String serviceName, EngineServiceOuterProxy outerProxy, |
45 |
|
EngineServiceSource source) |
46 |
10 |
{ |
47 |
10 |
Defense.notNull(serviceName, "serviceName"); |
48 |
10 |
Defense.notNull(outerProxy, "outerProxy"); |
49 |
10 |
Defense.notNull(source, "source"); |
50 |
|
|
51 |
10 |
_serviceName = serviceName; |
52 |
10 |
_outerProxy = outerProxy; |
53 |
10 |
_source = source; |
54 |
10 |
} |
55 |
|
|
56 |
|
public String toString() |
57 |
|
{ |
58 |
1 |
return ImplMessages.engineServiceInnerProxyToString(_serviceName); |
59 |
|
} |
60 |
|
|
61 |
|
private IEngineService resolve() |
62 |
|
{ |
63 |
8 |
IEngineService service = _source.resolveEngineService(_serviceName); |
64 |
|
|
65 |
7 |
_outerProxy.installDelegate(service); |
66 |
|
|
67 |
7 |
return service; |
68 |
|
} |
69 |
|
|
70 |
|
public synchronized ILink getLink(boolean post, Object parameter) |
71 |
|
{ |
72 |
2 |
return resolve().getLink(post, parameter); |
73 |
|
} |
74 |
|
|
75 |
|
public synchronized void service(IRequestCycle cycle) throws IOException |
76 |
|
{ |
77 |
6 |
resolve().service(cycle); |
78 |
5 |
} |
79 |
|
|
80 |
|
public String getName() |
81 |
|
{ |
82 |
1 |
return _serviceName; |
83 |
|
} |
84 |
|
|
85 |
|
} |