- 执行顺序
- 在客户端的执行顺序
- 在服务器端的执行顺序
执行顺序
不论是客户端,还是服务器,都可以添加多个过滤器。假设我们按照添加的顺序把它们叫做 filter1
, filter2
, … filterN
。那么它们的执行顺序是这样的。
在客户端的执行顺序
+------------------- OutputFilter -------------------+
| +-------+ +-------+ +-------+ |
| |filter1|----->|filter2|-----> ... ----->|filterN| |---------+
| +-------+ +-------+ +-------+ | v
+----------------------------------------------------+ +---------------+
| Hprose Server |
+-------------------- InputFilter -------------------+ +---------------+
| +-------+ +-------+ +-------+ | |
| |filter1|<-----|filter2|<----- ... <-----|filterN| |<--------+
| +-------+ +-------+ +-------+ |
+----------------------------------------------------+
在服务器端的执行顺序
+-------------------- InputFilter -------------------+
| +-------+ +-------+ +-------+ |
+-------->| |filterN|-----> ... ----->|filter2|----->|filter1| |
| | +-------+ +-------+ +-------+ |
+---------------+ +----------------------------------------------------+
| Hprose Client |
+---------------+ +------------------- OutputFilter -------------------+
^ | +-------+ +-------+ +-------+ |
+---------| |filterN|<----- ... <-----|filter2|<-----|filter1| |
| +-------+ +-------+ +-------+ |
+----------------------------------------------------+