1818 */
1919package org .apache .cloudstack .framework .messaging ;
2020
21- public class ComponentEndpoint implements RpcEndpoint , TransportMultiplexier , Subscriber {
22-
21+ public class ComponentEndpoint implements RpcEndpoint , Subscriber {
2322 private TransportEndpoint transportEndpoint ;
2423 private RpcProvider rpcProvider ;
2524
@@ -42,44 +41,33 @@ public void setRpcProvider(RpcProvider rpcProvider) {
4241 this .rpcProvider = rpcProvider ;
4342 }
4443
45- public void initialize (String [] multiplexiers ) {
46- if (multiplexiers != null ) {
47- for (String name : multiplexiers )
48- transportEndpoint .registerMultiplexier (name , this );
49- }
50-
44+ public void initialize () {
5145 rpcProvider .registerRpcEndpoint (this );
5246 }
5347
54- @ Override
55- public void onTransportMessage (String senderEndpointAddress ,
56- String targetEndpointAddress , String multiplexer , String message ) {
57- }
58-
59- @ Override
60- public String call (String targetAddress , String rpcMessage )
48+ // it will throw RpcRuntimeException in case of transport
49+ public String call (RpcCallContext callContext , String targetAddress , String command , Object cmdArg )
6150 {
62- return null ;
51+ return rpcProvider . call ( this , callContext , targetAddress , command , cmdArg ) ;
6352 }
6453
65- @ Override
66- public RpcCall asyncCall (String targetAddress , String rpcMessage ) {
67- return null ;
54+ public RpcClientCall asyncCall (RpcCallContext callContext , String targetAddress , String command , Object cmdArg ) {
55+ return rpcProvider .asyncCall (this , callContext , targetAddress , command , cmdArg );
6856 }
6957
7058 @ Override
71- public void onCallReceive (RpcCall call ) {
59+ public void onCallReceive (RpcServerCall call ) {
7260 // TODO Auto-generated method stub
7361 // implement annotation based call dispatching
7462 }
7563
7664 @ Override
77- public void onCallReturn (RpcCall call , String rpcReturnMessage , RpcException e ) {
65+ public void onCallReturn (RpcClientCall call , Object returnObject , RpcException e ) {
7866 // ???
7967 }
8068
8169 @ Override
82- public void onPublishEvent (String subject , String senderAddress , String args ) {
70+ public void onPublishEvent (String subject , String senderAddress , Object args ) {
8371 // TODO
8472 }
8573}
0 commit comments