3.2.2.1 Explicit Activation
Application code can bypass the on-demand activation feature of
the TP Framework for objects that use the process
activation policy. The application can “preactivate” an
object (that is, activate it before any invocation) using the
TP::create_active_object_reference
call.
Preactivation works as follows. Before the application creates
an object reference, the application instantiates a servant and
initializes that servant’s state. The application uses
TP::create_active_object_reference
to put the object
into the Active Object Map (that is, associate the servant with an
ObjectId
). Then, when the first invocation is made,
the TP Framework immediately directs the request to the process
that created the object reference and then to the existing servant,
bypassing the necessity to call Server::create_servant
and then the servant’s activate_object
method
(just as if this were the second or later invocation on the
object). Note that the object reference for such an object will not
be directed to another server and the object will never go through
on-demand activation as long as the object remains activated.
Since the preactivated object has the process
activation policy, it will remain active until one of two events
occurs: (1) the ending of the process or (2) a
TP::deactivateEnable
call.