diff options
author | brunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-05-02 19:12:23 +0000 |
---|---|---|
committer | brunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-05-02 19:12:23 +0000 |
commit | 4c2559cb0f66d83923eac36850688b775e102fc3 (patch) | |
tree | ccb268864e63f0bf57dcc749fe2962023b3a6a06 | |
parent | c3f276ddd0839f9263096f11973655c0bc180ecf (diff) | |
download | ATCD-4c2559cb0f66d83923eac36850688b775e102fc3.tar.gz |
Adding ImplRepo to the resolve initial references.
-rw-r--r-- | TAO/tao/ORB.cpp | 45 | ||||
-rw-r--r-- | TAO/tao/ORB.h | 24 | ||||
-rw-r--r-- | TAO/tao/ORB_Core.cpp | 15 | ||||
-rw-r--r-- | TAO/tao/orbconf.h | 1 | ||||
-rw-r--r-- | TAO/tao/params.h | 7 | ||||
-rw-r--r-- | TAO/tao/params.i | 12 |
6 files changed, 96 insertions, 8 deletions
diff --git a/TAO/tao/ORB.cpp b/TAO/tao/ORB.cpp index 271d176232b..b69511b7659 100644 --- a/TAO/tao/ORB.cpp +++ b/TAO/tao/ORB.cpp @@ -176,6 +176,7 @@ CORBA_ORB::CORBA_ORB (TAO_ORB_Core* orb_core) schedule_service_ (CORBA_Object::_nil ()), event_service_ (CORBA_Object::_nil ()), trading_service_ (CORBA_Object::_nil ()), + implrepo_service_ (CORBA_Object::_nil ()), orb_core_ (orb_core), use_omg_ior_format_ (1), optimize_collocation_objects_ (1) @@ -223,6 +224,8 @@ CORBA_ORB::~CORBA_ORB (void) CORBA::release (this->event_service_); if (!CORBA::is_nil (this->trading_service_)) CORBA::release (this->trading_service_); + if (!CORBA::is_nil (this->implrepo_service_)) + CORBA::release (this->implrepo_service_); delete this->cond_become_leader_; } @@ -643,6 +646,45 @@ CORBA_ORB::resolve_trading_service (ACE_Time_Value *timeout, return CORBA_Object::_duplicate (return_value); } +CORBA_Object_ptr +CORBA_ORB::resolve_implrepo_service (ACE_Time_Value *timeout, + CORBA::Environment& ACE_TRY_ENV) +{ + // First check to see if we've already initialized this. + if (this->implrepo_service_ == CORBA_Object::_nil ()) + { + ACE_CString implrepo_service_ior = + this->orb_core_->orb_params ()->implrepo_service_ior (); + + // Second, check to see if the user has give us a parameter on + // the command-line. + if (implrepo_service_ior.length () == 0) + // Third, check to see if the user has an environment variable. + implrepo_service_ior = ACE_OS::getenv ("ImplRepoServiceIOR"); + + if (implrepo_service_ior.length () != 0) + { + ACE_TRY + { + this->implrepo_service_ = + this->string_to_object (implrepo_service_ior.c_str (), + ACE_TRY_ENV); + ACE_TRY_CHECK; + } + ACE_CATCHANY + { + this->implrepo_service_ = CORBA_Object::_nil (); + + ACE_RETHROW; + } + ACE_ENDTRY; + ACE_CHECK_RETURN (CORBA_Object::_duplicate (this->implrepo_service_)); + } + } + + return CORBA_Object::_duplicate (this->implrepo_service_); +} + int CORBA_ORB::multicast_query (char *buf, const char *service_name, @@ -886,6 +928,9 @@ CORBA_ORB::resolve_initial_references (CORBA::String name, else if (ACE_OS::strcmp (name, TAO_OBJID_TRADINGSERVICE) == 0) return this->resolve_trading_service (timeout, ACE_TRY_ENV); + else if (ACE_OS::strcmp (name, TAO_OBJID_IMPLREPOSERVICE) == 0) + return this->resolve_implrepo_service (timeout, ACE_TRY_ENV); + else if (ACE_OS::strcmp (name, TAO_OBJID_ROOTPOA) == 0) return this->resolve_root_poa (ACE_TRY_ENV); diff --git a/TAO/tao/ORB.h b/TAO/tao/ORB.h index e451a603e20..63b97cdb6ec 100644 --- a/TAO/tao/ORB.h +++ b/TAO/tao/ORB.h @@ -338,9 +338,9 @@ public: ACE_Time_Value *timeout, CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); // This method acts as a mini-bootstrapping Naming Service, which is - // provided by the ORB for certain well-known object references. - // TAO supports the "NameService", "TradingService", "RootPOA", and - // "POACurrent" via this method. The <timeout> value bounds the + // provided by the ORB for certain well-known object references. TAO + // supports the "NameService", "TradingService", "RootPOA", "ImplRepo", + // and "POACurrent" via this method. The <timeout> value bounds the // amount of time the ORB blocks waiting to resolve the service. // This is most useful for bootstrapping remote services, such as // the "NameService" or "TradingService", that are commonly resolved @@ -461,7 +461,7 @@ protected: private: CORBA_Object_ptr resolve_service (CORBA::String service_name, - ACE_Time_Value *timeout, + ACE_Time_Value *timeout, CORBA::Environment& ACE_TRY_ENV); // Resolve the service name. @@ -469,10 +469,14 @@ private: CORBA::Environment& ACE_TRY_ENV); // Resolve the trading object reference. + CORBA_Object_ptr resolve_implrepo_service (ACE_Time_Value *timeout, + CORBA::Environment& ACE_TRY_ENV); + // Resolve the Implementation Repository object reference. + int multicast_query (char *buf, - const char *service_name, - u_short port, - ACE_Time_Value *timeout); + const char *service_name, + u_short port, + ACE_Time_Value *timeout); // returns and IOR string, the client is responsible for freeing // memory! @@ -481,7 +485,7 @@ private: u_short port, ACE_Time_Value *timeout, CORBA::Environment& ACE_TRY_ENV); - // Resolve the refernce of a service of type <name>. + // Resolve the reference of a service of type <name>. CORBA::Object_ptr file_string_to_object (const char* filename, CORBA::Environment& env); @@ -540,6 +544,10 @@ private: // If this is non-_nil(), then this is the object reference to our // configured Trading. + CORBA_Object_ptr implrepo_service_; + // If this is non-_nil(), then this is the object reference to our + // configured Implementation Repository. + static int orb_init_count_; // Count of the number of times that <ORB_init> has been called. // This must be protected by <ACE_Static_Object_Lock>. diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp index e9418becc5d..5f4f2f1dd59 100644 --- a/TAO/tao/ORB_Core.cpp +++ b/TAO/tao/ORB_Core.cpp @@ -149,6 +149,9 @@ TAO_ORB_Core::init (int &argc, char *argv[]) // Trading Service port #. u_short ts_port = 0; + // Implementation Repository IOR string. + ACE_CString ir_ior; + // Buffer sizes for kernel socket buffers size_t rcv_sock_size = 0; size_t snd_sock_size = 0; @@ -271,6 +274,17 @@ TAO_ORB_Core::init (int &argc, char *argv[]) arg_shifter.consume_arg (); } } + else if (ACE_OS::strcmp (current_arg, "-ORBimplrepoior") == 0) + { + // Specify the IOR of the Implementation Repository + + arg_shifter.consume_arg (); + if (arg_shifter.is_parameter_next ()) + { + ir_ior = arg_shifter.get_current (); + arg_shifter.consume_arg (); + } + } else if (ACE_OS::strcmp (current_arg, "-ORBport") == 0) { // Specify the port number/name on which we should listen @@ -574,6 +588,7 @@ TAO_ORB_Core::init (int &argc, char *argv[]) this->orb_params ()->name_service_port (ns_port); this->orb_params ()->trading_service_ior (ts_ior); this->orb_params ()->trading_service_port (ts_port); + this->orb_params ()->implrepo_service_ior (ir_ior); this->orb_params ()->use_dotted_decimal_addresses (dotted_decimal_addresses); if (rcv_sock_size != 0) this->orb_params ()->sock_rcvbuf_size (rcv_sock_size); diff --git a/TAO/tao/orbconf.h b/TAO/tao/orbconf.h index 5ffa4dd70d8..fc353549fce 100644 --- a/TAO/tao/orbconf.h +++ b/TAO/tao/orbconf.h @@ -247,6 +247,7 @@ // something useful. #define TAO_OBJID_NAMESERVICE "NameService" #define TAO_OBJID_TRADINGSERVICE "TradingService" +#define TAO_OBJID_IMPLREPOSERVICE "ImplRepoService" #define TAO_OBJID_ROOTPOA "RootPOA" #define TAO_OBJID_POACURRENT "POACurrent" #define TAO_OBJID_INTERFACEREP "InterfaceRepository" diff --git a/TAO/tao/params.h b/TAO/tao/params.h index bffffcdd697..bc5c93adbe5 100644 --- a/TAO/tao/params.h +++ b/TAO/tao/params.h @@ -82,6 +82,10 @@ public: void trading_service_port (CORBA::UShort port); // Set/Get the port of our trading service. + const char *implrepo_service_ior (void) const; + void implrepo_service_ior (const ACE_CString &ir); + // Set/Get the IOR of the Implementation Repository service. + int sock_rcvbuf_size (void) const; void sock_rcvbuf_size (int); // Set/Get the size to be used for a socket's receive buffer. @@ -151,6 +155,9 @@ private: CORBA::UShort trading_service_port_; // The port number of our configured Trading Service. + ACE_CString implrepo_service_ior_; + // The IOR of our configured Implementation Repository. + ACE_CString init_ref_; // Initial Reference supplied as <ObjectID>:<IOR> diff --git a/TAO/tao/params.i b/TAO/tao/params.i index 53a742a9062..d50165033da 100644 --- a/TAO/tao/params.i +++ b/TAO/tao/params.i @@ -158,6 +158,18 @@ TAO_ORB_Parameters::trading_service_port (void) const return this->trading_service_port_; } +ACE_INLINE void +TAO_ORB_Parameters::implrepo_service_ior (const ACE_CString &ir) +{ + this->implrepo_service_ior_ = ir; +} + +ACE_INLINE const char * +TAO_ORB_Parameters::implrepo_service_ior (void) const +{ + return this->implrepo_service_ior_.c_str (); +} + ACE_INLINE TAO_IOR_LookupTable * TAO_ORB_Parameters::ior_lookup_table (void) { |