Is it possible to interrupt a Java RMI call?

后端 未结 4 2082
旧时难觅i
旧时难觅i 2021-02-08 02:18

We\'re doing some prototyping work and we\'re wondering if it is possible to interrupt a thread that performed an RMI call. If we call interrupt() on this thread, would it throw

4条回答
  •  醉酒成梦
    2021-02-08 02:57

    This seems to be a RMI missing feature.

    You might however implement your own socket factory to be used by RMI and timeout the sockets. I remember some of my friends were doing it manually, but I just found Interruptiblermi library that addresses this issue automatically. Give it a try and please tell us how it performs.

提交回复
热议问题