TAO_ORBInitInfo Class Reference

An implementation of the PortableInterceptor::ORBInitInfo_3_1 interface. More...

#include <ORBInitInfo.h>

Inheritance diagram for TAO_ORBInitInfo:

Inheritance graph
[legend]
Collaboration diagram for TAO_ORBInitInfo:

Collaboration graph
[legend]
List of all members.

Reference Related Methods

TAO_ORBInitInfo-specific methods and types.

typedef TAO_ORBInitInfo_ptr _ptr_type
typedef TAO_ORBInitInfo_var _var_type
TAO_ORBInitInfo_ptr _duplicate (TAO_ORBInitInfo_ptr obj)
TAO_ORBInitInfo_ptr _narrow (CORBA::Object_ptr obj)
TAO_ORBInitInfo_ptr _unchecked_narrow (CORBA::Object_ptr obj)
TAO_ORBInitInfo_ptr _nil (void)

Public Member Functions

 TAO_ORBInitInfo (TAO_ORB_Core *orb_core, int argc, char *argv[], PortableInterceptor::SlotId slotid)
 Constructor.

virtual const char * _interface_repository_id (void) const
PortableInterceptor::ORBInitInfo Methods
These methods are exported by the PortableInterceptor::ORBInitInfo interface.

virtual CORBA::StringSeqarguments () throw (CORBA::SystemException)
virtual char * orb_id () throw (CORBA::SystemException)
 Return the ORBid for the ORB currently being initialized.

virtual IOP::CodecFactory_ptr codec_factory () throw (CORBA::SystemException)
virtual void register_initial_reference (const char *id, CORBA::Object_ptr obj) throw (CORBA::SystemException, PortableInterceptor::ORBInitInfo::InvalidName)
virtual CORBA::Object_ptr resolve_initial_references (const char *id) throw (CORBA::SystemException, PortableInterceptor::ORBInitInfo::InvalidName)
virtual void add_client_request_interceptor (PortableInterceptor::ClientRequestInterceptor_ptr interceptor) throw (CORBA::SystemException, PortableInterceptor::ORBInitInfo::DuplicateName)
virtual void add_server_request_interceptor (PortableInterceptor::ServerRequestInterceptor_ptr interceptor) throw (CORBA::SystemException, PortableInterceptor::ORBInitInfo::DuplicateName)
virtual void add_ior_interceptor (PortableInterceptor::IORInterceptor_ptr interceptor) throw (CORBA::SystemException, PortableInterceptor::ORBInitInfo::DuplicateName)
virtual void add_client_request_interceptor_with_policy (PortableInterceptor::ClientRequestInterceptor_ptr interceptor, const CORBA::PolicyList &policies) throw (CORBA::SystemException, PortableInterceptor::ORBInitInfo::DuplicateName, CORBA::PolicyError)
virtual void add_server_request_interceptor_with_policy (PortableInterceptor::ServerRequestInterceptor_ptr interceptor, const CORBA::PolicyList &policies) throw (CORBA::SystemException, PortableInterceptor::ORBInitInfo::DuplicateName, CORBA::PolicyError)
virtual void add_ior_interceptor_with_policy (PortableInterceptor::IORInterceptor_ptr interceptor, const CORBA::PolicyList &policies) throw (CORBA::SystemException, PortableInterceptor::ORBInitInfo::DuplicateName, CORBA::PolicyError)
virtual PortableInterceptor::SlotId allocate_slot_id () throw (CORBA::SystemException)
virtual void register_policy_factory (CORBA::PolicyType type, PortableInterceptor::PolicyFactory_ptr policy_factory) throw (CORBA::SystemException)
virtual CORBA::ORB_ptr _get_orb ()
TAO Extensions
These methods are not part of the PortableInterceptor specification, and are TAO-specific extensions.

size_t allocate_tss_slot_id (ACE_CLEANUP_FUNC cleanup) throw (CORBA::SystemException)
 Allocate a slot in the ORB's TSS resources.

TAO_ORB_Coreorb_core (void) const
void invalidate (void)
 Invalidate this ORBInitInfo instance.

PortableInterceptor::SlotId slot_count (void) const

Protected Member Functions

 ~TAO_ORBInitInfo (void)
void check_validity ()

Private Member Functions

 TAO_ORBInitInfo (const TAO_ORBInitInfo &)
void operator= (const TAO_ORBInitInfo &)

Private Attributes

TAO_ORB_Coreorb_core_
 Reference to the ORB Core.

int argc_
char ** argv_
 The argument vector passed to CORBA::ORB_init().

IOP::CodecFactory_var codec_factory_
PortableInterceptor::SlotId slot_count_
 The number of allocated slots.


Detailed Description

An implementation of the PortableInterceptor::ORBInitInfo_3_1 interface.

This class encapsulates the data passed to ORBInitializers during ORB initialization.

Definition at line 59 of file ORBInitInfo.h.


Member Typedef Documentation

typedef TAO_ORBInitInfo_ptr TAO_ORBInitInfo::_ptr_type
 

Reimplemented from CORBA::LocalObject.

Definition at line 245 of file ORBInitInfo.h.

typedef TAO_ORBInitInfo_var TAO_ORBInitInfo::_var_type
 

Reimplemented from CORBA::LocalObject.

Definition at line 246 of file ORBInitInfo.h.


Constructor & Destructor Documentation

TAO_ORBInitInfo::TAO_ORBInitInfo TAO_ORB_Core orb_core,
int  argc,
char *  argv[],
PortableInterceptor::SlotId  slotid
 

Constructor.

Definition at line 62 of file ORBInitInfo.cpp.

00066   : orb_core_ (orb_core),
00067     argc_ (argc),
00068     argv_ (argv),
00069     codec_factory_ (),
00070     slot_count_ (slotid)
00071 {
00072 }

TAO_ORBInitInfo::~TAO_ORBInitInfo void   )  [protected]
 

Destructor is protected to enforce proper memory management through the reference counting mechanism.

Definition at line 74 of file ORBInitInfo.cpp.

00075 {
00076 }

TAO_ORBInitInfo::TAO_ORBInitInfo const TAO_ORBInitInfo  )  [private]
 

Prevent copying through the copy constructor and the assignment operator.


Member Function Documentation

TAO_ORBInitInfo_ptr TAO_ORBInitInfo::_duplicate TAO_ORBInitInfo_ptr  obj  )  [static]
 

Definition at line 453 of file ORBInitInfo.cpp.

References TAO_Local_RefCounted_Object::_add_ref(), CORBA::is_nil(), and TAO_ORBInitInfo_ptr.

Referenced by _narrow(), and TAO::Objref_Traits< TAO_ORBInitInfo >::duplicate().

00454 {
00455   if (!CORBA::is_nil (obj))
00456     {
00457       obj->_add_ref ();
00458     }
00459 
00460   return obj;
00461 }

CORBA::ORB_ptr TAO_ORBInitInfo::_get_orb  )  [virtual]
 

Return the argument vector for the ORB currently being initialized as a string sequence.

Reimplemented from CORBA::LocalObject.

Definition at line 428 of file ORBInitInfo.cpp.

References CORBA::ORB::_duplicate(), ACE_CHECK_RETURN, ACE_ENV_SINGLE_ARG_PARAMETER, and check_validity().

00429 {
00430   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00431   ACE_CHECK_RETURN (CORBA::ORB::_nil ());
00432 
00433   return CORBA::ORB::_duplicate (this->orb_core_->orb ());
00434 }

const char * TAO_ORBInitInfo::_interface_repository_id void   )  const [virtual]
 

Reimplemented from CORBA::Object.

Definition at line 463 of file ORBInitInfo.cpp.

00464 {
00465   return "IDL:TAO_ORBInitInfo:1.0";
00466 }

TAO_ORBInitInfo_ptr TAO_ORBInitInfo::_narrow CORBA::Object_ptr  obj  )  [static]
 

Reimplemented from CORBA::LocalObject.

Definition at line 436 of file ORBInitInfo.cpp.

References _duplicate(), _nil(), CORBA::is_nil(), and TAO_ORBInitInfo_ptr.

00440 {
00441   if (CORBA::is_nil (_tao_objref))
00442     {
00443       return TAO_ORBInitInfo::_nil ();
00444     }
00445 
00446   TAO_ORBInitInfo_ptr proxy =
00447     dynamic_cast<TAO_ORBInitInfo_ptr> (_tao_objref);
00448 
00449   return TAO_ORBInitInfo::_duplicate (proxy);
00450 }

TAO_ORBInitInfo_ptr TAO_ORBInitInfo::_nil void   )  [inline, static]
 

Reimplemented from CORBA::LocalObject.

Definition at line 260 of file ORBInitInfo.h.

References TAO_ORBInitInfo_ptr.

Referenced by _narrow(), and TAO::Objref_Traits< TAO_ORBInitInfo >::nil().

00261     {
00262       return (TAO_ORBInitInfo_ptr)0;
00263     }

TAO_ORBInitInfo_ptr TAO_ORBInitInfo::_unchecked_narrow CORBA::Object_ptr  obj  )  [static]
 

void TAO_ORBInitInfo::add_client_request_interceptor PortableInterceptor::ClientRequestInterceptor_ptr  interceptor  )  throw (CORBA::SystemException, PortableInterceptor::ORBInitInfo::DuplicateName) [virtual]
 

Register a client request interceptor with the ORB currently being initialized.

Definition at line 203 of file ORBInitInfo.cpp.

References ACE_CHECK, ACE_ENV_ARG_PARAMETER, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_THROW, and ENOTSUP.

00208 {
00209 # if TAO_HAS_INTERCEPTORS == 1
00210   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00211   ACE_CHECK;
00212 
00213   this->orb_core_->add_interceptor (interceptor ACE_ENV_ARG_PARAMETER);
00214   ACE_CHECK;
00215 #else
00216   ACE_UNUSED_ARG (interceptor);
00217   ACE_THROW (CORBA::NO_IMPLEMENT (
00218                CORBA::SystemException::_tao_minor_code (
00219                  0,
00220                  ENOTSUP),
00221                CORBA::COMPLETED_NO));
00222 #endif  /* TAO_HAS_INTERCEPTORS == 1 */
00223 }

void TAO_ORBInitInfo::add_client_request_interceptor_with_policy PortableInterceptor::ClientRequestInterceptor_ptr  interceptor,
const CORBA::PolicyList policies
throw (CORBA::SystemException, PortableInterceptor::ORBInitInfo::DuplicateName, CORBA::PolicyError) [virtual]
 

Register a client request interceptor with the ORB currently being initialized, along with a list of policies.

Definition at line 264 of file ORBInitInfo.cpp.

References ACE_CHECK, ACE_ENV_ARG_PARAMETER, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_THROW, and ENOTSUP.

00271 {
00272 # if TAO_HAS_INTERCEPTORS == 1
00273   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00274   ACE_CHECK;
00275 
00276   this->orb_core_->add_interceptor (interceptor,
00277                                     policies
00278                                     ACE_ENV_ARG_PARAMETER);
00279 #else
00280   ACE_UNUSED_ARG (interceptor);
00281   ACE_UNUSED_ARG (policies);
00282   ACE_THROW (CORBA::NO_IMPLEMENT (
00283                CORBA::SystemException::_tao_minor_code (
00284                  0,
00285                  ENOTSUP),
00286                CORBA::COMPLETED_NO));
00287 #endif  /* TAO_HAS_INTERCEPTORS == 1 */
00288 }

void TAO_ORBInitInfo::add_ior_interceptor PortableInterceptor::IORInterceptor_ptr  interceptor  )  throw (CORBA::SystemException, PortableInterceptor::ORBInitInfo::DuplicateName) [virtual]
 

Register an IOR interceptor with the ORB currently being initialized.

Definition at line 250 of file ORBInitInfo.cpp.

References ACE_CHECK, ACE_ENV_ARG_PARAMETER, and ACE_ENV_SINGLE_ARG_PARAMETER.

00255 {
00256   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00257   ACE_CHECK;
00258 
00259   this->orb_core_->add_interceptor (interceptor
00260                                      ACE_ENV_ARG_PARAMETER);
00261 }

void TAO_ORBInitInfo::add_ior_interceptor_with_policy PortableInterceptor::IORInterceptor_ptr  interceptor,
const CORBA::PolicyList policies
throw (CORBA::SystemException, PortableInterceptor::ORBInitInfo::DuplicateName, CORBA::PolicyError) [virtual]
 

Register an IOR interceptor with the ORB currently being initialized, along with a list of policies.

Definition at line 319 of file ORBInitInfo.cpp.

References ACE_CHECK, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_THROW, and ENOTSUP.

00326 {
00327   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00328   ACE_CHECK;
00329 
00330   // Since there are currently no PI Policies that pertain to
00331   // IOR Interceptors, we will always raise the NO_IMPLEMENT
00332   // CORBA System Exception here to indicate that this method
00333   // is currently not implemented/supported.
00334   ACE_UNUSED_ARG (interceptor);
00335   ACE_UNUSED_ARG (policies);
00336   ACE_THROW (CORBA::NO_IMPLEMENT (
00337                CORBA::SystemException::_tao_minor_code (
00338                  0,
00339                  ENOTSUP),
00340                CORBA::COMPLETED_NO));
00341 }

void TAO_ORBInitInfo::add_server_request_interceptor PortableInterceptor::ServerRequestInterceptor_ptr  interceptor  )  throw (CORBA::SystemException, PortableInterceptor::ORBInitInfo::DuplicateName) [virtual]
 

Register a server request interceptor with the ORB currently being initialized.

Definition at line 226 of file ORBInitInfo.cpp.

References ACE_CHECK, ACE_ENV_ARG_PARAMETER, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_THROW, and ENOTSUP.

00231 {
00232 # if TAO_HAS_INTERCEPTORS == 1
00233   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00234   ACE_CHECK;
00235 
00236   this->orb_core_->add_interceptor (interceptor ACE_ENV_ARG_PARAMETER);
00237   ACE_CHECK;
00238 
00239 #else
00240   ACE_UNUSED_ARG (interceptor);
00241   ACE_THROW (CORBA::NO_IMPLEMENT (
00242                CORBA::SystemException::_tao_minor_code (
00243                  0,
00244                  ENOTSUP),
00245                CORBA::COMPLETED_NO));
00246 #endif  /* TAO_HAS_INTERCEPTORS == 1 */
00247 }

void TAO_ORBInitInfo::add_server_request_interceptor_with_policy PortableInterceptor::ServerRequestInterceptor_ptr  interceptor,
const CORBA::PolicyList policies
throw (CORBA::SystemException, PortableInterceptor::ORBInitInfo::DuplicateName, CORBA::PolicyError) [virtual]
 

Register a server request interceptor with the ORB currently being initialized, along with a list of policies.

Definition at line 291 of file ORBInitInfo.cpp.

References ACE_CHECK, ACE_ENV_ARG_PARAMETER, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_THROW, and ENOTSUP.

00298 {
00299 # if TAO_HAS_INTERCEPTORS == 1
00300   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00301   ACE_CHECK;
00302 
00303   this->orb_core_->add_interceptor (interceptor,
00304                                     policies
00305                                     ACE_ENV_ARG_PARAMETER);
00306 
00307 #else
00308   ACE_UNUSED_ARG (interceptor);
00309   ACE_UNUSED_ARG (policies);
00310   ACE_THROW (CORBA::NO_IMPLEMENT (
00311                CORBA::SystemException::_tao_minor_code (
00312                  0,
00313                  ENOTSUP),
00314                CORBA::COMPLETED_NO));
00315 #endif  /* TAO_HAS_INTERCEPTORS == 1 */
00316 }

PortableInterceptor::SlotId TAO_ORBInitInfo::allocate_slot_id  )  throw (CORBA::SystemException) [virtual]
 

Reserve a slot in table found within the PortableInterceptor::Current object.

Implements PortableInterceptor::ORBInitInfo.

Definition at line 344 of file ORBInitInfo.cpp.

References ACE_CHECK_RETURN, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_THROW_RETURN, and ENOTSUP.

00346 {
00347   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00348   ACE_CHECK_RETURN (0);
00349 
00350 #if TAO_HAS_INTERCEPTORS == 1
00351   // No need to acquire a lock.  This only gets called during ORB
00352   // initialization.  ORB initialization is already atomic.
00353   return this->slot_count_++;
00354 #else
00355   ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (
00356                       CORBA::SystemException::_tao_minor_code (
00357                         0,
00358                         ENOTSUP),
00359                       CORBA::COMPLETED_NO),
00360                     0);
00361 #endif  /* TAO_HAS_INTERCEPTORS == 1 */
00362 }

size_t TAO_ORBInitInfo::allocate_tss_slot_id ACE_CLEANUP_FUNC  cleanup  )  throw (CORBA::SystemException)
 

Allocate a slot in the ORB's TSS resources.

TAO uses a single TSS key for these resources, so it is useful to place TSS objects in TAO's TSS resources on platforms where the number of TSS keys is low. The returned SlotId can be used to index into the array stored in ORB's TSS resources structure.

An accompanying cleanup function (e.g. a TSS destructor) can also be registered.

Definition at line 388 of file ORBInitInfo.cpp.

References ACE_CHECK_RETURN, ACE_ENV_SINGLE_ARG_PARAMETER, and ACE_THROW_RETURN.

00391 {
00392   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00393   ACE_CHECK_RETURN (0);
00394 
00395   size_t slot_id = 0;
00396 
00397   const int result = this->orb_core_->add_tss_cleanup_func (cleanup,
00398                                                             slot_id);
00399 
00400   if (result != 0)
00401     ACE_THROW_RETURN (CORBA::INTERNAL (
00402                         CORBA::SystemException::_tao_minor_code (
00403                           0,
00404                           errno),
00405                         CORBA::COMPLETED_NO),
00406                       0);
00407 
00408   return slot_id;
00409 }

CORBA::StringSeq * TAO_ORBInitInfo::arguments  )  throw (CORBA::SystemException) [virtual]
 

Return the argument vector for the ORB currently being initialized as a string sequence.

Definition at line 79 of file ORBInitInfo.cpp.

References ACE_CHECK_RETURN, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_NEW_THROW_EX, TAO::details::unbounded_basic_string_sequence< char >::length(), and CORBA::string_dup().

00081 {
00082   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00083   ACE_CHECK_RETURN (0);
00084 
00085   // In accordance with the C++ mapping for sequences, it is up to the
00086   // caller to deallocate storage for returned sequences.
00087 
00088   CORBA::StringSeq *args = 0;
00089   ACE_NEW_THROW_EX (args,
00090                     CORBA::StringSeq,
00091                     CORBA::NO_MEMORY (
00092                       CORBA::SystemException::_tao_minor_code (
00093                         0,
00094                         ENOMEM),
00095                       CORBA::COMPLETED_NO));
00096   ACE_CHECK_RETURN (0);
00097 
00098   CORBA::StringSeq_var safe_args (args);
00099 
00100   // Copy the argument vector to the string sequence.
00101 
00102   args->length (this->argc_);   // Not a problem if argc is zero.
00103   for (int i = 0; i < this->argc_; ++i)
00104     (*args)[i] = CORBA::string_dup (this->argv_[i]);
00105 
00106   return safe_args._retn ();
00107 }

void TAO_ORBInitInfo::check_validity  )  [protected]
 

Check if this ORBInitInfo instance is valid. Once post_init() has been called on each of the ORBInitializers, this ORBInitInfo is no longer valid. Throw an exception in that case.

Definition at line 412 of file ORBInitInfo.cpp.

References ACE_THROW.

Referenced by _get_orb().

00413 {
00414   if (this->orb_core_ == 0)
00415     {
00416       // As defined by the Portable Interceptor specification, throw a
00417       // CORBA::OBJECT_NOT_EXIST exception after CORBA::ORB_init() has
00418       // completed.  CORBA::ORB_init() sets the ORB core pointer in
00419       // this instance to zero when it is done initializing the ORB,
00420       // which is why we base "existence" on the validity of the ORB
00421       // core pointer.
00422       ACE_THROW (CORBA::OBJECT_NOT_EXIST (0,
00423                                           CORBA::COMPLETED_NO));
00424     }
00425 }

IOP::CodecFactory_ptr TAO_ORBInitInfo::codec_factory  )  throw (CORBA::SystemException) [virtual]
 

Return the CodecFactory for the ORB currently being initialized.

Definition at line 122 of file ORBInitInfo.cpp.

References ACE_CHECK_RETURN, ACE_DYNAMIC_SERVICE_DIRECTIVE, ACE_ENV_ARG_PARAMETER, TAO_Object_Loader::create_object(), ACE_Dynamic_Service< TYPE >::instance(), CORBA::is_nil(), and ACE_Service_Config::process_directive().

00124 {
00125   if (CORBA::is_nil (this->codec_factory_.in ()))
00126     {
00127       TAO_Object_Loader *loader =
00128         ACE_Dynamic_Service<TAO_Object_Loader>::instance ("CodecFactory_Loader");
00129 
00130       if (loader == 0)
00131         {
00132           ACE_Service_Config::process_directive (
00133             ACE_DYNAMIC_SERVICE_DIRECTIVE("CodecFactory",
00134                                           "TAO_CodecFactory",
00135                                           "_make_TAO_CodecFactory_Loader",
00136                                           ""));
00137           loader =
00138             ACE_Dynamic_Service<TAO_Object_Loader>::instance ("CodecFactory_Loader");
00139         }
00140 
00141       if (loader != 0)
00142         {
00143           CORBA::Object_var cf =
00144             loader->create_object (this->orb_core_->orb (), 0, 0 ACE_ENV_ARG_PARAMETER);
00145           ACE_CHECK_RETURN (IOP::CodecFactory::_nil ());
00146 
00147           this->codec_factory_ = IOP::CodecFactory::_narrow (cf.in ());
00148         }
00149     }
00150 
00151   return IOP::CodecFactory::_duplicate (this->codec_factory_.in ());
00152 }

ACE_INLINE void TAO_ORBInitInfo::invalidate void   ) 
 

Invalidate this ORBInitInfo instance.

Note:
This method is only meant to be called by the CORBA::ORB_init() function.

Definition at line 15 of file ORBInitInfo.inl.

00016 {
00017   this->orb_core_ = 0;
00018 }

void TAO_ORBInitInfo::operator= const TAO_ORBInitInfo  )  [private]
 

TAO_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE TAO_ORB_Core * TAO_ORBInitInfo::orb_core void   )  const
 

The ORB Core is essentialy fully initialized by the time ORBInitializer::post_init() is invoked. As such, it is generally best if this method is used in that method.

Note:
Only use this method if you know what you are doing.

Reimplemented from CORBA::Object.

Definition at line 9 of file ORBInitInfo.inl.

00010 {
00011   return this->orb_core_;
00012 }

char * TAO_ORBInitInfo::orb_id  )  throw (CORBA::SystemException) [virtual]
 

Return the ORBid for the ORB currently being initialized.

Definition at line 110 of file ORBInitInfo.cpp.

References ACE_CHECK_RETURN, ACE_ENV_SINGLE_ARG_PARAMETER, and CORBA::string_dup().

00112 {
00113   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00114   ACE_CHECK_RETURN (0);
00115 
00116   // In accordance with the C++ mapping for strings, return a copy.
00117 
00118   return CORBA::string_dup (this->orb_core_->orbid ());
00119 }

void TAO_ORBInitInfo::register_initial_reference const char *  id,
CORBA::Object_ptr  obj
throw (CORBA::SystemException, PortableInterceptor::ORBInitInfo::InvalidName) [virtual]
 

This method is particularly useful for registering references to local (locality constrained) objects. Note that this method should be called in ORBInitializer::pre_init() so that the registered reference will be available to the resolve_initial_references() that may be called in the ORBInitializer::post_init() call.

Definition at line 155 of file ORBInitInfo.cpp.

References ACE_CHECK, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_THROW, CORBA::is_nil(), TAO_Object_Ref_Table::register_initial_reference(), and ACE_OS::strlen().

00161 {
00162   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00163   ACE_CHECK;
00164 
00165   if (id == 0 || ACE_OS::strlen (id) == 0)
00166     ACE_THROW (PortableInterceptor::ORBInitInfo::InvalidName ());
00167   ACE_CHECK;
00168 
00169   if (CORBA::is_nil (obj))
00170     ACE_THROW (CORBA::BAD_PARAM (CORBA::OMGVMCID | 27,
00171                                  CORBA::COMPLETED_NO));
00172   ACE_CHECK;
00173 
00174   TAO_Object_Ref_Table &table = this->orb_core_->object_ref_table ();
00175 
00176   if (table.register_initial_reference (id, obj) == -1)
00177     ACE_THROW (PortableInterceptor::ORBInitInfo::InvalidName ());
00178 }

void TAO_ORBInitInfo::register_policy_factory CORBA::PolicyType  type,
PortableInterceptor::PolicyFactory_ptr  policy_factory
throw (CORBA::SystemException) [virtual]
 

Register a policy factory of the given policy type with the ORB currently being initialized.

Definition at line 365 of file ORBInitInfo.cpp.

References ACE_CHECK, ACE_ENV_ARG_PARAMETER, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_THROW, and TAO::PolicyFactory_Registry_Adapter::register_policy_factory().

00370 {
00371   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00372   ACE_CHECK;
00373 
00374   TAO::PolicyFactory_Registry_Adapter *registry =
00375     this->orb_core_->policy_factory_registry ();
00376 
00377   if (registry == 0)
00378     {
00379       ACE_THROW (CORBA::INTERNAL ());
00380     }
00381 
00382   registry->register_policy_factory (type,
00383                                      policy_factory
00384                                       ACE_ENV_ARG_PARAMETER);
00385 }

CORBA::Object_ptr TAO_ORBInitInfo::resolve_initial_references const char *  id  )  throw (CORBA::SystemException, PortableInterceptor::ORBInitInfo::InvalidName) [virtual]
 

Obtain a reference to an object that may not yet be available via the usual CORBA::ORB::resolve_initial_references() mechanism since the ORB may not be fully initialized yet.

Definition at line 181 of file ORBInitInfo.cpp.

References ACE_CHECK_RETURN, ACE_ENV_ARG_PARAMETER, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_THROW_RETURN, and ACE_OS::strlen().

00186 {
00187   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00188   ACE_CHECK_RETURN (CORBA::Object::_nil ());
00189 
00190   if (id == 0 || ACE_OS::strlen (id) == 0)
00191     ACE_THROW_RETURN (PortableInterceptor::ORBInitInfo::InvalidName (),
00192                       CORBA::Object::_nil ());
00193 
00194   // The ORB is practically fully initialized by the time this point
00195   // is reached so just use the ORB's resolve_initial_references()
00196   // mechanism.
00197   return
00198     this->orb_core_->orb ()->resolve_initial_references (id
00199                                                          ACE_ENV_ARG_PARAMETER);
00200 }

ACE_INLINE PortableInterceptor::SlotId TAO_ORBInitInfo::slot_count void   )  const
 

Return the number of allocated slots in for the PICurrent object.

Definition at line 21 of file ORBInitInfo.inl.

References slot_count_.

00022 {
00023   return this->slot_count_;
00024 }


Member Data Documentation

int TAO_ORBInitInfo::argc_ [private]
 

The number of arguments in the argument vector passed to CORBA::ORB_init().

Definition at line 293 of file ORBInitInfo.h.

char** TAO_ORBInitInfo::argv_ [private]
 

The argument vector passed to CORBA::ORB_init().

Definition at line 296 of file ORBInitInfo.h.

IOP::CodecFactory_var TAO_ORBInitInfo::codec_factory_ [private]
 

Reference to the CodecFactory returned by ORBInitInfo::codec_factory().

Definition at line 300 of file ORBInitInfo.h.

TAO_ORB_Core* TAO_ORBInitInfo::orb_core_ [private]
 

Reference to the ORB Core.

Reimplemented from CORBA::Object.

Definition at line 289 of file ORBInitInfo.h.

PortableInterceptor::SlotId TAO_ORBInitInfo::slot_count_ [private]
 

The number of allocated slots.

Definition at line 303 of file ORBInitInfo.h.

Referenced by slot_count().


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 12:52:30 2006 for TAO_PI by doxygen 1.3.6