that we have our interface and value objects
firmly in place, it’s time to move on to the main
ContextImpl is our implementation of
implementation uses two delegate objects to
actually maintain the indexes, along with a
special-purpose object used to associate a name
AttributeSet. That is, our
Context really consists of the
following four objects:
Context interface. It has very little
direct state, a reference to
ContextHolder and a
RemoteHolder, and is completely
unsynchronized. Its role is to implement the
interface by forwarding method calls to the
appropriate object, either a subcontext or one of
the two delegates.
This is a delegate object whose role is to hold, and index, direct subcontexts. All of its methods are synchronized.
This is a delegate object whose role is to hold, and index, locally contained references to servers. All of its methods are synchronized.
is a class that combines a name and an attribute
set in an indexable object. It also implements the
interface so that it can be used by
The runtime structure looks something like Figure 15-7.
Figure 15-7. The runtime structure
Let’s look at each of these objects in a little more detail.