- if(rpcType == null) {
- throw new IllegalArgumentException("rpcType must not be null");
- }
- if(implementation == null) {
- throw new IllegalArgumentException("Implementation must not be null");
- }
- broker.addRpcImplementation(rpcType, implementation);
- rpcImpls.put(rpcType, implementation);
-
- return new RpcRegistrationImpl(rpcType, implementation, this);
+ val origReg = broker.router.addRpcImplementation(rpcType, implementation);
+ val newReg = new RpcRegistrationWrapper(origReg);
+ registrations.add(newReg);
+ return newReg;