Previous | Table of Contents | Next |
Object references are created in servers. Once they are created, they may be exported to clients.
From this model’s perspective, object references encapsulate object identity information and information required by the ORB
to identify and locate the server and POA with which the object is associated (that is, in whose scope the reference was created.)
References are created in the following ways:
• The server application may directly create a reference with the create_reference and create_reference_with_id operations
on a POA object. These operations collect the necessary information to constitute the reference, either from
information associated with the POA or as parameters to the operation. These
operations only create a reference. In doing so, they bring the abstract object into
existence, but do not associate it with an active servant.
• The server application may explicitly activate a servant, associating it with an object identity using the activate_object or activate_object_with_id operations. Once a servant is activated, the server application can map the servant to its corresponding reference using the servant_to_reference or id_to_reference operations.
• The server application may cause a servant to implicitly activate itself. This behavior can only occur if the POA has been created with the IMPLICIT_ACTIVATION policy. If an attempt is made to obtain an object reference corresponding to an inactive servant, the POA may automatically assign a generated unique Object Id to the servant and activate the resulting object. The reference may be obtained by invoking POA::servant_to_reference with an inactive servant, or by performing an explicit or implicit type conversion from the servant to a reference type in programming language mappings that permit this conversion.
Once a reference is created in the server, it can be made available to clients in a variety of ways. It can be advertised
through the OMG Naming and Trading Services. It can be converted to a string via ORB::object_to_string and published in some
way that allows the client to discover the string and convert it to a reference using ORB::string_to_object. It can be returned
as the result of an operation invocation.
Once a reference becomes available to a client, that reference constitutes the identity of the object from the client’s perspective.
As long as the client program holds and uses that reference, requests made on the reference should be sent to the “same? object.
Note – The meaning of object identity and “sameness? is at present the subject of debate in the OMG. This specification does
not attempt to resolve that debate in any way, particularly by defining a concrete notion of identity that is exposed to clients,
beyond the existing notions of identity described in the CORBA specifications and the OMA guide.
The states of servers and implementation objects are opaque to clients. This specification deals primarily with the view of
the ORB from the server’s perspective.