Providing an IService

A big point of interest is the bindService() method of INetlet. We'll ignore its parameters for now, but let's have a look at IService itself (Section [*]). It's just a collection of facets which can be terminated together. So any IService interface has to implement the following methods. Note these are described from an implementor's point of view, not a client's point of view:

Notice that these three methods appear not only in the IService interface, but also in the INetlet interface. However, let's not confuse them. Each method does the same sort of thing in both interfaces, but they're used in completely different contexts. The INetlet interface is presented to a node, so it can talk to the netlet, and so there the methods offer facets to the node, and respond to netlet termination from the node. But the IService interface is presented to another netlet, making a service connection, and so there the methods offer facets to the other netlet and respond to a termination of the service connection.

If you didn't get all that, it's worth reviewing. An IService interface represents a service connection to another netlet. The INetlet interface is how the netlet presents itself to its node.

In particular, a call to INetlet.terminate() means ``This netlet is about to terminate'', but a call to IService.terminate() means ``The other netlet has terminated its connection to you''. In that latter case perhaps other netlets are still using us and we'd want to keep on running.

But in our current little example, if the client netlet terminates its connection with us then we no longer serve a purpose and our access point netlet will ask the node to put us out of our misery.

Nik Silver 2002-03-09