public class Multicasting
extends java.lang.Object
com.thoughtworks.proxy.toys.multicast
Modifier and Type | Method and Description |
---|---|
static java.lang.Object |
object(java.lang.Class[] types,
ProxyFactory proxyFactory,
java.lang.Object[] targets)
Generate a proxy for the specified types calling the methods on the given targets.
|
static java.lang.Object |
object(java.lang.Class type,
ProxyFactory proxyFactory,
java.lang.Object[] targets)
Generate a proxy for the specified type calling the methods on the given targets.
|
static java.lang.Object |
object(java.lang.Object[] targets)
Generate a proxy that is calling the methods on the given targets using a
StandardProxyFactory . |
static java.lang.Object |
object(ProxyFactory proxyFactory,
java.lang.Object[] targets)
Generate a proxy that is calling the methods on the given targets.
|
public static java.lang.Object object(java.lang.Class[] types, ProxyFactory proxyFactory, java.lang.Object[] targets)
Note, that the method will only return a proxy if necessary. If there is only one target instance and this instance implements all of the specified types, then there is no point in creating a proxy.
types
- the types that are implemented by the proxyproxyFactory
- the ProxyFactory
to usetargets
- the target objectsMulticast
or the only targetpublic static java.lang.Object object(java.lang.Class type, ProxyFactory proxyFactory, java.lang.Object[] targets)
Note, that the method will only return a proxy if necessary. If there is only one target instance and this instance implements the specified type, then there is no point in creating a proxy.
type
- the type that is implemented by the proxyproxyFactory
- the ProxyFactory
to usetargets
- the target objectsMulticast
or the only targetpublic static java.lang.Object object(ProxyFactory proxyFactory, java.lang.Object[] targets)
The type of the proxy is a combination of all interfaces implemented by all targets and their most common super
class (if supported by the ProxyFactory
). Note, that the method will only return a proxy if necessary.
If there is only one target instance, then there is no point in creating a proxy.
proxyFactory
- the ProxyFactory
to usetargets
- the target objectsMulticast
or the only targetpublic static java.lang.Object object(java.lang.Object[] targets)
StandardProxyFactory
.
The type of the proxy is a combination of all interfaces implemented by all targets. Note, that the method will only return a proxy if necessary. If there is only one target instance, then there is no point in creating a proxy.
targets
- the target objectsMulticast
or the only target