add anonymouse client RPC endpoint support

This commit is contained in:
Kelven Yang 2012-12-03 16:29:14 -08:00
parent 28db7981b9
commit d836b14a64
2 changed files with 13 additions and 4 deletions

View File

@ -27,7 +27,9 @@ public interface RpcProvider extends TransportMultiplexier {
void registerRpcServiceEndpoint(RpcServiceEndpoint rpcEndpoint);
void unregisteRpcServiceEndpoint(RpcServiceEndpoint rpcEndpoint);
RpcClientCall newCall(String sourceAddress, String targetAddress);
RpcClientCall newCall(TransportEndpoint sourceEndpoint, String targetAddress);
RpcClientCall newCall(String targetAddress);
void registerCall(RpcClientCall call);
void cancelCall(RpcClientCall call);

View File

@ -83,16 +83,23 @@ public class RpcProviderImpl implements RpcProvider {
}
@Override
public RpcClientCall newCall(String sourceAddress, String targetAddress) {
public RpcClientCall newCall(TransportEndpoint sourceEndpoint, String targetAddress) {
long callTag = getNextCallTag();
RpcClientCallImpl call = new RpcClientCallImpl(this);
call.setSourceAddress(sourceAddress);
call.setSourceAddress(sourceEndpoint.getEndpointAddress());
call.setTargetAddress(targetAddress);
call.setCallTag(callTag);
return call;
}
@Override
public RpcClientCall newCall(String targetAddress) {
// ???
return null;
}
@Override
public void registerCall(RpcClientCall call) {
assert(call != null);