Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

TAO_ORBInitInfo Class Reference

An implementation of the PortableInterceptor::ORBInitInfo 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

typedef TAO_ORBInitInfo_ptr _ptr_type
typedef TAO_ORBInitInfo_var _var_type
virtual void * _tao_QueryInterface (ptr_arith_t type)
 Downcasting this object pointer to some other derived class. This QueryInterface stuff only work for local object. More...

virtual const char * _interface_repository_id (void) const
 The repository ID for the most derived class, this is an implementation method and does no remote invocations! More...

TAO_ORBInitInfo_ptr _duplicate (TAO_ORBInitInfo_ptr obj)
TAO_ORBInitInfo_ptr _narrow (CORBA::Object_ptr obj ACE_ENV_ARG_DECL_WITH_DEFAULTS)
TAO_ORBInitInfo_ptr _unchecked_narrow (CORBA::Object_ptr obj ACE_ENV_ARG_DECL_WITH_DEFAULTS)
TAO_ORBInitInfo_ptr _nil (void)
 Return a NULL object. More...


Public Methods

 TAO_ORBInitInfo (TAO_ORB_Core *orb_core, int argc, char *argv[])
 Constructor. More...

PortableInterceptor::ORBInitInfo Methods
These methods are exported by the PortableInterceptor::ORBInitInfo interface.

virtual CORBA::StringSeqarguments (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) throw (CORBA::SystemException)
 Return the argument vector for the ORB currently being initialized as a string sequence. More...

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

virtual IOP::CodecFactory_ptr codec_factory (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) throw (CORBA::SystemException)
 Return the CodecFactory for the ORB currently being initialized. More...

virtual void register_initial_reference (const char *id, CORBA::Object_ptr obj ACE_ENV_ARG_DECL_WITH_DEFAULTS) throw (CORBA::SystemException, PortableInterceptor::ORBInitInfo::InvalidName)
 Register a mapping between a string and a corresponding object reference with the ORB being initialized. More...

virtual CORBA::Object_ptr resolve_initial_references (const char *id ACE_ENV_ARG_DECL_WITH_DEFAULTS) throw (CORBA::SystemException, PortableInterceptor::ORBInitInfo::InvalidName)
 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. More...

virtual void add_client_request_interceptor (PortableInterceptor::ClientRequestInterceptor_ptr interceptor ACE_ENV_ARG_DECL_WITH_DEFAULTS) throw (CORBA::SystemException, PortableInterceptor::ORBInitInfo::DuplicateName)
 Register a client request interceptor with the ORB currently being initialized. More...

virtual void add_server_request_interceptor (PortableInterceptor::ServerRequestInterceptor_ptr interceptor ACE_ENV_ARG_DECL_WITH_DEFAULTS) throw (CORBA::SystemException, PortableInterceptor::ORBInitInfo::DuplicateName)
 Register a server request interceptor with the ORB currently being initialized. More...

virtual void add_ior_interceptor (PortableInterceptor::IORInterceptor_ptr interceptor ACE_ENV_ARG_DECL_WITH_DEFAULTS) throw (CORBA::SystemException, PortableInterceptor::ORBInitInfo::DuplicateName)
 Register an IOR interceptor with the ORB currently being initialized. More...

virtual PortableInterceptor::SlotId allocate_slot_id (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) throw (CORBA::SystemException)
 Reserve a slot in table found within the PortableInterceptor::Current object. More...

virtual void register_policy_factory (CORBA::PolicyType type, PortableInterceptor::PolicyFactory_ptr policy_factory ACE_ENV_ARG_DECL_WITH_DEFAULTS) throw (CORBA::SystemException)
 Register a policy factory of the given policy type with the ORB currently being initialized. More...

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 ACE_ENV_ARG_DECL_WITH_DEFAULTS) throw (CORBA::SystemException)
 Allocate a slot in the ORB's TSS resources. More...

TAO_ORB_Coreorb_core (void) const
 Return a pointer to the ORB Core associated with the ORB being initialized. More...


Protected Methods

 ~TAO_ORBInitInfo (void)
 Destructor is protected to force instantiation on the heap since ORBInitInfo is reference counted. More...

void check_validity (ACE_ENV_SINGLE_ARG_DECL)
 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. More...


Private Methods

 TAO_ORBInitInfo (const TAO_ORBInitInfo &)
 Prevent copying through the copy constructor and the assignment operator. More...

void operator= (const TAO_ORBInitInfo &)

Private Attributes

TAO_ORB_Coreorb_core_
 Reference to the ORB Core. More...

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

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

IOP::CodecFactory_var codec_factory_
 Reference to the CodecFactory returned by ORBInitInfo::codec_factory(). More...


Friends

CORBA::ORB_ptr CORBA::ORB_init (int &, char *argv[], const char *, CORBA_Environment &)

Detailed Description

An implementation of the PortableInterceptor::ORBInitInfo interface.

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

Definition at line 55 of file ORBInitInfo.h.


Member Typedef Documentation

typedef TAO_ORBInitInfo_ptr TAO_ORBInitInfo::_ptr_type
 

Implements PortableInterceptor::ORBInitInfo.

Definition at line 201 of file ORBInitInfo.h.

typedef TAO_ORBInitInfo_var TAO_ORBInitInfo::_var_type
 

Implements PortableInterceptor::ORBInitInfo.

Definition at line 202 of file ORBInitInfo.h.


Constructor & Destructor Documentation

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

Constructor.

Definition at line 23 of file ORBInitInfo.cpp.

00026   : orb_core_ (orb_core),
00027     argc_ (argc),
00028     argv_ (argv),
00029     codec_factory_ ()
00030 {
00031 }

TAO_ORBInitInfo::~TAO_ORBInitInfo void    [protected]
 

Destructor is protected to force instantiation on the heap since ORBInitInfo is reference counted.

Definition at line 33 of file ORBInitInfo.cpp.

00034 {
00035 }

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 323 of file ORBInitInfo.cpp.

References TAO_Local_RefCounted_Object::_add_ref, and CORBA::is_nil.

Referenced by tao_TAO_ORBInitInfo_duplicate.

00324 {
00325   if (!CORBA::is_nil (obj))
00326     obj->_add_ref ();
00327   return obj;
00328 }

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

The repository ID for the most derived class, this is an implementation method and does no remote invocations!

Implements PortableInterceptor::ORBInitInfo.

Definition at line 358 of file ORBInitInfo.cpp.

00359 {
00360   return "IDL:TAO_ORBInitInfo:1.0";
00361 }

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

Implements PortableInterceptor::ORBInitInfo.

Definition at line 292 of file ORBInitInfo.cpp.

References _unchecked_narrow, ACE_ENV_ARG_DECL, and ACE_ENV_ARG_PARAMETER.

Referenced by _tao_QueryInterface, _unchecked_narrow, TAO_PICurrent_ORBInitializer::pre_init, TAO_CodecFactory_ORBInitializer::pre_init, and tao_TAO_ORBInitInfo_narrow.

00296 {
00297   return TAO_ORBInitInfo::_unchecked_narrow (obj ACE_ENV_ARG_PARAMETER);
00298 }

TAO_ORBInitInfo_ptr TAO_ORBInitInfo::_nil void    [inline, static]
 

Return a NULL object.

Implements PortableInterceptor::ORBInitInfo.

Definition at line 217 of file ORBInitInfo.h.

Referenced by _unchecked_narrow, TAO_ORBInitInfo_var::TAO_ORBInitInfo_var, and tao_TAO_ORBInitInfo_nil.

00218     {
00219       return (TAO_ORBInitInfo_ptr)0;
00220     }

void * TAO_ORBInitInfo::_tao_QueryInterface ptr_arith_t    type [virtual]
 

Downcasting this object pointer to some other derived class. This QueryInterface stuff only work for local object.

Implements PortableInterceptor::ORBInitInfo.

Definition at line 330 of file ORBInitInfo.cpp.

References TAO_Local_RefCounted_Object::_add_ref, _narrow, and ptr_arith_t.

00331 {
00332   void *retv = 0;
00333   if (type == ACE_reinterpret_cast
00334     (ptr_arith_t,
00335       &TAO_ORBInitInfo::_narrow))
00336     retv = ACE_reinterpret_cast (void*, this);
00337   else if (type == ACE_reinterpret_cast
00338     (ptr_arith_t,
00339       &::PortableInterceptor::ORBInitInfo::_narrow))
00340     retv = ACE_reinterpret_cast
00341       (
00342         void *,
00343         ACE_static_cast
00344           (
00345             PortableInterceptor::ORBInitInfo_ptr,
00346             this
00347           )
00348       );
00349   else if (type == ACE_reinterpret_cast (ptr_arith_t, &CORBA::Object::_narrow))
00350     retv = ACE_reinterpret_cast (void *,
00351       ACE_static_cast (CORBA::Object_ptr, this));
00352 
00353   if (retv)
00354     this->_add_ref ();
00355   return retv;
00356 }

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

Implements PortableInterceptor::ORBInitInfo.

Definition at line 300 of file ORBInitInfo.cpp.

References _narrow, _nil, ACE_ENV_ARG_DECL_NOT_USED, CORBA::is_nil, and ptr_arith_t.

Referenced by _narrow.

00304 {
00305   if (CORBA::is_nil (obj))
00306     return TAO_ORBInitInfo::_nil ();
00307   return
00308       ACE_reinterpret_cast
00309         (
00310           TAO_ORBInitInfo_ptr,
00311             obj->_tao_QueryInterface
00312               (
00313                 ACE_reinterpret_cast
00314                   (
00315                     ptr_arith_t,
00316                     &TAO_ORBInitInfo::_narrow
00317                   )
00318               )
00319         );
00320 }

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

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

Implements PortableInterceptor::ORBInitInfo.

Definition at line 155 of file ORBInitInfo.cpp.

References CORBA_SystemException::_tao_minor_code, ACE_CHECK, ACE_ENV_ARG_DECL, ACE_ENV_ARG_PARAMETER, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_THROW, ENOTSUP, and TAO_DEFAULT_MINOR_CODE.

00160 {
00161 # if TAO_HAS_INTERCEPTORS == 1
00162   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00163   ACE_CHECK;
00164 
00165   this->orb_core_->add_interceptor (interceptor
00166                                      ACE_ENV_ARG_PARAMETER);
00167 #else
00168   ACE_UNUSED_ARG (interceptor);
00169   ACE_THROW (CORBA::NO_IMPLEMENT (
00170                CORBA_SystemException::_tao_minor_code (
00171                  TAO_DEFAULT_MINOR_CODE,
00172                  ENOTSUP),
00173                CORBA::COMPLETED_NO));
00174 #endif  /* TAO_HAS_INTERCEPTORS == 1 */
00175 }

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

Register an IOR interceptor with the ORB currently being initialized.

Implements PortableInterceptor::ORBInitInfo.

Definition at line 202 of file ORBInitInfo.cpp.

References ACE_CHECK, ACE_ENV_ARG_DECL, ACE_ENV_ARG_PARAMETER, and ACE_ENV_SINGLE_ARG_PARAMETER.

00207 {
00208   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00209   ACE_CHECK;
00210 
00211   this->orb_core_->add_interceptor (interceptor
00212                                      ACE_ENV_ARG_PARAMETER);
00213 }

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

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

Implements PortableInterceptor::ORBInitInfo.

Definition at line 178 of file ORBInitInfo.cpp.

References CORBA_SystemException::_tao_minor_code, ACE_CHECK, ACE_ENV_ARG_DECL, ACE_ENV_ARG_PARAMETER, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_THROW, ENOTSUP, and TAO_DEFAULT_MINOR_CODE.

00183 {
00184 # if TAO_HAS_INTERCEPTORS == 1
00185   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00186   ACE_CHECK;
00187 
00188   this->orb_core_->add_interceptor (interceptor
00189                                      ACE_ENV_ARG_PARAMETER);
00190 
00191 #else
00192   ACE_UNUSED_ARG (interceptor);
00193   ACE_THROW (CORBA::NO_IMPLEMENT (
00194                CORBA_SystemException::_tao_minor_code (
00195                  TAO_DEFAULT_MINOR_CODE,
00196                  ENOTSUP),
00197                CORBA::COMPLETED_NO));
00198 #endif  /* TAO_HAS_INTERCEPTORS == 1 */
00199 }

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

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

Implements PortableInterceptor::ORBInitInfo.

Definition at line 216 of file ORBInitInfo.cpp.

References CORBA_SystemException::_tao_minor_code, ACE_CHECK_RETURN, ACE_ENV_SINGLE_ARG_DECL, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_THROW_RETURN, ENOTSUP, and TAO_DEFAULT_MINOR_CODE.

00218 {
00219   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00220   ACE_CHECK_RETURN (0);
00221 
00222 #if TAO_HAS_INTERCEPTORS == 1
00223   return this->orb_core_->pi_current ()->allocate_slot_id ();
00224 #else
00225   ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (
00226                       CORBA_SystemException::_tao_minor_code (
00227                         TAO_DEFAULT_MINOR_CODE,
00228                         ENOTSUP),
00229                       CORBA::COMPLETED_NO),
00230                     0);
00231 #endif  /* TAO_HAS_INTERCEPTORS == 1 */
00232 }

size_t TAO_ORBInitInfo::allocate_tss_slot_id ACE_CLEANUP_FUNC cleanup    ACE_ENV_ARG_DECL_WITH_DEFAULTS 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 253 of file ORBInitInfo.cpp.

References CORBA_SystemException::_tao_minor_code, ACE_CHECK_RETURN, ACE_CLEANUP_FUNC, ACE_ENV_ARG_DECL, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_THROW_RETURN, and TAO_DEFAULT_MINOR_CODE.

00256 {
00257   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00258   ACE_CHECK_RETURN (0);
00259 
00260   size_t slot_id = 0;
00261 
00262   int result = this->orb_core_->add_tss_cleanup_func (cleanup,
00263                                                       slot_id);
00264 
00265   if (result != 0)
00266     ACE_THROW_RETURN (CORBA::INTERNAL (
00267                         CORBA_SystemException::_tao_minor_code (
00268                           TAO_DEFAULT_MINOR_CODE,
00269                           errno),
00270                         CORBA::COMPLETED_NO),
00271                       0);
00272 
00273   return slot_id;
00274 }

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

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

Implements PortableInterceptor::ORBInitInfo.

Definition at line 38 of file ORBInitInfo.cpp.

References CORBA_SystemException::_tao_minor_code, ACE_CHECK_RETURN, ACE_ENV_SINGLE_ARG_DECL, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_NEW_THROW_EX, CORBA::string_dup, and TAO_DEFAULT_MINOR_CODE.

00040 {
00041   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00042   ACE_CHECK_RETURN (0);
00043 
00044   // In accordance with the C++ mapping for sequences, it is up to the
00045   // caller to deallocate storage for returned sequences.
00046 
00047   CORBA::StringSeq *args = 0;
00048   ACE_NEW_THROW_EX (args,
00049                     CORBA::StringSeq,
00050                     CORBA::NO_MEMORY (
00051                       CORBA_SystemException::_tao_minor_code (
00052                         TAO_DEFAULT_MINOR_CODE,
00053                         ENOMEM),
00054                       CORBA::COMPLETED_NO));
00055   ACE_CHECK_RETURN (0);
00056 
00057   CORBA::StringSeq_var safe_args (args);
00058 
00059   // Copy the argument vector to the string sequence.
00060 
00061   args->length (this->argc_);   // Not a problem if argc is zero.
00062   for (int i = 0; i < this->argc_; ++i)
00063     (*args)[i] = CORBA::string_dup (this->argv_[i]);
00064 
00065   return safe_args._retn ();
00066 }

void TAO_ORBInitInfo::check_validity ACE_ENV_SINGLE_ARG_DECL    [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 277 of file ORBInitInfo.cpp.

References ACE_ENV_SINGLE_ARG_DECL, ACE_THROW, orb_core_, and TAO_DEFAULT_MINOR_CODE.

00278 {
00279   if (this->orb_core_ == 0)
00280     {
00281       // As defined by the Portable Interceptor specification, throw a
00282       // CORBA::OBJECT_NOT_EXIST exception after CORBA::ORB_init() has
00283       // completed.  CORBA::ORB_init() sets the ORB core pointer in
00284       // this instance to zero when it is done initializing the ORB,
00285       // which is why we base "existence" on the validity of the ORB
00286       // core pointer.
00287       ACE_THROW (CORBA::OBJECT_NOT_EXIST (TAO_DEFAULT_MINOR_CODE,
00288                                           CORBA::COMPLETED_NO));
00289     }
00290 }

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

Return the CodecFactory for the ORB currently being initialized.

Implements PortableInterceptor::ORBInitInfo.

Definition at line 81 of file ORBInitInfo.cpp.

References IOP::CodecFactory::_duplicate, IOP::CodecFactory::_nil, ACE_CHECK_RETURN, ACE_ENV_SINGLE_ARG_DECL, ACE_NEW_THROW_EX, CORBA::is_nil, and TAO_DEFAULT_MINOR_CODE.

00083 {
00084   if (CORBA::is_nil (this->codec_factory_.in ()))
00085     {
00086       // A new instance must be allocated since the application code
00087       // may have registered an ORBInitializer that requires a
00088       // CodecFactory before the CodecFactory is itself registered
00089       // with the ORB.
00090       IOP::CodecFactory_ptr codec_factory;
00091       ACE_NEW_THROW_EX (codec_factory,
00092                         TAO_CodecFactory (this->orb_core_),
00093                           CORBA::NO_MEMORY (
00094                             CORBA::SystemException::_tao_minor_code (
00095                               TAO_DEFAULT_MINOR_CODE,
00096                               ENOMEM),
00097                             CORBA::COMPLETED_NO));
00098       ACE_CHECK_RETURN (IOP::CodecFactory::_nil ());
00099 
00100       this->codec_factory_ = codec_factory;
00101     }
00102 
00103   return IOP::CodecFactory::_duplicate (this->codec_factory_.in ());
00104 }

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

ACE_INLINE TAO_ORB_Core * TAO_ORBInitInfo::orb_core void    const
 

Return a pointer to the ORB Core associated with the ORB being initialized.

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.

Definition at line 6 of file ORBInitInfo.inl.

References orb_core_.

00007 {
00008   return this->orb_core_;
00009 }

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

Return the ORBid for the ORB currently being initialized.

Implements PortableInterceptor::ORBInitInfo.

Definition at line 69 of file ORBInitInfo.cpp.

References ACE_CHECK_RETURN, ACE_ENV_SINGLE_ARG_DECL, ACE_ENV_SINGLE_ARG_PARAMETER, and CORBA::string_dup.

00071 {
00072   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00073   ACE_CHECK_RETURN (0);
00074 
00075   // In accordance with the C++ mapping for strings, return a copy.
00076 
00077   return CORBA::string_dup (this->orb_core_->orbid ());
00078 }

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

Register a mapping between a string and a corresponding object reference with the ORB being initialized.

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.

Implements PortableInterceptor::ORBInitInfo.

Definition at line 107 of file ORBInitInfo.cpp.

References ACE_CHECK, ACE_ENV_ARG_DECL, ACE_ENV_ARG_PARAMETER, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_THROW, TAO_Object_Ref_Table::register_initial_reference, and ACE_OS_String::strlen.

00113 {
00114   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00115   ACE_CHECK;
00116 
00117   if (id == 0)
00118     ACE_THROW (PortableInterceptor::ORBInitInfo::InvalidName ());
00119   else if (ACE_OS_String::strlen (id) == 0)
00120     ACE_THROW (PortableInterceptor::ORBInitInfo::InvalidName ());
00121 
00122 
00123   TAO_Object_Ref_Table &table = this->orb_core_->object_ref_table ();
00124 
00125   table.register_initial_reference (id, obj ACE_ENV_ARG_PARAMETER);
00126   ACE_CHECK;
00127 }

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

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

Implements PortableInterceptor::ORBInitInfo.

Definition at line 235 of file ORBInitInfo.cpp.

References ACE_CHECK, ACE_ENV_ARG_DECL, ACE_ENV_ARG_PARAMETER, ACE_ENV_SINGLE_ARG_PARAMETER, and TAO_PolicyFactory_Registry::register_policy_factory.

00240 {
00241   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00242   ACE_CHECK;
00243 
00244   TAO_PolicyFactory_Registry *registry =
00245     this->orb_core_->policy_factory_registry ();
00246 
00247   registry->register_policy_factory (type,
00248                                      policy_factory
00249                                       ACE_ENV_ARG_PARAMETER);
00250 }

CORBA::Object_ptr TAO_ORBInitInfo::resolve_initial_references const char *id    ACE_ENV_ARG_DECL_WITH_DEFAULTS 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.

Implements PortableInterceptor::ORBInitInfo.

Definition at line 130 of file ORBInitInfo.cpp.

References ACE_CHECK_RETURN, ACE_ENV_ARG_DECL, ACE_ENV_ARG_PARAMETER, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_THROW_RETURN, and ACE_OS_String::strlen.

00135 {
00136   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00137   ACE_CHECK_RETURN (CORBA::Object::_nil ());
00138 
00139   if (id == 0)
00140     ACE_THROW_RETURN (PortableInterceptor::ORBInitInfo::InvalidName (),
00141                       CORBA::Object::_nil ());
00142   else if (ACE_OS_String::strlen (id) == 0)
00143     ACE_THROW_RETURN (PortableInterceptor::ORBInitInfo::InvalidName (),
00144                       CORBA::Object::_nil ());
00145 
00146   // The ORB is practically fully initialized by the time this point
00147   // is reached so just use the ORB's resolve_initial_references()
00148   // mechanism.
00149   return
00150     this->orb_core_->orb ()->resolve_initial_references (id
00151                                                           ACE_ENV_ARG_PARAMETER);
00152 }


Friends And Related Function Documentation

CORBA::ORB_ptr CORBA::ORB_init int &   ,
char *    argv[],
const char *   ,
CORBA_Environment  
[friend]
 


Member Data Documentation

int TAO_ORBInitInfo::argc_ [private]
 

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

Definition at line 253 of file ORBInitInfo.h.

char** TAO_ORBInitInfo::argv_ [private]
 

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

Definition at line 256 of file ORBInitInfo.h.

IOP::CodecFactory_var TAO_ORBInitInfo::codec_factory_ [private]
 

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

Definition at line 260 of file ORBInitInfo.h.

TAO_ORB_Core* TAO_ORBInitInfo::orb_core_ [private]
 

Reference to the ORB Core.

Definition at line 249 of file ORBInitInfo.h.

Referenced by check_validity, and orb_core.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 15:32:33 2003 for TAO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002