CORBA Programming Reference
Creates a new POA as a child of the target POA.
POA_ptr
PortableServer::create_POA (
const char * adapter_name,
POAManager_ptr a_POAManager,
const CORBA::PolicyList & policies)
Either a NULL value, indicating that a new POAManager is to be created and associated with the new POA, or a pointer to an existing POAManager.
Raised if any of the policy objects specified are not valid for the ORB implementation, if conflicting policy objects are specified, or if any of the specified policy objects require prior administrative action that has not been performed. This exception contains the index in the policy parameter value of the first offending policy object.
Raised if the program tries to create a POA with a LifespanPolicy of PERSISTENT
without having set a port, as described in the operation CORBA::ORB_init.
This operation creates a new POA as a child of the target POA. The specified name, which must be unique, identifies the new POA with respect to other POAs with the same parent POA.
If the a_POAManager parameter is NULL, a new PortableServer::POAManager
object is created and associated with the new POA. Otherwise, the specified POAManager object is associated with the new POA. The POAManager object can be obtained using the attribute name the_POAManager.
The specified policy objects are associated with the POA and are used to control its behavior. The policy objects are effectively copied before this operation returns, so the application is free to destroy them while the POA is in use. Policies are not inherited from the parent POA.
Note: This function is supported only for joint client/servers.
Returns a pointer to the POA that was created.
In this example, the child POA would use the same manager as the parent POA; the child POA would then have the same state as the parent (that is, it would be active if the parent is active).
CORBA::PolicyList policies(2);
policies.length (1);
policies[0] = rootPOA->create_lifespan_policy(
PortableServer::LifespanPolicy::TRANSIENT);
PortableServer::POA_ptr poa =
rootPOA->create_POA("my_little_poa",
rootPOA->the_POAManager, policies);
In this example, a new POA is created as a child of the root POA.
CORBA::PolicyList policies(2);
policies.length (1);
policies[0] = rootPOA->create_lifespan_policy(
PortableServer::LifespanPolicy::TRANSIENT);
PortableServer::POA_ptr poa =
rootPOA->create_POA("my_little_poa",
PortableServer::POAManager::_nil(), policies);