Chapter 4. The POA interface

Table of Contents
Introduction
The POA mapping
More POA architecture
A real server : finally !!

Introduction

The POA (Portable Object Adapter) is an object which is visible from the server object only. While clients hold object references on which they invoke methods, the server object itself -the object which effectively implements the interesting methods- talks only to the POA. The ORB, the POA and the server skeleton all cooperate to decide to which function/code the client requests must be passed to.

Figure 4-1. The server structure

When the server is launched, it will first create a POA. Then, it will tell the POA about its servants (step 1) (servants are the IDL definitions' implementations we coded. In fact, the interface implementations). Then it will ask the POA for an object reference (step 2) which is then advertised to the outside world either with an IOR string (step 3)(we already saw this in chapter 2) or by binding this object reference to a name with the Naming Service.

Figure 4-2. The server registration

When the client is launched, it will first ask the Name Service about some object reference by using the CosNaming::NamingContext::Resolve method (step 1). Then, it will be able to invoke some distant object's method through the object reference. This is possible because the object reference is an opaque structure which holds enough information to locate the server. This invocation is passed to the ORB by the client through the stub (step 2). Once the ORB has found the correct server (thanks to the object reference), it hands the request to the server.

Figure 4-3. A client request : 1

The server then locates the POA which created the Object reference (thanks once more to the information contained in the object reference) and passes the request (step 2) to the POA. The request is finally passed to the correct servant by the POA (step 3).

Figure 4-4. A client request : 2

Hopefully, the client does not really care about all this stuff which is taken care of by the ORB. The client only sees an object reference. The server only sees the POA: none of them cares about the other. We have already seen how the client handles object references. Now, it is time to get hands dirty about the server stuff.