-
Notifications
You must be signed in to change notification settings - Fork 5
/
toys.html
227 lines (178 loc) · 12.4 KB
/
toys.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!--
(c) 2005, 2009, 2010 ThoughtWorks Ltd. All rights reserved.
(c) 2015 ProxyToys Committers. All rights reserved.
The software in this package is published under the terms of the BSD
style license a copy of which has been included with this distribution in
the LICENSE.txt file.
Created on 07-May-2005
-->
<head>
<title>ProxyToys - Toys</title>
<link rel="stylesheet" type="text/css" href="style.css"/>
</head>
<body>
<div id="banner">
<a href="index.html"><img id="logo" src="logo.gif" alt="ProxyToys Logo"/></a>
<div id="title">Toys</div>
</div>
<div id="center" class="Content2Column">
<div id="content">
<!-- ************ -->
<h1 id="Decorating">Decorating Toy</h1>
<p>The <a href="apidocs/com/thoughtworks/proxy/toys/decorate/Decorating.html">Decorating Toy</a> is factory for
AOP-style proxies. Any method call is intercepted and can be decorated with an
<a href="apidocs/com/thoughtworks/proxy/toys/decorate/Decorator.html">Decorator</a> implementation. In
addition to method calls, you may also intercept the return of the call or any thrown exception. See the
<a href="apidocs/com/thoughtworks/proxy/toys/decorate/package-summary.html">package description</a> for
examples.</p>
<!-- ************ -->
<h1 id="Delegating">Delegating Toy</h1>
<p>The <a href="apidocs/com/thoughtworks/proxy/toys/delegate/Delegating.html">Delegating Toy</a> is a factory for
proxies, that delegate any call to another object. Depending on the operation mode of the proxy may the target object
implement the proxy type or may just have compatible methods. This is a very common pattern and the
<a href="apidocs/com/thoughtworks/proxy/toys/delegate/DelegatingInvoker.html">DelegatingInvoker</a> is a
base class for some other proxy toys implementations. See the
<a href="apidocs/com/thoughtworks/proxy/toys/delegate/package-summary.html">package description</a> for
examples.</p>
<!-- ************ -->
<h1 id="Dispatcher">Dispatching Toy</h1>
<p>The <a href="apidocs/com/thoughtworks/proxy/toys/dispatch/Dispatching.html">Dispatching Toy</a> is a factory for
proxies, dispatch incoming method calls to different object depending their implemented interfaces. Each proxy implements
several unrelated interfaces and contains a collection of target objects. Each method call is invoked on one target object
from this collection, that implements the interface of the calling method. Although the
<a href="apidocs/com/thoughtworks/proxy/toys/dispatch/DispatchingInvoker.html">DispatchingInvoker</a> is not
derived from a <a href="apidocs/com/thoughtworks/proxy/toys/delegate/DelegatingInvoker.html">DelegatingInvoker</a>
it utilizes this invoker internally. See the
<a href="apidocs/com/thoughtworks/proxy/toys/dispatch/package-summary.html">package description</a> for
examples.</p>
<!-- ************ -->
<h1 id="Echo">Echoing Toy</h1>
<p>The <a href="apidocs/com/thoughtworks/proxy/toys/echo/Echoing.html">Echo Toy</a> is a factory for
proxies, that implement a classical trace functionality. It implements just an own
<a href="apidocs/com/thoughtworks/proxy/toys/decorate/Decorator.html">Decorator</a>
(<a href="apidocs/com/thoughtworks/proxy/toys/echo/EchoDecorator.html">EchoDecorator</a>), that
simply writes every method call, the return value and every thrown exception to a
<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/io/PrintWriter.html">PrintWriter</a>. See the
<a href="apidocs/com/thoughtworks/proxy/toys/echo/package-summary.html">package description</a> for
examples.</p>
<!-- ************ -->
<h1 id="Failover">Failover Toy</h1>
<p>The <a href="apidocs/com/thoughtworks/proxy/toys/failover/Failover.html">Failover Toy</a> is a factory for
proxies, that implement a failover strategy. Each proxy has a pool of objects, that will be used one by one after a
predefined exception type for the current target object is thrown during a method invocation. The
<a href="apidocs/com/thoughtworks/proxy/toys/failover/FailoverInvoker.html">FailoverInvoker</a> is a subclass
of the <a href="apidocs/com/thoughtworks/proxy/toys/hotswap/HotSwappingInvoker.html">HotSwappingInvoker</a>.
See the
<a href="apidocs/com/thoughtworks/proxy/toys/failover/package-summary.html">package description</a> for
examples.</p>
<!-- ************ -->
<h1 id="Failover">Future Toy</h1>
<p>The <a href="apidocs/com/thoughtworks/proxy/toys/future/Future.html">Future Toy</a> is a factory for
proxies, that executes any method call asynchronously. The immediate returned object of such a call is itself a
<a href="apidocs/com/thoughtworks/proxy/toys/hotswap/HotSwapping.html">HotSwapping</a> proxy stuffed
with a <a href="apidocs/com/thoughtworks/proxy/toys/nullobject/Null.html">Null</a> object until the method
returns. The Null proxy is then hot swapped with the returned object. See the
<a href="apidocs/com/thoughtworks/proxy/toys/future/package-summary.html">package description</a> for
examples.</p>
<!-- ************ -->
<h1 id="HotSwap">HotSwapping Toy</h1>
<p>The <a href="apidocs/com/thoughtworks/proxy/toys/hotswap/HotSwapping.html">Hot Swapping Toy</a> is a
factory for proxies, that enable the transparent exchange of the target object for the method invocations. Each created
proxy implements the <a href="apidocs/com/thoughtworks/proxy/toys/hotswap/Swappable.html">Swappable</a>
interface, that is used to do the exchange. Other object that have a reference to a hot swapping proxy, will not notice
the internal change of the target object at all. The
<a href="apidocs/com/thoughtworks/proxy/toys/hotswap/HotSwappingInvoker.html">HotSwappingInvoker</a> is a
subclass of the <a href="apidocs/com/thoughtworks/proxy/toys/delegate/DelegatingInvoker.html">DelegatingInvoker</a>.
See the
<a href="apidocs/com/thoughtworks/proxy/toys/hotswap/package-summary.html">package description</a> for
examples.</p>
<!-- ************ -->
<h1 id="Multicast">Multicasting Toy</h1>
<p>The <a href="apidocs/com/thoughtworks/proxy/toys/multicast/Multicasting.html">Multicasting Toy</a> is a factory for
proxies, that will invoke a single method call on every object which they manage in a collection. The different return values
are collected and a new multicasting proxy is returned for the result collection. If the result of the invoked method is a
primitive type, the proxy will sum up all the results and return this sum as result of the invocation. It does not matter if
one of the target object in the collection does not have a method like the one invoked on the proxy, those objects are
simply ignored for the routed method invocation. Each multicasting proxy additionally implements the
<a href="apidocs/com/thoughtworks/proxy/toys/multicast/Multicast.html">Multicast</a> interface, that permits access
to the target object collection of such a proxy. See the
<a href="apidocs/com/thoughtworks/proxy/toys/multicast/package-summary.html">package description</a> for
examples.</p>
<!-- ************ -->
<h1 id="Null">Null Toy</h1>
<p>The <a href="apidocs/com/thoughtworks/proxy/toys/nullobject/Null.html">Null Toy</a> is a factory for
proxies, that work as dummy implementations. The proxy will ignore any called methods returning <tt>void</tt>,
will return the native <tt>null</tt> vale for all primitive types, will return a new Null proxy for all returned objects it
can create a new proxy for or simply <tt>null</tt>. See the
<a href="apidocs/com/thoughtworks/proxy/toys/nullobject/package-summary.html">package description</a> for
examples.</p>
<!-- ************ -->
<h1 id="Pool">Pool Toy</h1>
<p>The <a href="apidocs/com/thoughtworks/proxy/toys/pool/Pool.html">Pool Toy</a> is a simple pool implementation
based on proxies. Each pool is stuffed with a number of objects that are used as pool resources. Any object returned from
the pool is wrapped with a proxy, that implements the
<a href="apidocs/com/thoughtworks/proxy/toys/pool/Poolable.html">Multicast</a> interface, that can be used to return
the object to the pool. Additionally any of these objects will return automatically to the pool if their proxy instance is garbage
collected. Before an object is added again to the pool after usage, a user-defined
<a href="apidocs/com/thoughtworks/proxy/kit/Resetter.html">Resetter</a> instance may do any reinitializations
with such an object or may even decide to discard the object at all. See the
<a href="apidocs/com/thoughtworks/proxy/toys/pool/package-summary.html">package description</a> for
examples.</p>
<!-- ************ -->
<h1 id="Privileging">Privileging Toy</h1>
<p>The <a href="apidocs/com/thoughtworks/proxy/toys/privilege/Privileging.html">Privileging Toy</a> is a factory for
proxies, that execute any call as
<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/security/PrivilegedExceptionAction.html">privileged action</a>
by an <a href="apidocs/com/thoughtworks/proxy/toys/privilege/ActionExecutor.html">ActionExecutor</a> in a predefined
context. Such a context can be defined by an active
<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/SecurityManager.html">SecurityManager</a> that requires an
<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/security/ActionController.html">ActionController</a> or a JEE container
using different credentials to execute some functionality using a different
<a href="http://java.sun.com/j2se/1.5.0/docs/api/javax/security/auth/Subject.html">Subject</a>. See the
<a href="apidocs/com/thoughtworks/proxy/toys/privilege/package-summary.html">package description</a> for
examples.</p>
<br/><br/>
</div>
</div>
<div class="SidePanel" id="left">
<div class="MenuGroup">
<h1>ProxyToxy in General</h1>
<ul>
<li><a href="index.html">About ProxyToys</a></li>
<li><a href="news.html">News</a></li>
<li><a href="changes.html">Change History</a></li>
<li><a href="license.html">License</a></li>
<li><a href="download.html">Download</a></li>
<li><a href="versioning.html">About Versioning</a></li>
</ul>
</div>
<div class="MenuGroup">
<h1>Using ProxyToys</h1>
<ul>
<li><a href="tutorial.html">One minute Tutorial</a></li>
<li><a href="factories.html">Proxy Factories</a></li>
<li class="currentLink">Toys</li>
<li><a href="faq.html">Frequently Asked Questions</a></li>
<li><a href="example-code.html">Example Code</a></li>
<li><a href="mailing-lists.html">Mailing Lists</a></li>
<li><a href="apidocs/index.html">Javadoc</a></li>
<li><a href="issues.html">Reporting Issues</a></li>
</ul>
</div>
<div class="MenuGroup">
<h1>Developing ProxyToys</h1>
<ul>
<li><a href="architecture.html">Architecture Overview</a></li>
<li><a href="how-to-contribute.html">How to Contribute</a></li>
<li><a href="team.html">Development Team</a></li>
<li><a href="repository.html">Source Repository</a></li>
<li><a href="https://github.com/proxytoys/proxytoys">GitHub Project</a></li>
<li><a href="http://ci.codehaus.org/browse/PROXYTOYS">Build Status</a></li>
<li><a href="https://www.openhub.net/p/10075">Code Statistics</a></li>
</ul>
</div>
</div>
</body>
</html>