#include <ORBInitInfo.h>
Inheritance diagram for TAO_ORBInitInfo:


This class encapsulates the data passed to ORBInitializers during ORB initialization.
Definition at line 59 of file ORBInitInfo.h.
|
|
Reimplemented from CORBA::LocalObject. Definition at line 200 of file ORBInitInfo.h. |
|
|
Reimplemented from CORBA::LocalObject. Definition at line 201 of file ORBInitInfo.h. |
|
||||||||||||||||||||
|
Constructor.
Definition at line 58 of file ORBInitInfo.cpp.
00062 : orb_core_ (orb_core), 00063 argc_ (argc), 00064 argv_ (argv), 00065 codec_factory_ (), 00066 slot_count_ (slotid) 00067 { 00068 } |
|
|
Destructor is protected to enforce proper memory management through the reference counting mechanism. Definition at line 70 of file ORBInitInfo.cpp.
00071 {
00072 }
|
|
|
Prevent copying through the copy constructor and the assignment operator. |
|
|
Definition at line 377 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().
00378 {
00379 if (!CORBA::is_nil (obj))
00380 {
00381 obj->_add_ref ();
00382 }
00383
00384 return obj;
00385 }
|
|
|
Return the argument vector for the ORB currently being initialized as a string sequence. Reimplemented from CORBA::LocalObject. Definition at line 356 of file ORBInitInfo.cpp. References CORBA::ORB::_duplicate(), and check_validity().
00357 {
00358 this->check_validity ();
00359
00360 return CORBA::ORB::_duplicate (this->orb_core_->orb ());
00361 }
|
|
|
Reimplemented from CORBA::Object. Definition at line 387 of file ORBInitInfo.cpp.
00388 {
00389 return "IDL:TAO_ORBInitInfo:1.0";
00390 }
|
|
|
Reimplemented from CORBA::LocalObject. Definition at line 363 of file ORBInitInfo.cpp. References _duplicate(), _nil(), CORBA::is_nil(), and TAO_ORBInitInfo_ptr.
00364 {
00365 if (CORBA::is_nil (_tao_objref))
00366 {
00367 return TAO_ORBInitInfo::_nil ();
00368 }
00369
00370 TAO_ORBInitInfo_ptr proxy =
00371 dynamic_cast<TAO_ORBInitInfo_ptr> (_tao_objref);
00372
00373 return TAO_ORBInitInfo::_duplicate (proxy);
00374 }
|
|
|
Reimplemented from CORBA::LocalObject. Definition at line 211 of file ORBInitInfo.h. References TAO_ORBInitInfo_ptr. Referenced by _narrow(), and TAO::Objref_Traits< TAO_ORBInitInfo >::nil().
00212 {
00213 return (TAO_ORBInitInfo_ptr)0;
00214 }
|
|
|
|
|
|
Register a client request interceptor with the ORB currently being initialized. Definition at line 177 of file ORBInitInfo.cpp. References TAO_ORB_Core::add_interceptor(), check_validity(), and ENOTSUP.
00179 {
00180 # if TAO_HAS_INTERCEPTORS == 1
00181 this->check_validity ();
00182
00183 this->orb_core_->add_interceptor (interceptor);
00184 #else
00185 ACE_UNUSED_ARG (interceptor);
00186 throw ::CORBA::NO_IMPLEMENT (
00187 CORBA::SystemException::_tao_minor_code (
00188 0,
00189 ENOTSUP),
00190 CORBA::COMPLETED_NO);
00191 #endif /* TAO_HAS_INTERCEPTORS == 1 */
00192 }
|
|
||||||||||||
|
Register a client request interceptor with the ORB currently being initialized, along with a list of policies. Definition at line 223 of file ORBInitInfo.cpp. References TAO_ORB_Core::add_interceptor(), check_validity(), and ENOTSUP.
00226 {
00227 # if TAO_HAS_INTERCEPTORS == 1
00228 this->check_validity ();
00229
00230 this->orb_core_->add_interceptor (interceptor, policies);
00231 #else
00232 ACE_UNUSED_ARG (interceptor);
00233 ACE_UNUSED_ARG (policies);
00234 throw ::CORBA::NO_IMPLEMENT (
00235 CORBA::SystemException::_tao_minor_code (
00236 0,
00237 ENOTSUP),
00238 CORBA::COMPLETED_NO);
00239 #endif /* TAO_HAS_INTERCEPTORS == 1 */
00240 }
|
|
|
Register an IOR interceptor with the ORB currently being initialized. Definition at line 214 of file ORBInitInfo.cpp. References TAO_ORB_Core::add_interceptor(), and check_validity().
00216 {
00217 this->check_validity ();
00218
00219 this->orb_core_->add_interceptor (interceptor);
00220 }
|
|
||||||||||||
|
Register an IOR interceptor with the ORB currently being initialized, along with a list of policies. Definition at line 264 of file ORBInitInfo.cpp. References check_validity(), and ENOTSUP.
00268 {
00269 this->check_validity ();
00270
00271 // Since there are currently no PI Policies that pertain to
00272 // IOR Interceptors, we will always raise the NO_IMPLEMENT
00273 // CORBA System Exception here to indicate that this method
00274 // is currently not implemented/supported.
00275 ACE_UNUSED_ARG (interceptor);
00276 ACE_UNUSED_ARG (policies);
00277 throw ::CORBA::NO_IMPLEMENT (
00278 CORBA::SystemException::_tao_minor_code (
00279 0,
00280 ENOTSUP),
00281 CORBA::COMPLETED_NO);
00282 }
|
|
|
Register a server request interceptor with the ORB currently being initialized. Definition at line 195 of file ORBInitInfo.cpp. References TAO_ORB_Core::add_interceptor(), check_validity(), and ENOTSUP.
00197 {
00198 # if TAO_HAS_INTERCEPTORS == 1
00199 this->check_validity ();
00200
00201 this->orb_core_->add_interceptor (interceptor);
00202
00203 #else
00204 ACE_UNUSED_ARG (interceptor);
00205 throw ::CORBA::NO_IMPLEMENT (
00206 CORBA::SystemException::_tao_minor_code (
00207 0,
00208 ENOTSUP),
00209 CORBA::COMPLETED_NO);
00210 #endif /* TAO_HAS_INTERCEPTORS == 1 */
00211 }
|
|
||||||||||||
|
Register a server request interceptor with the ORB currently being initialized, along with a list of policies. Definition at line 243 of file ORBInitInfo.cpp. References TAO_ORB_Core::add_interceptor(), check_validity(), and ENOTSUP.
00246 {
00247 # if TAO_HAS_INTERCEPTORS == 1
00248 this->check_validity ();
00249
00250 this->orb_core_->add_interceptor (interceptor, policies);
00251
00252 #else
00253 ACE_UNUSED_ARG (interceptor);
00254 ACE_UNUSED_ARG (policies);
00255 throw ::CORBA::NO_IMPLEMENT (
00256 CORBA::SystemException::_tao_minor_code (
00257 0,
00258 ENOTSUP),
00259 CORBA::COMPLETED_NO);
00260 #endif /* TAO_HAS_INTERCEPTORS == 1 */
00261 }
|
|
|
Reserve a slot in table found within the PortableInterceptor::Current object. Implements PortableInterceptor::ORBInitInfo. Definition at line 285 of file ORBInitInfo.cpp. References check_validity(), ENOTSUP, and slot_count_.
00286 {
00287 this->check_validity ();
00288
00289 #if TAO_HAS_INTERCEPTORS == 1
00290 // No need to acquire a lock. This only gets called during ORB
00291 // initialization. ORB initialization is already atomic.
00292 return this->slot_count_++;
00293 #else
00294 throw ::CORBA::NO_IMPLEMENT (
00295 CORBA::SystemException::_tao_minor_code (
00296 0,
00297 ENOTSUP),
00298 CORBA::COMPLETED_NO);
00299 #endif /* TAO_HAS_INTERCEPTORS == 1 */
00300 }
|
|
|
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.
Definition at line 322 of file ORBInitInfo.cpp. References TAO_ORB_Core::add_tss_cleanup_func(), and check_validity().
00323 {
00324 this->check_validity ();
00325
00326 size_t slot_id = 0;
00327
00328 const int result = this->orb_core_->add_tss_cleanup_func (cleanup, slot_id);
00329
00330 if (result != 0)
00331 throw ::CORBA::INTERNAL (
00332 CORBA::SystemException::_tao_minor_code (
00333 0,
00334 errno),
00335 CORBA::COMPLETED_NO);
00336
00337 return slot_id;
00338 }
|
|
|
Return the argument vector for the ORB currently being initialized as a string sequence. Definition at line 75 of file ORBInitInfo.cpp. References ACE_NEW_THROW_EX, check_validity(), and CORBA::string_dup().
00076 {
00077 this->check_validity ();
00078
00079 // In accordance with the C++ mapping for sequences, it is up to the
00080 // caller to deallocate storage for returned sequences.
00081
00082 CORBA::StringSeq *args = 0;
00083 ACE_NEW_THROW_EX (args,
00084 CORBA::StringSeq,
00085 CORBA::NO_MEMORY (
00086 CORBA::SystemException::_tao_minor_code (
00087 0,
00088 ENOMEM),
00089 CORBA::COMPLETED_NO));
00090
00091 CORBA::StringSeq_var safe_args (args);
00092
00093 // Copy the argument vector to the string sequence.
00094
00095 args->length (this->argc_); // Not a problem if argc is zero.
00096 for (int i = 0; i < this->argc_; ++i)
00097 (*args)[i] = CORBA::string_dup (this->argv_[i]);
00098
00099 return safe_args._retn ();
00100 }
|
|
|
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 341 of file ORBInitInfo.cpp. Referenced by _get_orb(), add_client_request_interceptor(), add_client_request_interceptor_with_policy(), add_ior_interceptor(), add_ior_interceptor_with_policy(), add_server_request_interceptor(), add_server_request_interceptor_with_policy(), allocate_slot_id(), allocate_tss_slot_id(), arguments(), orb_id(), register_initial_reference(), register_policy_factory(), and resolve_initial_references().
00342 {
00343 if (this->orb_core_ == 0)
00344 {
00345 // As defined by the Portable Interceptor specification, throw a
00346 // CORBA::OBJECT_NOT_EXIST exception after CORBA::ORB_init() has
00347 // completed. CORBA::ORB_init() sets the ORB core pointer in
00348 // this instance to zero when it is done initializing the ORB,
00349 // which is why we base "existence" on the validity of the ORB
00350 // core pointer.
00351 throw ::CORBA::OBJECT_NOT_EXIST (0, CORBA::COMPLETED_NO);
00352 }
00353 }
|
|
|
Return the CodecFactory for the ORB currently being initialized. Definition at line 113 of file ORBInitInfo.cpp. References ACE_DYNAMIC_SERVICE_DIRECTIVE, TAO_Object_Loader::create_object(), ACE_Dynamic_Service< TYPE >::instance(), CORBA::is_nil(), and ACE_Service_Config::process_directive().
00114 {
00115 if (CORBA::is_nil (this->codec_factory_.in ()))
00116 {
00117 TAO_Object_Loader *loader =
00118 ACE_Dynamic_Service<TAO_Object_Loader>::instance ("CodecFactory_Loader");
00119
00120 if (loader == 0)
00121 {
00122 ACE_Service_Config::process_directive (
00123 ACE_DYNAMIC_SERVICE_DIRECTIVE("CodecFactory",
00124 "TAO_CodecFactory",
00125 "_make_TAO_CodecFactory_Loader",
00126 ""));
00127 loader =
00128 ACE_Dynamic_Service<TAO_Object_Loader>::instance ("CodecFactory_Loader");
00129 }
00130
00131 if (loader != 0)
00132 {
00133 CORBA::Object_var cf =
00134 loader->create_object (this->orb_core_->orb (), 0, 0);
00135
00136 this->codec_factory_ = IOP::CodecFactory::_narrow (cf.in ());
00137 }
00138 }
00139
00140 return IOP::CodecFactory::_duplicate (this->codec_factory_.in ());
00141 }
|
|
|
Invalidate this ORBInitInfo instance.
Definition at line 15 of file ORBInitInfo.inl.
00016 {
00017 this->orb_core_ = 0;
00018 }
|
|
|
|
|
|
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.
Reimplemented from CORBA::Object. Definition at line 9 of file ORBInitInfo.inl.
00010 {
00011 return this->orb_core_;
00012 }
|
|
|
Return the ORBid for the ORB currently being initialized.
Definition at line 103 of file ORBInitInfo.cpp. References check_validity(), and CORBA::string_dup().
00104 {
00105 this->check_validity ();
00106
00107 // In accordance with the C++ mapping for strings, return a copy.
00108
00109 return CORBA::string_dup (this->orb_core_->orbid ());
00110 }
|
|
||||||||||||
|
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 144 of file ORBInitInfo.cpp. References check_validity(), CORBA::is_nil(), TAO_ORB_Core::object_ref_table(), TAO_Object_Ref_Table::register_initial_reference(), and ACE_OS::strlen().
00147 {
00148 this->check_validity ();
00149
00150 if (id == 0 || ACE_OS::strlen (id) == 0)
00151 throw PortableInterceptor::ORBInitInfo::InvalidName ();
00152
00153 if (CORBA::is_nil (obj))
00154 throw ::CORBA::BAD_PARAM (CORBA::OMGVMCID | 27, CORBA::COMPLETED_NO);
00155
00156 TAO_Object_Ref_Table &table = this->orb_core_->object_ref_table ();
00157
00158 if (table.register_initial_reference (id, obj) == -1)
00159 throw PortableInterceptor::ORBInitInfo::InvalidName ();
00160 }
|
|
||||||||||||
|
Register a policy factory of the given policy type with the ORB currently being initialized. Definition at line 303 of file ORBInitInfo.cpp. References check_validity(), TAO_ORB_Core::policy_factory_registry(), and TAO::PolicyFactory_Registry_Adapter::register_policy_factory().
00307 {
00308 this->check_validity ();
00309
00310 TAO::PolicyFactory_Registry_Adapter *registry =
00311 this->orb_core_->policy_factory_registry ();
00312
00313 if (registry == 0)
00314 {
00315 throw ::CORBA::INTERNAL ();
00316 }
00317
00318 registry->register_policy_factory (type, policy_factory);
00319 }
|
|
|
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 163 of file ORBInitInfo.cpp. References check_validity(), TAO_ORB_Core::orb(), and ACE_OS::strlen().
00164 {
00165 this->check_validity ();
00166
00167 if (id == 0 || ACE_OS::strlen (id) == 0)
00168 throw PortableInterceptor::ORBInitInfo::InvalidName ();
00169
00170 // The ORB is practically fully initialized by the time this point
00171 // is reached so just use the ORB's resolve_initial_references()
00172 // mechanism.
00173 return this->orb_core_->orb ()->resolve_initial_references (id);
00174 }
|
|
|
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 }
|
|
|
The number of arguments in the argument vector passed to CORBA::ORB_init(). Definition at line 244 of file ORBInitInfo.h. |
|
|
The argument vector passed to CORBA::ORB_init().
Definition at line 247 of file ORBInitInfo.h. |
|
|
Reference to the CodecFactory returned by ORBInitInfo::codec_factory(). Definition at line 251 of file ORBInitInfo.h. |
|
|
Reference to the ORB Core.
Reimplemented from CORBA::Object. Definition at line 240 of file ORBInitInfo.h. |
|
|
The number of allocated slots.
Definition at line 254 of file ORBInitInfo.h. Referenced by allocate_slot_id(), and slot_count(). |
1.3.6