Tuxedo
0

Administering a Tuxedo Application at Run Time

 Previous Next Contents View as PDF  

PortableServer::POA::activate_object

Synopsis

Explicitly activates an individual object.

C++ Binding

ObjectId * activate_object (
Servant p_servant);

Argument

p_servant

An instance of the C++ implementation class for the interface.

Exceptions

If the specified servant is already in the Active Object Map, the ServantAlreadyActive exception is raised.

Note: Other exceptions can occur if the POA uses unsupported policies.

Description

This operation explicitly activates an individual object by generating an ObjectId and entering the ObjectId and the specified servant in the Active Object Map.

Note: This function is supported only for a joint client/server.

Return Values

If the function succeeds, the ObjectId is returned.

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 BEA 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();

 

Back to Top Previous Next
Contact e-docsContact BEAwebmasterprivacy