public class FusionInvoker extends Object implements InvocationHandler, 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(Object[] targets)
Use
newInstance(Object[]) instead. |
| Modifier and Type | Method and Description |
|---|---|
Object |
invoke(Object proxy,
Method method,
Object[] args) |
static Object |
newInstance(Object[] targets)
Creates an object that contains the all interfaces by wrapping giving
object, targets.
|
static Object |
newInstance(Object target1,
Object target2)
Use for only two object, see
newInstance(Object[]). |
protected FusionInvoker(Object[] targets)
newInstance(Object[]) instead.public static Object newInstance(Object target1, Object target2)
newInstance(Object[]).public static Object newInstance(Object[] targets)
Usage shortcut: FusionInvoker.newInstance(new Object[] { Object a, Object b });
targets - the objects need to wrappedCopyright © 2018. All rights reserved.