2-18
SOMobjects Base Toolkit: Programmer’s Reference Manual
create Method
Purpose
Creates a “reference” for a local application object which can be exported to remote clients.
IDL Syntax
typedef sequence<octet,1024> ReferenceData; // in somdtype.idl
SOMDObject create (
in ReferenceData id,
in InterfaceDef intf,
in ImplementationDef impl);
Description
The create method creates a SOMDObject which is used as a “reference” to a local
application object. An object reference is simply an object which is used to refer to another
target object — one may think of it as an “ID”, “link”, or “handle.” Object references are
important in DSOM in that their values can be externalized (that is, can be represented in a
string form) for transmission between processes, storage in files, and so on. In DSOM, the
proxy objects in client processes are remote object references.
To create an object reference, the caller specifies the ImplementationDef of the calling
process, the InterfaceDef of the target application object, and up to 1024 bytes of
ReferenceData which is used by the application to identify and activate the application
object. When subsequent method calls specify the object reference as a parameter, the
application will use the reference to find and/or activate the referenced object.
Note that (as specified in CORBA 1.1) each call to create returns a unique object reference,
even if the same parameters are used in subsequent calls. For each reference, the
ReferenceData is stored in the reference data file (and backup file, if any) for the server.
The SOMOA class introduces a change_id method which allows a server to modify the
ReferenceData of one of its references. (The change_id method is not in the CORBA 1.1
specification.)
Ownership of the returned SOMDObject is transferred to the caller.
Parameters
receiver A pointer to a BOA (SOMOA) object for the server.
env A pointer to the Environment structure for the method caller.
id A pointer to the ReferenceData structure containing application-specific
information describing the target object.
intf A pointer to the InterfaceDef object which describes the interface of the
target object.
impl A pointer to the ImplementationDef object which describes the application
(server) process which implements the target object.
Komentarze do niniejszej Instrukcji