When links fail
In a distributed environment communications are always prone to failure.
Here is how Beatrix helps us deal with failed links, and what our
applications need to add to this:
- The ICommunicationServer interface allows connection failures
to be handled, as already mentioned. This is server-side only.
- The default proxying access point netlet recognises a server failure
and re-establishes communications with another.
- When we have an INetletHandle we can add a connection listener
which gets called when our link to that netlet fails. INetletHandle
is available client-side and server-side--see Figure ![[*]](crossref.png) . .
- If a Beatrix netlet binds a service with a warrant and later the link
fails, then Beatrix will try to rebind the warrant automatically.
However, even with this last feature there is usually more we need
to do. In particular, Beatrix will not rebind any facets we have already
bound as part of the service; using of any of these facets will result
in an error thrown (org.jtrix.base.InternalError,
a subclass of java.lang.Error). If we detect a connection
failure then we might like to take some appropriate action with the
unconnected facets.
As an example, a default access point netlet takes each service facet
and wraps it. When it detects a link failure (via an INetletHandle
listener) it binds a new facet. The client only accesses the wrapper
and so does not detect any changes.
Nik Silver
2002-03-09