summaryrefslogtreecommitdiff
path: root/TAO/tao/Strategies/UIOP_Acceptor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tao/Strategies/UIOP_Acceptor.cpp')
-rw-r--r--TAO/tao/Strategies/UIOP_Acceptor.cpp64
1 files changed, 25 insertions, 39 deletions
diff --git a/TAO/tao/Strategies/UIOP_Acceptor.cpp b/TAO/tao/Strategies/UIOP_Acceptor.cpp
index 8c99460db16..516289b207e 100644
--- a/TAO/tao/Strategies/UIOP_Acceptor.cpp
+++ b/TAO/tao/Strategies/UIOP_Acceptor.cpp
@@ -83,23 +83,27 @@ TAO_UIOP_Acceptor::~TAO_UIOP_Acceptor (void)
}
int
-TAO_UIOP_Acceptor::create_mprofile (const TAO_ObjectKey &object_key,
- TAO_MProfile &mprofile,
- CORBA::Boolean share_profile)
+TAO_UIOP_Acceptor::create_profile (const TAO_ObjectKey &object_key,
+ TAO_MProfile &mprofile,
+ CORBA::Short priority)
{
// Check if multiple endpoints should be put in one profile or
// if they should be spread across multiple profiles.
- if (share_profile == 1)
- return this->create_shared_profile (object_key,
- mprofile);
+ if (priority == TAO_INVALID_PRIORITY)
+ return this->create_new_profile (object_key,
+ mprofile,
+ priority);
else
- return this->create_profile (object_key,
- mprofile);
+ return this->create_shared_profile (object_key,
+ mprofile,
+ priority);
+
}
int
-TAO_UIOP_Acceptor::create_profile (const TAO_ObjectKey &object_key,
- TAO_MProfile &mprofile)
+TAO_UIOP_Acceptor::create_new_profile (const TAO_ObjectKey &object_key,
+ TAO_MProfile &mprofile,
+ CORBA::Short priority)
{
ACE_UNIX_Addr addr;
@@ -118,8 +122,7 @@ TAO_UIOP_Acceptor::create_profile (const TAO_ObjectKey &object_key,
this->version_,
this->orb_core_),
-1);
-
- pfile->endpoint ()->priority (this->priority_);
+ pfile->endpoint ()->priority (priority);
if (mprofile.give_profile (pfile) == -1)
{
@@ -143,7 +146,8 @@ TAO_UIOP_Acceptor::create_profile (const TAO_ObjectKey &object_key,
int
TAO_UIOP_Acceptor::create_shared_profile (const TAO_ObjectKey &object_key,
- TAO_MProfile &mprofile)
+ TAO_MProfile &mprofile,
+ CORBA::Short priority)
{
TAO_Profile *pfile = 0;
TAO_UIOP_Profile *uiop_profile = 0;
@@ -164,7 +168,9 @@ TAO_UIOP_Acceptor::create_shared_profile (const TAO_ObjectKey &object_key,
{
// If <mprofile> doesn't contain UIOP_Profile, we need to create
// one.
- return create_profile (object_key, mprofile);
+ return create_new_profile (object_key,
+ mprofile,
+ priority);
}
else
{
@@ -178,7 +184,7 @@ TAO_UIOP_Acceptor::create_shared_profile (const TAO_ObjectKey &object_key,
ACE_NEW_RETURN (endpoint,
TAO_UIOP_Endpoint (addr),
-1);
- endpoint->priority (this->priority_);
+ endpoint->priority (priority);
uiop_profile->add_endpoint (endpoint);
return 0;
@@ -503,30 +509,10 @@ TAO_UIOP_Acceptor::parse_options (const char *str)
"option name.\n"),
-1);
- if (name == "priority")
- {
- CORBA::Short corba_priority =
- ACE_static_cast (CORBA::Short,
- ACE_OS::atoi (value.c_str ()));
-
- if (corba_priority >= 0
- /* && corba_priority < 32768 */)
- // priority_ and corba_priority will always be less
- // than 32768 since CORBA::Short is a signed 16 bit
- // integer.
- this->priority_ = corba_priority;
- else
- ACE_ERROR_RETURN ((LM_ERROR,
- "TAO (%P|%t) Invalid UIOP endpoint "
- "priority: <%s>\n",
- value.c_str ()),
- -1);
- }
- else
- ACE_ERROR_RETURN ((LM_ERROR,
- "TAO (%P|%t) Invalid UIOP option: <%s>\n",
- name.c_str ()),
- -1);
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "TAO (%P|%t) Invalid UIOP option: <%s>\n",
+ name.c_str ()),
+ -1);
}
}
return 0;