public class FusionInvoker
extends java.lang.Object
implements java.lang.reflect.InvocationHandler, java.io.Serializable
Example:
public interface IA {
public void f();
}
public interface IB {
public void g();
}
public class A implements IA {
public void f() {...}
}
public class B implements IB {
public void g() {...}
}
Then, you could fuse them together as follows:
Object obj = FusionInvoker.newInstance(new Object[] {new A(), new B()});
Thus, the fused proxy object, obj
, could be used as if
it implements IA
and IB
:
IA ia = (IA) obj;
ia.f();
IB ib = (IB) obj;
ib.g();
Modifier | Constructor and Description |
---|---|
protected |
FusionInvoker(java.lang.Object[] targets)
Use
newInstance(Object[]) instead. |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
invoke(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args) |
static java.lang.Object |
newInstance(java.lang.Object[] targets)
Creates an object that contains the all interfaces by wrapping giving
object, targets.
|
static java.lang.Object |
newInstance(java.lang.Object target1,
java.lang.Object target2)
Use for only two object, see
newInstance(Object[]) . |
protected FusionInvoker(java.lang.Object[] targets)
newInstance(Object[])
instead.public static java.lang.Object newInstance(java.lang.Object target1, java.lang.Object target2)
newInstance(Object[])
.public static java.lang.Object newInstance(java.lang.Object[] targets)
Usage shortcut: FusionInvoker.newInstance(new Object[] { Object a, Object b });
targets
- the objects need to wrappedpublic 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
Copyright © 2005-2018 Potix Corporation. All Rights Reserved.