We already covered two important built-in Babel RMI functions in Section 15.2.3. They were the _create[Remote] and _connect static built-in functions, which remotely create an object or connect to an already existing remote object respectively.
There are three other important RMI related built-in functions that a user may find useful. The first two are related:
_isLocal() and _isRemote() are opposites. _isRemote() returns TRUE if the object it is called on is a remote object. _isLocal(), on the other hand, returns TRUE if the object is implemented locally.
Many Babel RMI users will never need these functions. If you don't care where an object exists, or you already know statically, these methods are totally superfluous. However, since calls on remote objects have serious performance implications, we included these functions for convenience.
There is one other important RMI related built-in:
This function returns the URL of the object it is called on. This is straight forward for Remote objects, but for local objects it may have some interesting side effects. First, if there is no BOS running locally, no local objects can be exported remotely. Therefore no local object will have a URL. In this case _getURL() returns NULL. However, if there is a BOS running, then local object may have a URL. In this case, if the object has already been exported, _getURL() will return the URL in the sidl.rmi.InstanceRegistry, if the object is not in the InstanceRegistry, Babel will add it, thereby automatically generating a URL for the object. To reiterate, a possible side-effect of calling _getURL() is that the object it is called on my be added to the InstanceRegistry.