Using single RMI Registry

后端 未结 5 770
被撕碎了的回忆
被撕碎了的回忆 2021-01-02 14:53

I\'ve been using RMI for a project I am currently working on and I want to bind from multiple hosts to a single RMI registry.

However when I attempt to do so I get a

5条回答
  •  [愿得一人]
    2021-01-02 15:25

    There's a way to get around the limitation but it is what it is: a work-around. Anyway, feel free to try it out. It works for us.

    On the host that is running the central RMI registry run a small service which will bind a remote object with just one remote method: proxyRebind. The implementation of this method simply binds the object that is supplied to it in the central registry (this would not fail because the registry is on the same machine as this service).

    All other hosts would simply lookup this remote object and invoke proxyRebind with their own remote objects.

    This works because look-up on remotely hosted registries is allowed. Your original attempt failed because binding on remotely hosted registries is not allowed.

    Let me know if you need any further clarity on this.

    /RS

提交回复
热议问题