14.13.1.7 Example
In the following example, the first struct creates a servant by
a user-defined constructor. The second struct tells the POA that
the servant can be used to handle requests on an object. The POA
returns the ObjectId
it has created for the object.
The third statement assumes that the POA has the
IMPLICIT_ACTIVATION
policy (the only supported policy
in version 4.2 of the Oracle Tuxedo software) and returns a
reference to the object. That reference can then be handed to a
client for invocations. When the client invokes on the reference,
the request is returned to the servant just created.
MyFooServant* afoo = new MyFooServant(poa,27);
PortableServer::ObjectId_var oid =
poa->activate_object(afoo);
Foo_var foo = afoo->_this();
Parent topic: PortableServer::POA::activate_object