Hessian source code analysis (1)------architecture

http://blog.csdn.net/cutesource/article/details/4944954

The external interaction of the billing center uses hessian, and it is necessary to analyze the operating mechanism and source code of hessian.

After roughly looking through the source code, I found that the main structure of hessian is divided into client and server, and the middle is based on http transmission. The main thing that the client does is to serialize the call to the remote interface into a stream and transmit it to the server; the main thing that the server does is to deserialize the transmitted stream into a request for the service, and then call the corresponding service and send the result. Serialized as a stream and returned to the client. A complete call is shown below:

HessianProxy is the core class for the hessian client to process client requests. It adopts the proxy design pattern to proxy the client's call to the remote interface. The sequence diagram of the main process of the hessian client is as follows:

  

HessianSkeleton is the core class of the hessian server. It serializes the methods and parameters called by the client from the input stream, calls the server service, and then returns the processing result to the client. The main process sequence diagram is as follows:

 


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325387683&siteId=291194637