public class MultiplexInvocationHandler<T>
extends java.lang.Object
implements java.lang.reflect.InvocationHandler
Constructor and Description |
---|
MultiplexInvocationHandler(T[] targets)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
T |
createMultiplexer(java.lang.Class<T> clazz)
Returns a new proxy instance which implements the given interface type,
and which uses this handler to execute its methods.
|
T[] |
getTargets()
Returns the list of delegate implementations.
|
java.lang.Object |
invoke(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args)
Invokes a method by invoking the same method on each of this
handler's target instances.
|
void |
setTargets(T[] targets)
Sets the list of delegate implementations.
|
public MultiplexInvocationHandler(T[] targets)
targets
- target instancespublic void setTargets(T[] targets)
targets
- target instancespublic T[] getTargets()
public java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args) throws java.lang.Throwable
invoke
in interface java.lang.reflect.InvocationHandler
java.lang.Throwable