Commonly used CORBA interfaces

The following are the most commonly used CORBA interfaces:

CORBA class interfaces

The CORBA interface provides the following commonly used class operations. These are used like a C++ class reference (for example CORBA::is_nil(somePointer);).

is_nil
This operation returns a boolean that indicates if the input object reference is nil. This is useful for many operations involving object references, including those operations that do not throw exceptions when they fail - for example CORBA::Object::_narrow().
release
This operation releases resources associated with an object or pseudo-object reference.This operation may or may not perform a C++ delete operation. A reference count is used by this operation and CORBA::Object::_duplicate(). When the reference count reaches zero then the appropriate delete operations are performed. Care must be taken when using the release and _duplicate operations to ensure that objects are not leaked or inadvertently deleted. Alternatively use the _var technique described for string_dup below.
string_dup
This operation copies a string. A common example of its use is when returning a string from an operation. Strings and wide strings, unlike the other basic CORBA types, have associated allocated memory. So care must be taken when using these variables. The resulting string should subsequently be freed by using the CORBA::string_free operation, or by assigning the string to a _var variable which will free the string appropriately.

CORBA::object interfaces

The CORBA interface provides the following object interfaces:

_duplicate
This operation duplicates an object reference. This is particularly useful when passing references to objects to resolve memory ownership issues. For every _duplicate that is performed on an object an equal number of release() must also be performed for proper memory management. An alternative to the _duplicate() and release() logic is to use _var support as described for string_dup in CORBA class interfaces.
_is_a
This operation is used to determine whether an object reference supports a given IDL interface. If the object supports the interface the _narrow operation can be successfully performed.
_is_equivalent
This operation is used to determine whether two object references refer to the same object.
_narrow
This operation is used to narrow a more generic interface to a more specific interface. This operation will return an empty pointer without throwing an exception if the interface cannot be narrowed to the requested type. Care must be taken to check the returned value before using it.
_nil
This operation returns a nil CORBA::Object. This object could be used for comparison operations.
_non_existent
This operation determines whether an object reference refers to a valid object. This will result in verification of the object reference only, no other operations are performed on the requested object.

CORBA::ORB interfaces

The CORBA interface provides the following ORB interfaces:

object_to_string
This operation converts an object reference to an external form that can be stored for later use or exchanged between processes. The string_to_object operation can be used to reconstruct the object reference.
string_to_object
This operation converts a stringified object reference to a reconstructed object reference. The object_to_string operation must have been used to create the input stringified data.

Note: Although object_to_string is the way to save object references for future usage, the returned data should only be used with string_to_object to reconstruct that object reference. Do not use the string for comparing equivalence of object references. The object_to_string operation may return different values at different times because various Object Services may be adding information to this IOR.


Related reference
CORBA programming reference



Searchable topic ID:   rcor_copcui
Last updated: Jun 21, 2007 8:07:48 PM CDT    WebSphere Business Integration Server Foundation, Version 5.0.2
http://publib.boulder.ibm.com/infocenter/wasinfo/index.jsp?topic=/com.ibm.wasee.doc/info/ee/corba/ref/rcor_copcui.html

Library | Support | Terms of Use | Feedback