[Enterprise Extensions only]

Object::_get_implementation

Overview Returns a reference to the CORBA::ImplementationDef describing the server in which a remote object resides.
Original class CORBA::Object
Exceptions CORBA::SystemException


Intended Usage

This method is intended to be used to obtain the CORBA::ImplementationDef object describing the server in which a remote object resides. When invoked on a proxy object, this method is forwarded to the remote object, and a proxy to a remote CORBA::ImplementatinDef object (residing in the same server as the remote object) is returned. When invoked on a local object residing in a server, the local CORBA::ImplementationDef object (the one originally passed to CORBA::BOA::impl_is_ready) is returned. When invoked on a local object in a client (that is not also a server), NULL is returned.

IDL Syntax

  virtual CORBA::ImplementationDef_ptr _get_implementation () = 0;

Input parameters

None.

Return values

CORBA::ImplementationDef_ptr
A pointer to the ImplementationDef object that describes the server in which an object (refererred to by an object reference) resides. The caller assumes ownership of this object, and should subsequently CORBA::release (not delete) it.

Example

  /* The following is a C++ example */
  #include "corba.h"
  #include <string.h>
  /* Assume p is a proxy object pointer derived from CORBA::Object class
     the following will get the impl def and interface def on remote objects
   */
  CORBA::ImplementationDef_ptr impl;
  CORBA::InterfaceDef_ptr intf;
  string str;
  impl = p->_get_implementation();
  if(impl)
  {
    str = impl->get_alias();            /* get implementation alias */
    /* ensure it's the right impl and work with the impl */
    ...
  }
  else /* generate exception */ ...
    intf = p->_get_interface();
    if(intf)
    {
      str = intf->id();                 /* get interface id */
      /* ensure it's the right interface and work with the intf */
       ...
    }
  else /* generate exception */ ...
  CORBA::release(p);