next up previous contents
Next: Implementation of the Prototype Up: Conclusions Previous: Repository

Example of Adaptation Process

For illustrating the role of the adaptation elements described above this section presents an example for executing the method of an adaptable class. The adaptable class is described by a functionality interface IMemory which declares the method getPhysicalMemory() retrieving the size of the installed memory of a host. The functionality interface is supported by a set of implementation classes for different environments.

The adaptor class IMemory_Adaptor is generated out of the functionality interface and used in the core for accessing the implementation classes. It is assumed that the core is running on a x86 host with Windows NT and no implementation class is yet loaded by the adaptor class.


 
Figure: Steps of adaptation process  

Following steps are performed by the adaptation mechanism for executing the implementation method getPhysicalMemory() provided by a suitable implementation class (s. figure [*]).

Step 1
The core invokes the method getPhysicalMemory() offered by the adaptor class IMemory_Adaptor.
Step 2
Since no implementation class is yet available, the adaptor class contacts the adaptation class to load the suitable implementation class supporting the functionality interface IMemory.
Step 3
The class loader of the adaptation class requests the implementation class name from the context awareness mechanism.
Step 4
For resolving the right implementation class name the context awareness needs the profiles of all implementation class belonging to the implementation group IMemory. Therefore the context awareness retrieves the profiles from the repository through the repository client.
Step 5
The repository collects all profiles from the implementation group IMemory out of the implementation classes and sends them back to the context awareness via the repository client. The context awareness obtains the profiles, executes them and returns the right implementation class name to the loader.
Step 6
The loader requests the suitable implementation class Memory_WINNT_X86 from the repository via the repository client.
Step 7
The repository sends the implementation class to the loader through the repository client. The loader returns the implementation class to the adaptor class, which instantiates the class and executes the method getPhysicalMemory().

If further methods of the class IMemory_Adaptor declared in the functionality interface IMemory are invoked by the core, the adaptor class can directly delegate the method calls to the implementation class Memory_WINNT_X86. A new adaptation process is necessary if the core moves to a new host.



 
next up previous contents
Next: Implementation of the Prototype Up: Conclusions Previous: Repository
Copyright Munich Network Management Team