public class RPCTargetSwitcher extends java.lang.Object implements RPCInvokeStrategy
构造器和说明 |
---|
RPCTargetSwitcher() |
限定符和类型 | 方法和说明 |
---|---|
java.lang.Object |
invoke(ClusterInvoker invoker,
java.lang.Object localTarget,
Invocation invocation,
RemoteResultHandler remoteHandler)
定义调用策略
例:
public Object invoke(ClusterInvoker invoker, Object localTarget, Invocation invocation, RemoteResultHandler remoteHandler) throws Throwable {
Object result = invocation.getMethod().invoke(localTarget);
invoker.invokeAll(invocation, RemoteResultHandlerHelper.newAdaptor(remoteHandler));
return result;
}
|
void |
setInvokeAll() |
void |
setTarget(java.lang.String nodeID) |
public java.lang.Object invoke(ClusterInvoker invoker, java.lang.Object localTarget, Invocation invocation, RemoteResultHandler remoteHandler) throws java.lang.Throwable
RPCInvokeStrategy
invoke
在接口中 RPCInvokeStrategy
java.lang.Throwable
public void setTarget(java.lang.String nodeID)
public void setInvokeAll()