What Is Multihomed Host in Java?

A multihomed host is a computer or other hardware that maintains more than one IP address. Having multiple IP addresses isn't unusual because the address relates to the Internet interface, not the machine: A computer that has both an Ethernet and a Wi-Fi Internet connection has a different IP address for each interface. Using a multihomed computer can affect how Java Virtual Machines interact with each other.

  1. RMI

    • Remote Method Invocation is a Java application programming interface that helps Java virtual machines -- Java-based computing platforms -- make use of each others' software. If a developer installs her own program on a Java machine, she can share it with other developers and provide them with any updates she makes, but that can take a lot of time. RMI makes it easier: Once she installs the updates in the Web directory, RMI enables the other virtual machines to get the updates without the developer doing any further work.

    Invoking

    • To interact with a remote object -- a piece of software hosted on another Java machine -- using RMI, the first step is usually to connect with a "stub" in an RMI registry. The stub contains identifying data for the host machine holding the remote object, for the port on that host where RMI takes requests to access the object, and for the object itself. It also contains a socket factory, which is an RMI program that controls how Java virtual machines connect to the object.

    Multihomes and RMI

    • When RMI tries to recover an object from a multihome host, the process gets more complicated. If the RMI on your Java machine identifies your computer's Wi-Fi address as the host, computers connected to you in an Ethernet network can't use RMI to access anything on your computer. You can set RMI so that it offers the Intranet address, but if you want other virtual machines to access yours by both Wi-Fi and Ethernet RMI capability, that still isn't the right setup.

    Solutions

    • To make RMI usable no matter how other computers connect to your host, use the socket factory to control the connection. Using a Java variable called ThreadLocal, you can give the socket factory an IP address that all computers using RMI must connect to. You can also set Java so that it provides other computers with a list of all possible host names -- all the IP addresses on your network -- and selects the correct one from that list.

Related Searches:

References

Resources

Comments

Related Ads

Featured