summaryrefslogtreecommitdiff
path: root/TAO/tao/IIOP_Profile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tao/IIOP_Profile.cpp')
-rw-r--r--TAO/tao/IIOP_Profile.cpp74
1 files changed, 58 insertions, 16 deletions
diff --git a/TAO/tao/IIOP_Profile.cpp b/TAO/tao/IIOP_Profile.cpp
index 4a767668f92..243be46125a 100644
--- a/TAO/tao/IIOP_Profile.cpp
+++ b/TAO/tao/IIOP_Profile.cpp
@@ -30,7 +30,8 @@ TAO_IIOP_Profile::TAO_IIOP_Profile (const ACE_INET_Addr& addr,
object_addr_ (addr),
hint_ (0),
// what about refcount_lock_ (),
- refcount_ (1)
+ refcount_ (1),
+ forward_to_ (0)
{
this->set(addr);
int l = ACE_OS::strlen (object_key);
@@ -53,7 +54,8 @@ TAO_IIOP_Profile::TAO_IIOP_Profile (const ACE_INET_Addr& addr,
object_addr_ (addr),
hint_ (0),
// what about refcount_lock_ (),
- refcount_ (1)
+ refcount_ (1),
+ forward_to_ (0)
{
this->set(addr);
this->create_body ();
@@ -71,7 +73,8 @@ TAO_IIOP_Profile::TAO_IIOP_Profile (const ACE_INET_Addr& addr,
object_addr_ (addr),
hint_ (0),
// what about refcount_lock_ (),
- refcount_ (1)
+ refcount_ (1),
+ forward_to_ (0)
{
this->set(addr);
int l = ACE_OS::strlen (object_key);
@@ -95,7 +98,8 @@ TAO_IIOP_Profile::TAO_IIOP_Profile (const ACE_INET_Addr& addr,
object_addr_ (addr),
hint_ (0),
// what about refcount_lock_ (),
- refcount_ (1)
+ refcount_ (1),
+ forward_to_ (0)
{
this->set(addr);
this->create_body ();
@@ -113,7 +117,8 @@ TAO_IIOP_Profile::TAO_IIOP_Profile (const char* host,
object_addr_ (port, host),
hint_ (0),
// what about refcount_lock_ (),
- refcount_ (1)
+ refcount_ (1),
+ forward_to_ (0)
{
if (host)
@@ -139,7 +144,8 @@ TAO_IIOP_Profile::TAO_IIOP_Profile (const char* host,
object_addr_ (addr),
hint_ (0),
// what about refcount_lock_ (),
- refcount_ (1)
+ refcount_ (1),
+ forward_to_ (0)
{
if (host)
@@ -165,7 +171,8 @@ TAO_IIOP_Profile::TAO_IIOP_Profile (const char* host,
object_addr_ (port, host),
hint_ (0),
// what about refcount_lock_ (),
- refcount_ (1)
+ refcount_ (1),
+ forward_to_ (0)
{
ACE_UNUSED_ARG (version);
@@ -186,7 +193,8 @@ TAO_IIOP_Profile::TAO_IIOP_Profile (const TAO_IIOP_Profile *pfile)
object_addr_(pfile->object_addr_),
hint_(0),
// what about refcount_lock_ (),
- refcount_ (1)
+ refcount_ (1),
+ forward_to_ (0)
{
ACE_NEW (this->host_,
@@ -206,7 +214,8 @@ TAO_IIOP_Profile::TAO_IIOP_Profile (const TAO_IIOP_Profile &pfile)
object_addr_(pfile.object_addr_),
hint_(0),
// what about refcount_lock_ (),
- refcount_ (1)
+ refcount_ (1),
+ forward_to_ (0)
{
ACE_NEW (this->host_,
@@ -226,7 +235,8 @@ TAO_IIOP_Profile::TAO_IIOP_Profile (const TAO_IOP_Version &version)
object_addr_ (),
hint_ (0),
// what about refcount_lock_ (),
- refcount_ (1)
+ refcount_ (1),
+ forward_to_ (0)
{
}
@@ -240,7 +250,8 @@ TAO_IIOP_Profile::TAO_IIOP_Profile (const char *string, CORBA::Environment &env)
object_addr_ (),
hint_ (0),
// what about refcount_lock_ (),
- refcount_ (1)
+ refcount_ (1),
+ forward_to_ (0)
{
parse_string (string, env);
}
@@ -255,7 +266,8 @@ TAO_IIOP_Profile::TAO_IIOP_Profile (void)
object_addr_ (),
hint_ (0),
// what about refcount_lock_ (),
- refcount_ (1)
+ refcount_ (1),
+ forward_to_ (0)
{
}
@@ -297,6 +309,12 @@ TAO_IIOP_Profile::~TAO_IIOP_Profile (void)
delete [] this->host_;
this->host_ = 0;
+
+ if (forward_to_)
+ {
+ delete forward_to_;
+ }
+
}
// return codes:
@@ -389,12 +407,12 @@ TAO_IIOP_Profile::parse_string (const char *string,
string += 5;
}
else
- ACE_THROW_RETURN (CORBA::MARSHAL (), 0);
+ ACE_THROW_RETURN (CORBA::MARSHAL (CORBA::COMPLETED_NO), 0);
if (this->version_.major != TAO_IIOP_Profile::DEF_IIOP_MAJOR
|| this->version_.minor > TAO_IIOP_Profile::DEF_IIOP_MINOR)
{
- ACE_THROW_RETURN (CORBA::MARSHAL (), -1);
+ ACE_THROW_RETURN (CORBA::MARSHAL (CORBA::COMPLETED_NO), -1);
}
// Pull off the "hostname:port/" part of the objref
@@ -406,7 +424,7 @@ TAO_IIOP_Profile::parse_string (const char *string,
if (cp == 0)
{
- ACE_THROW_RETURN (CORBA::MARSHAL (), -1);
+ ACE_THROW_RETURN (CORBA::MARSHAL (CORBA::COMPLETED_NO), -1);
}
if (this->host_)
@@ -435,7 +453,7 @@ TAO_IIOP_Profile::parse_string (const char *string,
if (cp == 0)
{
CORBA::string_free (this->host_);
- ACE_THROW_RETURN (CORBA::MARSHAL (), -1);
+ ACE_THROW_RETURN (CORBA::MARSHAL (CORBA::COMPLETED_NO), -1);
}
this->port_ = (CORBA::UShort) ACE_OS::atoi (start);
@@ -625,6 +643,30 @@ TAO_IIOP_Profile::_decr_refcnt (void)
return 0;
}
+
+void
+TAO_IIOP_Profile::forward_to (TAO_MProfile *mprofiles)
+{
+ // we assume ownership of the profile list!!
+ if (forward_to_)
+ delete this->forward_to_;
+
+ ACE_NEW (this->forward_to_,
+ TAO_MProfile (mprofiles));
+
+}
+
+TAO_MProfile *
+TAO_IIOP_Profile::forward_to (void)
+{
+ TAO_MProfile *temp;
+
+ ACE_NEW_RETURN (temp,
+ TAO_MProfile (this->forward_to_),
+ 0);
+ return temp;
+}
+
CORBA::String
TAO_IIOP_Profile::to_string (CORBA::Environment &env)
{