Early versions of the CORBA object adapter (the Basic Object Adapter, or
BOA) did not permit portable object server code. A new specification was developed by the OMG to address these issues and the
Portable Object Adapter (POA) was created.
In basic terms, the POA (and its components) determine which servant should be invoked when a client request is received, and then invokes that servant. A servant is a programming object that provides the implementation of an
abstract object. A servant is not a CORBA object.
One POA (called the rootPOA) is supplied by each VisiBroker ORB. You can create additional POAs and configure them with different behaviors. You can also define the characteristics of the objects the POA controls.
You can obtain a reference to the root POA by using resolve_initial_references which returns a value of type
CORBA::Object. You are responsible for narrowing the returned object reference to the desired type, which is
PortableServer::POA in the above example.
The root POA has a predefined set of policies that cannot be changed. A policy is an object that controls the behavior of a POA and the objects the POA manages. If you need a different behavior, such as different lifespan policy, you will need to create a new POA.
POAs are created as children of existing POAs using create_POA. You can create as many POAs as you think are required.
The AccountManager implementation must be created and activated in the server code. In this example, AccountManager is activated with activate_object_with_id, which passes the object ID to the
Active Object Map where it is recorded. The Active Object Map is simply a table that maps IDs to servants. This approach ensures that this object is always available when the POA is active and is called
explicit object activation.
The last step is to activate the POA Manager associated with your POA. By default, POA Managers are created in a holding state. In this state, all requests are routed to a holding queue and are not processed. To allow requests to be dispatched, the
POA Manager associated with the POA must be changed from the holding state to an active state. A POA Manager is simply an object that controls the state of the POA (whether requests are queued, processed, or discarded.) A POA Manager is associated with a POA during POA creation. You can specify a POA Manager to use, or let the system create a new one for you by passing a
null value as the POA Manager name in
create_POA()).
A complete discussion of object activation is in “Using POAs” For now, just be aware that there are several means for activating objects.