Portable Object Adapter (POA)

The Portable Object Adapter (POA) is a functionally rich API for writing portable object implementations. The ORB provides support for all the POA policies defined in CORBA 2.2. You can write your object interfaces using either IDL or Java RMI. In addition, the ORB also provides support for local (no marshaling) invocations as well as an Novell proprietary POA SecurityPolicy for specifying custom authentication, and Quality of Protection.
POA Concepts
This section contains excerpts from the POA specification. It will familiarize you with POA concepts like POA, Policies, POA Manager, Servant, Servant Manager, and Object and Adapter Activation.
POA Policies
When creating a POA, POA Policy objects can be associated with the POA to specify the characteristics shared by the objects implemented in that POA. The POA specification defines seven different POA policies. This section describes these policies and enumerates the valid POA Policy combinations.

Several other POA policies are recognized by the POA implementation for specifying Security, Transactions, Transports, and Clustering.

Hello World Application
For providing transient objects with minimal programming effort, there is a pre-built POA called the RootPOA. We will show here the "Hello World" examples, both in IDL and in RMI, again, but this time, we will use the POA to create the object references.
Hello World using IDL

Hello World using Java RMI

Bank Application
Now that we have demonstrated that you can use either IDL or Java RMI to write your object interfaces and use the POA, we will use IDL for writing a simple Bank Application and show some of the power of the POA APIs. The bank application will demostrate creating POAs for transient and persistent objects, with user assigned Object Ids.
Activating Servants on Demand using the Servant Manager
The above Bank application, when it starts up "loads" all the servants. This is of course going to be a problem if this bank ever gets a large number of accounts. In this section we will restructure the Bank application to use the Servant Manager instead of the Active Object Map for activating the AccountImpl servants on demand.
One Servant for all Objects
Another optimization we can do to is to have just a single servant that services all the Account Objects. In this section we will restructure the Bank application to use a default) servant that, on object invocation, will query the POA Current for the current object Id and do the requested operation on the object state corresponding to it.
Support for Local Stubs
Both idl2java and rmi2iiop compilers optionally generate stubs that do local (no marshaling) invocations without bypassing the POA policies and mechanisms. This section also describes the ORB implemention of GIOP that, by default, for objects running locally, provides a "loopback" that does the invocation without a thread switch.
Understanding System Generated Object Ids
You can ask the POA to use System generated ids. This section will show how the system generates Ids for your transient and persistent objects.

Copyright © 1998-2003, Novell, Inc. All rights reserved.