summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvishal <vishal@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-11-01 02:11:18 +0000
committervishal <vishal@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-11-01 02:11:18 +0000
commitcd7b44950528bab3760c59c1ee4643d1a36eae52 (patch)
tree3b42b18103adfb404a240ab61d9230500d3ba1da
parentf5c385aea0df2828f46303c67290439fc8b0cd04 (diff)
downloadATCD-cd7b44950528bab3760c59c1ee4643d1a36eae52.tar.gz
*** empty log message ***
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Naming_Utils.cpp2
-rw-r--r--TAO/tao/ORB.cpp239
-rw-r--r--TAO/tao/ORB.h17
-rw-r--r--TAO/tao/ORB_Core.cpp7
-rw-r--r--TAO/tao/orbconf.h11
-rw-r--r--TAO/tao/params.cpp5
-rw-r--r--TAO/tao/params.h28
-rw-r--r--TAO/tao/params.i32
8 files changed, 122 insertions, 219 deletions
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Naming_Utils.cpp b/TAO/orbsvcs/orbsvcs/Naming/Naming_Utils.cpp
index bdef4870268..480fc2d7db0 100644
--- a/TAO/orbsvcs/orbsvcs/Naming/Naming_Utils.cpp
+++ b/TAO/orbsvcs/orbsvcs/Naming/Naming_Utils.cpp
@@ -181,7 +181,7 @@ TAO_Naming_Server::init_new_naming (CORBA::ORB_ptr orb,
// First, see if the user has given us a multicast port number
// on the command-line;
u_short port =
- TAO_ORB_Core_instance ()->orb_params ()->name_service_port ();
+ TAO_ORB_Core_instance ()->orb_params ()->service_port (NAMESERVICE);
if (port == 0)
{
diff --git a/TAO/tao/ORB.cpp b/TAO/tao/ORB.cpp
index a4f5bf5656e..a2b61b9bdf8 100644
--- a/TAO/tao/ORB.cpp
+++ b/TAO/tao/ORB.cpp
@@ -449,147 +449,82 @@ CORBA_ORB::resolve_ior_manipulation (CORBA::Environment& ACE_TRY_ENV)
}
CORBA_Object_ptr
-CORBA_ORB::resolve_name_service (ACE_Time_Value *timeout,
- CORBA::Environment& ACE_TRY_ENV)
-{
- CORBA_Object_var return_value = CORBA_Object::_nil ();
-
- // By now, the table filled in with -ORBInitRef arguments has been
- // checked. We only get here if the table didn't contain an initial
- // reference for the Name Service.
-
- // Check to see if the user has an environment variable.
- ACE_CString name_service_ior = ACE_OS::getenv ("NameServiceIOR");
-
- if (name_service_ior.length () != 0)
- {
- return_value =
- this->string_to_object (name_service_ior.c_str (),
- ACE_TRY_ENV);
- ACE_CHECK_RETURN (CORBA_Object::_nil ());
- }
- else
- {
- // First, determine if the port was supplied on the command line
- u_short port =
- this->orb_core_->orb_params ()->name_service_port ();
-
- if (port == 0)
- {
- // Look for the port among our environment variables.
- const char *port_number =
- ACE_OS::getenv ("NameServicePort");
-
- if (port_number != 0)
- port = (u_short) ACE_OS::atoi (port_number);
- else
- port = TAO_DEFAULT_NAME_SERVER_REQUEST_PORT;
- }
-
- return_value =
- this->multicast_to_service (TAO_OBJID_NAMESERVICE,
- port,
- timeout,
- ACE_TRY_ENV);
- ACE_CHECK_RETURN (CORBA_Object::_nil ());
- }
-
- // Return ior.
- return return_value._retn ();
-}
-
-CORBA_Object_ptr
-CORBA_ORB::resolve_trading_service (ACE_Time_Value *timeout,
- CORBA::Environment& ACE_TRY_ENV)
-{
- CORBA_Object_var return_value = CORBA_Object::_nil ();
-
- // By now, the table filled in with -ORBInitRef arguments has been
- // checked. We only get here if the table didn't contain an initial
- // reference for the Trading Service.
-
- // Check to see if the user has an environment variable.
- ACE_CString trading_service_ior = ACE_OS::getenv ("TradingServiceIOR");
-
- if (trading_service_ior.length () != 0)
- {
- return_value =
- this->string_to_object (trading_service_ior.c_str (), ACE_TRY_ENV);
- ACE_CHECK_RETURN (CORBA_Object::_nil ());
- }
- else
- {
- // First, determine if the port was supplied on the command line
- u_short port =
- this->orb_core_->orb_params ()->trading_service_port ();
-
- if (port == 0)
- {
- // Look for the port among our environment variables.
- const char *port_number = ACE_OS::getenv ("TradingServicePort");
-
- if (port_number != 0)
- port = (u_short) ACE_OS::atoi (port_number);
- else
- port = TAO_DEFAULT_TRADING_SERVER_REQUEST_PORT;
- }
-
- return_value =
- this->multicast_to_service (TAO_OBJID_TRADINGSERVICE,
- port,
- timeout,
- ACE_TRY_ENV);
- ACE_CHECK_RETURN (CORBA_Object::_nil ());
- }
-
- return return_value._retn ();
-}
-
-CORBA_Object_ptr
-CORBA_ORB::resolve_implrepo_service (ACE_Time_Value *timeout,
- CORBA::Environment& ACE_TRY_ENV)
+CORBA_ORB::resolve_service (MCAST_SERVICEID mcast_service_id,
+ ACE_Time_Value *timeout,
+ CORBA::Environment& ACE_TRY_ENV)
{
- CORBA_Object_var return_value = CORBA_Object::_nil ();
-
- // By now, the table filled in with -ORBInitRef arguments has been
- // checked. We only get here if the table didn't contain an initial
- // reference for the Implementation Repository.
-
- // Check to see if the user has an environment variable.
- ACE_CString implrepo_service_ior = ACE_OS::getenv ("ImplRepoServiceIOR");
-
- if (implrepo_service_ior.length () != 0)
- {
- return_value =
- this->string_to_object (implrepo_service_ior.c_str (), ACE_TRY_ENV);
- ACE_CHECK_RETURN (CORBA_Object::_nil ());
- }
- else
- {
- // First, determine if the port was supplied on the command line
- u_short port =
- this->orb_core_->orb_params ()->implrepo_service_port ();
-
- if (port == 0)
- {
- // Look for the port among our environment variables.
- const char *port_number = ACE_OS::getenv ("ImplRepoServicePort");
-
- if (port_number != 0)
- port = (u_short) ACE_OS::atoi (port_number);
- else
- port = TAO_DEFAULT_IMPLREPO_SERVER_REQUEST_PORT;
- }
-
- return_value =
- this->multicast_to_service (TAO_OBJID_IMPLREPOSERVICE,
- port,
- timeout,
- ACE_TRY_ENV);
- ACE_CHECK_RETURN (CORBA_Object::_nil ());
- }
+ const char * env_service_ior [] =
+ {
+ "NameServiceIOR",
+ "TradingServiceIOR",
+ "ImplRepoServiceIOR"
+ };
- return return_value._retn ();
+ const char * env_service_port [] =
+ {
+ "NameServicePort",
+ "TradingServicePort",
+ "ImplRepoServicePort"
+ };
+
+ u_short default_service_port [] =
+ {
+ TAO_DEFAULT_NAME_SERVER_REQUEST_PORT,
+ TAO_DEFAULT_TRADING_SERVER_REQUEST_PORT,
+ TAO_DEFAULT_IMPLREPO_SERVER_REQUEST_PORT
+ };
+
+ const char * service_objid [] =
+ {
+ TAO_OBJID_NAMESERVICE,
+ TAO_OBJID_TRADINGSERVICE,
+ TAO_OBJID_IMPLREPOSERVICE
+ };
+
+ CORBA_Object_var return_value = CORBA_Object::_nil ();
+
+ // By now, the table filled in with -ORBInitRef arguments has been
+ // checked. We only get here if the table didn't contain an initial
+ // reference for the requested Service.
+
+ // Check to see if the user has an environment variable.
+ ACE_CString service_ior = ACE_OS::getenv (env_service_ior[mcast_service_id]);
+
+ if (service_ior.length () != 0)
+ {
+ return_value =
+ this->string_to_object (service_ior.c_str (),
+ ACE_TRY_ENV);
+ ACE_CHECK_RETURN (CORBA_Object::_nil ());
+ }
+ else
+ {
+ // First, determine if the port was supplied on the command line
+ u_short port =
+ this->orb_core_->orb_params ()->service_port (mcast_service_id);
+
+ if (port == 0)
+ {
+ // Look for the port among our environment variables.
+ const char *port_number =
+ ACE_OS::getenv (env_service_port[mcast_service_id]);
+
+ if (port_number != 0)
+ port = (u_short) ACE_OS::atoi (port_number);
+ else
+ port = default_service_port[mcast_service_id];
+ }
+
+ return_value =
+ this->multicast_to_service (service_objid[mcast_service_id],
+ port,
+ timeout,
+ ACE_TRY_ENV);
+ ACE_CHECK_RETURN (CORBA_Object::_nil ());
+ }
+
+ // Return ior.
+ return return_value._retn ();
}
int
@@ -912,13 +847,13 @@ CORBA_ORB::resolve_initial_references (const char *name,
// entry.... Try the hard-coded ways to find the basic services...
if (ACE_OS::strcmp (name, TAO_OBJID_NAMESERVICE) == 0)
- return this->resolve_name_service (timeout, ACE_TRY_ENV);
-
+ return this->resolve_service (NAMESERVICE, timeout, ACE_TRY_ENV);
+
else if (ACE_OS::strcmp (name, TAO_OBJID_TRADINGSERVICE) == 0)
- return this->resolve_trading_service (timeout, ACE_TRY_ENV);
-
+ return this->resolve_service (TRADINGSERVICE, timeout, ACE_TRY_ENV);
+
else if (ACE_OS::strcmp (name, TAO_OBJID_IMPLREPOSERVICE) == 0)
- return this->resolve_implrepo_service (timeout, ACE_TRY_ENV);
+ return this->resolve_service (IMPLREPOSERVICE, timeout, ACE_TRY_ENV);
else
ACE_THROW_RETURN (CORBA::ORB::InvalidName (), CORBA::Object::_nil ());
@@ -1894,26 +1829,26 @@ CORBA_ORB::url_ior_string_to_object (const char* str,
this->orb_core_->connector_registry ()->make_mprofile (str,
mprofile,
ACE_TRY_ENV);
-
+
ACE_CHECK_RETURN (CORBA::Object::_nil ()); // Return nil.
-
+
if (retv != 0)
{
ACE_THROW_RETURN (CORBA::INV_OBJREF (
- CORBA_SystemException::_tao_minor_code (
- TAO_NULL_POINTER_MINOR_CODE,
- 0),
- CORBA::COMPLETED_NO),
+ CORBA_SystemException::_tao_minor_code (
+ TAO_NULL_POINTER_MINOR_CODE,
+ 0),
+ CORBA::COMPLETED_NO),
CORBA::Object::_nil ());
}
-
+
// Now make the TAO_Stub.
TAO_Stub *data = 0;
ACE_NEW_THROW_EX (data,
TAO_Stub ((char *) 0, mprofile, this->orb_core_),
CORBA::NO_MEMORY ());
ACE_CHECK_RETURN (CORBA::Object::_nil ());
-
+
TAO_Stub_Auto_Ptr safe_data (data);
// Figure out if the servant is collocated.
diff --git a/TAO/tao/ORB.h b/TAO/tao/ORB.h
index fa72c08e2c9..db4b303a52a 100644
--- a/TAO/tao/ORB.h
+++ b/TAO/tao/ORB.h
@@ -728,18 +728,11 @@ protected:
private:
- CORBA_Object_ptr resolve_name_service (ACE_Time_Value *timeout,
- CORBA::Environment& ACE_TRY_ENV);
- // Resolve the name service
-
- CORBA_Object_ptr resolve_trading_service (ACE_Time_Value *timeout,
- 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.
-
+ CORBA_Object_ptr resolve_service (MCAST_SERVICEID service_id,
+ ACE_Time_Value *timeout,
+ CORBA::Environment& ACE_TRY_ENV);
+ // Resolve the given service based on the service ID.
+
int multicast_query (char* &buf,
const char *service_name,
u_short port,
diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp
index 8e2e1212e10..9a82de34ed9 100644
--- a/TAO/tao/ORB_Core.cpp
+++ b/TAO/tao/ORB_Core.cpp
@@ -1064,9 +1064,10 @@ TAO_ORB_Core::init (int &argc, char *argv[], CORBA::Environment &ACE_TRY_ENV)
// Set the list of prefixes from -ORBDefaultInitRef.
this->orb_params ()->default_init_ref (default_init_ref);
- this->orb_params ()->name_service_port (ns_port);
- this->orb_params ()->trading_service_port (ts_port);
- this->orb_params ()->implrepo_service_port (ir_port);
+ this->orb_params ()->service_port (NAMESERVICE, ns_port);
+ this->orb_params ()->service_port (TRADINGSERVICE, ts_port);
+ this->orb_params ()->service_port (IMPLREPOSERVICE, ir_port);
+
this->orb_params ()->mcast_discovery_endpoint (mde);
this->orb_params ()->use_dotted_decimal_addresses (dotted_decimal_addresses);
this->orb_params ()->nodelay (nodelay);
diff --git a/TAO/tao/orbconf.h b/TAO/tao/orbconf.h
index 79f43a5dca9..dd8f2487a67 100644
--- a/TAO/tao/orbconf.h
+++ b/TAO/tao/orbconf.h
@@ -323,6 +323,17 @@
TAO_OBJID_POLICYCURRENT, \
TAO_OBJID_IORMANIPULATION
+// Service IDs for the services that are located through Multicast.
+enum MCAST_SERVICEID
+{
+ NAMESERVICE,
+ TRADINGSERVICE,
+ IMPLREPOSERVICE
+};
+
+// No. of services locatable through multicast.
+#define NO_OF_MCAST_SERVICES 3
+
// TAO Naming Service.
// Poa id of the root Naming Context in a Naming server.
diff --git a/TAO/tao/params.cpp b/TAO/tao/params.cpp
index bf1a4e94212..26cf6d0d3fa 100644
--- a/TAO/tao/params.cpp
+++ b/TAO/tao/params.cpp
@@ -13,9 +13,6 @@ TAO_ORB_Parameters::TAO_ORB_Parameters (void)
preconnect_insertion_strategy_ (this->preconnects_list_),
endpoints_list_ (),
endpoint_insertion_strategy_ (this->endpoints_list_),
- name_service_port_ (0),
- trading_service_port_ (0),
- implrepo_service_port_ (0),
init_ref_ (),
ior_lookup_table_ (),
default_init_ref_ (),
@@ -27,6 +24,8 @@ TAO_ORB_Parameters::TAO_ORB_Parameters (void)
use_dotted_decimal_addresses_ (0),
std_profile_components_ (1)
{
+ for (int i=0; i<= NO_OF_MCAST_SERVICES; i++)
+ this->service_port_[i] = 0;
}
TAO_ORB_Parameters::~TAO_ORB_Parameters (void)
diff --git a/TAO/tao/params.h b/TAO/tao/params.h
index f078a889497..02b67e32e83 100644
--- a/TAO/tao/params.h
+++ b/TAO/tao/params.h
@@ -119,24 +119,16 @@ public:
void add_endpoint (ACE_CString &endpoint);
// Specifies the endpoints on which this server is willing to
// listen for requests.
-
- CORBA::UShort name_service_port (void) const;
- void name_service_port (CORBA::UShort port);
- // Set/Get the port of our name service.
-
+
+ CORBA::UShort service_port (MCAST_SERVICEID service_id) const;
+ void service_port (MCAST_SERVICEID service_id, CORBA::UShort port);
+ // Set/Get the port of services locatable through multicast.
+
const char *mcast_discovery_endpoint (void) const;
void mcast_discovery_endpoint (const ACE_CString &mde);
// Set/Get address:port for Multicast Discovery Protocol for
// the Naming Service.
- CORBA::UShort trading_service_port (void) const;
- void trading_service_port (CORBA::UShort port);
- // Set/Get the port of our trading service.
-
- CORBA::UShort implrepo_service_port (void) const;
- void implrepo_service_port (CORBA::UShort port);
- // Set/Get the port 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.
@@ -217,14 +209,8 @@ private:
TAO_Endpoint_Insertion_Strategy endpoint_insertion_strategy_;
// Strategy used to insert endpoints into the endpoint container.
- CORBA::UShort name_service_port_;
- // The port number of our configured Naming Service.
-
- CORBA::UShort trading_service_port_;
- // The port number of our configured Trading Service.
-
- CORBA::UShort implrepo_service_port_;
- // The port number of our configured Implementation Repository.
+ CORBA::UShort service_port_[NO_OF_MCAST_SERVICES];
+ // Port numbers of the configured services.
ACE_CString mcast_discovery_endpoint_;
// address:port for Multicast Discovery Protocol for the Naming
diff --git a/TAO/tao/params.i b/TAO/tao/params.i
index 56e483915b5..795cb20b4bd 100644
--- a/TAO/tao/params.i
+++ b/TAO/tao/params.i
@@ -103,40 +103,18 @@ TAO_ORB_Parameters::use_dotted_decimal_addresses (int x)
this->use_dotted_decimal_addresses_ = x;
}
-ACE_INLINE void
-TAO_ORB_Parameters::name_service_port (CORBA::UShort port)
-{
- this->name_service_port_ = port;
-}
-
-ACE_INLINE CORBA::UShort
-TAO_ORB_Parameters::name_service_port (void) const
-{
- return this->name_service_port_;
-}
-
-ACE_INLINE void
-TAO_ORB_Parameters::trading_service_port (CORBA::UShort port)
-{
- this->trading_service_port_ = port;
-}
-
-ACE_INLINE CORBA::UShort
-TAO_ORB_Parameters::trading_service_port (void) const
-{
- return this->trading_service_port_;
-}
ACE_INLINE void
-TAO_ORB_Parameters::implrepo_service_port (CORBA::UShort port)
+TAO_ORB_Parameters::service_port (MCAST_SERVICEID service_id,
+ CORBA::UShort port)
{
- this->implrepo_service_port_ = port;
+ this->service_port_[service_id] = port;
}
ACE_INLINE CORBA::UShort
-TAO_ORB_Parameters::implrepo_service_port (void) const
+TAO_ORB_Parameters::service_port (MCAST_SERVICEID service_id) const
{
- return this->implrepo_service_port_;
+ return this->service_port_[service_id];
}
ACE_INLINE void